<p>From Brandon Kelly on Discord:</p>
<blockquote>
<p>If you go to the Assets index page and change the site to your second
site. Are you able to see all the same assets there? (Specifically
whatever ones appear to be causing this error on your second site)</p>
</blockquote>
<p>They weren't listed.</p>
<blockquote>
<p>Had a feeling that would be the case. That's your problem. If you run
<code>php craft resave/assets</code>, does that fix it?</p>
</blockquote>
<p><strong>Yes it did!</strong> Thanks :-)</p>

CC BY-SA 4.0
2020-10-01T22:08:03.160Z
2020-10-01T22:08:03.160Z
GazCrane
<p>I have a multi-site setup running within Craft 3. Everything seems to be working nicely, except for image transforms. For example:</p>
<p>The following transform on the default site works correctly:</p>
<pre><code>https://www.default-site.com/index.php?p=actions/assets/generate-transform&amp;transformId=10406
</code></pre>
<p>The second-site transform gives an internal server error 500</p>
<pre><code>https://www.second-site.com/index.php?p=actions/assets/generate-transform&amp;transformId=10406
</code></pre>
<p>My 'second-site' index.php has the following constants:</p>
<pre><code>define('CRAFT_SITE', 'second-site');
define('CRAFT_BASE_PATH', '/home1/client-dir');
define('CRAFT_STORAGE_PATH', CRAFT_BASE_PATH.'/storage');
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH.'/vendor');
define('CRAFT_TEMPLATES_PATH', CRAFT_BASE_PATH.'/templates');
</code></pre>
<p>I should note that <strong>I'm using Amazon S3 to serve my assets</strong> (using the S3 plugin). Also, the assets field is set to relate assets from the default site.</p>
<p><strong>UPDATE:</strong> In my log file, I'm seeing the following error:</p>
<pre><code>2020-10-01 20:25:27 [-][-][-][error][Error] Error: Call to a member function getVolume() on null in /home1/client-dir/vendor/craftcms/cms/src/services/AssetTransforms.php:648
Stack trace:
#0 /home1/client-dir/vendor/craftcms/cms/src/services/AssetTransforms.php(603): craft\services\AssetTransforms-&gt;_generateTransform(Object(craft\models\AssetTransformIndex))
#1 /home1/client-dir/vendor/craftcms/cms/src/controllers/AssetsController.php(1179): craft\services\AssetTransforms-&gt;ensureTransformUrlByIndexModel(Object(craft\models\AssetTransformIndex))
#2 [internal function]: craft\controllers\AssetsController-&gt;actionGenerateTransform(11357)
#3 /home1/client-dir/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#4 /home1/client-dir/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction-&gt;runWithParams(Array)
#5 /home1/client-dir/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller-&gt;runAction('generate-transf...', Array)
#6 /home1/client-dir/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller-&gt;runAction('generate-transf...', Array)
#7 /home1/client-dir/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module-&gt;runAction('assets/generate...', Array)
#8 /home1/client-dir/vendor/craftcms/cms/src/web/Application.php(559): craft\web\Application-&gt;runAction('assets/generate...', Array)
#9 /home1/client-dir/vendor/craftcms/cms/src/web/Application.php(270): craft\web\Application-&gt;_processActionRequest(Object(craft\web\Request))
#10 /home1/client-dir/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application-&gt;handleRequest(Object(craft\web\Request))
#11 /home1/client-dir/public_html/second-site/index.php(28): yii\base\Application-&gt;run()
#12 {main}
2020-10-01 20:25:26 [-][-][-][info][application] $_GET = [
    'p' =&gt; 'actions/assets/generate-transform'
    'transformId' =&gt; '11357'
]
</code></pre>
<p><strong>Craft Version:</strong> 3.4.24  <strong>Amazon S3 Plugin:</strong> 1.2.8</p>
<p>Has anyone else experienced this? Any ideas?</p>

<image-transforms><multi-site><s3><amazon>
Generate transforms only working on default install (multi-site)
# Generate transforms only working on default install (multi-site)

(Asked by: username_0 on 2020-09-27)

I have a multi-site setup running within Craft 3. Everything seems to be working nicely, except for image transforms. For example:
The following transform on the default site works correctly:
https://www.default-site.com/index.php?p=actions/assets/generate-transform&transformId=10406

The second-site transform gives an internal server error 500
https://www.second-site.com/index.php?p=actions/assets/generate-transform&transformId=10406

My 'second-site' index.php has the following constants:
define('CRAFT_SITE', 'second-site');
define('CRAFT_BASE_PATH', '/home1/client-dir');
define('CRAFT_STORAGE_PATH', CRAFT_BASE_PATH.'/storage');
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH.'/vendor');
define('CRAFT_TEMPLATES_PATH', CRAFT_BASE_PATH.'/templates');

I should note that I'm using Amazon S3 to serve my assets (using the S3 plugin). Also, the assets field is set to relate assets from the default site.
UPDATE: In my log file, I'm seeing the following error:
2020-10-01 20:25:27 [-][-][-][error][Error] Error: Call to a member function getVolume() on null in /home1/client-dir/vendor/craftcms/cms/src/services/AssetTransforms.php:648
Stack trace:
#0 /home1/client-dir/vendor/craftcms/cms/src/services/AssetTransforms.php(603): craft\services\AssetTransforms->_generateTransform(Object(craft\models\AssetTransformIndex))
#1 /home1/client-dir/vendor/craftcms/cms/src/controllers/AssetsController.php(1179): craft\services\AssetTransforms->ensureTransformUrlByIndexModel(Object(craft\models\AssetTransformIndex))
#2 [internal function]: craft\controllers\AssetsController->actionGenerateTransform(11357)
#3 /home1/client-dir/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#4 /home1/client-dir/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#5 /home1/client-dir/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('generate-transf...', Array)
#6 /home1/client-dir/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('generate-transf...', Array)
#7 /home1/client-dir/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module->runAction('assets/generate...', Array)
#8 /home1/client-dir/vendor/craftcms/cms/src/web/Application.php(559): craft\web\Application->runAction('assets/generate...', Array)
#9 /home1/client-dir/vendor/craftcms/cms/src/web/Application.php(270): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#10 /home1/client-dir/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#11 /home1/client-dir/public_html/second-site/index.php(28): yii\base\Application->run()
#12 {main}
2020-10-01 20:25:26 [-][-][-][info][application] $_GET = [
    'p' => 'actions/assets/generate-transform'
    'transformId' => '11357'
]

Craft Version: 3.4.24  Amazon S3 Plugin: 1.2.8
Has anyone else experienced this? Any ideas?

**Tags:** image-transforms, multi-site, s3, amazon

---

## 1 answers

### Answer by username_0 on 2020-10-01. Score: 1 | Accepted answer

From Brandon Kelly on Discord:

> If you go to the Assets index page and change the site to your second
> site. Are you able to see all the same assets there? (Specifically
> whatever ones appear to be causing this error on your second site)

They weren't listed.

> Had a feeling that would be the case. That's your problem. If you run
> `php craft resave/assets`, does that fix it?

**Yes it did!** Thanks :-)


---

