<p>When transforming images, we’re getting the following error on the client’s production server.</p>
<blockquote>
<p><strong>Internal Server Error</strong></p>
<p>Argument 1 passed to Craft\AssetTransformsService::ensureTransformUrlByIndexModel() must be an instance of Craft\AssetTransformIndexModel, null given, called in /craft/app/services/ResourcesService.php on line 223 and defined</p>
</blockquote>
<p>As a consequence image elements on the page don’t appear. When reloading the page a second time images are displayed as expected.</p>
<p>What might be the cause of this?</p>
<hr />
<p><strong>Edit</strong></p>
<p>As requested in comments…</p>
<p>The .htaccess, below-pasted, is just the default.</p>
<pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
&lt;/IfModule&gt;
</code></pre>
<p>The template transform is very simple.</p>
<pre><code>&lt;img src=&quot;{{ block.image.first().getUrl({ width: 560, height: 310 }) }}&quot; alt=&quot;&quot;&gt;
</code></pre>
<p>The transform does work but only displays on the second page load.</p>

CC BY-SA 3.0
2014-07-25T13:35:38.360Z
Could please you add your template-code, so we can make sure the issue is not in there.
Victor
CC BY-SA 3.0
2014-07-25T17:09:14.667Z
Would also like to see your public html .htaccess code as well.
Brad Bell
CC BY-SA 3.0
2014-07-28T15:29:33.403Z
Can you enable devMode (http://buildwithcraft.com/docs/config-settings#devMode), reproduce the error and share the full stack trace?
Brad Bell
CC BY-SA 3.0
2014-09-28T22:24:58.140Z
I'm about 99% sure this was a bug that has been fixed by the latest release. Are you still seeing it?
Brad Bell
CC BY-SA 3.0
2014-09-29T14:51:17.803Z
Thanks, @BradBell. I haven’t got access to that environment to check. Will follow up if it surfaces again.
Joshua Baker
<assets><image-transforms>
Exception when transforming image
# Exception when transforming image

(Asked by: username_0 on 2014-07-25)

When transforming images, we’re getting the following error on the client’s production server.

Internal Server Error
Argument 1 passed to Craft\AssetTransformsService::ensureTransformUrlByIndexModel() must be an instance of Craft\AssetTransformIndexModel, null given, called in /craft/app/services/ResourcesService.php on line 223 and defined

As a consequence image elements on the page don’t appear. When reloading the page a second time images are displayed as expected.
What might be the cause of this?

Edit
As requested in comments…
The .htaccess, below-pasted, is just the default.

    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]


The template transform is very simple.


The transform does work but only displays on the second page load.

**Tags:** assets, image-transforms

> **Comments:**
> **username_1**: Could please you add your template-code, so we can make sure the issue is not in there.  
> **username_2**: Would also like to see your public html .htaccess code as well.  
> **username_2**: Can you enable devMode (http://buildwithcraft.com/docs/config-settings#devMode), reproduce the error and share the full stack trace?  
> **username_2**: I'm about 99% sure this was a bug that has been fixed by the latest release. Are you still seeing it?  
> **username_0**: Thanks, @BradBell. I haven’t got access to that environment to check. Will follow up if it surfaces again.  

---

## 0 answers

