0

I'm trying to transform some images on my site from JPG to WebP.

However, I am having a problem to do so on my production site. I get this error:

2021-01-27 16:13:40 [-][-][-][error][craft\errors\AssetTransformException] craft\errors\AssetTransformException: Failed to generate transform with id of 29. in /container/application/vendor/craftcms/cms/src/services/AssetTransforms.php:724
Stack trace:
#0 /container/application/vendor/craftcms/cms/src/services/Assets.php(620): craft\services\AssetTransforms->ensureTransformUrlByIndexModel(Object(craft\models\AssetTransformIndex))
#1 /container/application/vendor/craftcms/cms/src/elements/Asset.php(1165): craft\services\Assets->getAssetUrl(Object(craft\elements\Asset), Array, true)
#2 /container/application/vendor/twig/twig/src/Extension/CoreExtension.php(1507): craft\elements\Asset->getUrl(Array)
#3 /container/application/vendor/craftcms/cms/src/helpers/Template.php(106): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\elements\Asset), 'getUrl', Array, 'method', false, false)
#4 /container/application/storage/runtime/compiled_templates/08/08064a4f4b8e15f3fcde9e9f42f0ea8cce2762429e1b3363ecbb5b4a7a54f109.php(112): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\elements\Asset), 'getUrl', Array, 'method')
#5 /container/application/vendor/twig/twig/src/Template.php(405): __TwigTemplate_7862f579a101eba0f4ccb23060b23ef58668fc8ead42f1db5ef6ceed7e7f5ed4->doDisplay(Array, Array)
#6 /container/application/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#7 /container/application/storage/runtime/compiled_templates/e2/e221e5026a04c9d36173b8e94ad7a74591a49d44d48040296c0b79c7cc83f1a0.php(56): Twig\Template->display(Array)
#8 /container/application/vendor/twig/twig/src/Template.php(182): __TwigTemplate_8f61f3bf367228bd3663ae382ac274033b0923a031e32ddde771726cec1050e2->block_template(Array, Array)
#9 /container/application/storage/runtime/compiled_templates/59/59f6a5301ec4179c8426f041747527ff561fbc45aafc2ee5243d224105929f86.php(98): Twig\Template->displayBlock('template', Array, Array)
#10 /container/application/vendor/twig/twig/src/Template.php(405): __TwigTemplate_e52666eaab15c76f2f47c5bb84d08c14fdc434945143594786b8800bfebc966c->doDisplay(Array, Array)
#11 /container/application/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#12 /container/application/storage/runtime/compiled_templates/e2/e221e5026a04c9d36173b8e94ad7a74591a49d44d48040296c0b79c7cc83f1a0.php(43): Twig\Template->display(Array, Array)
#13 /container/application/vendor/twig/twig/src/Template.php(405): __TwigTemplate_8f61f3bf367228bd3663ae382ac274033b0923a031e32ddde771726cec1050e2->doDisplay(Array, Array)
#14 /container/application/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#15 /container/application/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
#16 /container/application/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
#17 /container/application/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
#18 /container/application/vendor/craftcms/cms/src/web/View.php(389): Twig\Environment->render('_singles/home', Array)
#19 /container/application/vendor/craftcms/cms/src/web/View.php(450): craft\web\View->renderTemplate('_singles/home', Array)
#20 /container/application/vendor/craftcms/cms/src/web/Controller.php(241): craft\web\View->renderPageTemplate('_singles/home', Array, 'site')
#21 /container/application/vendor/craftcms/cms/src/controllers/TemplatesController.php(100): craft\web\Controller->renderTemplate('_singles/home', Array)
#22 [internal function]: craft\controllers\TemplatesController->actionRender('_singles/home', Array)
#23 /container/application/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#24 /container/application/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#25 /container/application/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('render', Array)
#26 /container/application/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('render', Array)
#27 /container/application/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('templates/rende...', Array)
#28 /container/application/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('templates/rende...', Array)
#29 /container/application/vendor/craftcms/cms/src/web/Application.php(259): yii\web\Application->handleRequest(Object(craft\web\Request))
#30 /container/application/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#31 /container/application/public/index.php(21): yii\base\Application->run()
#32 {main}

Template:

{% set webp = { mode: 'crop', width: 400, height: 280, quality: 100, format: 'webp' } %}
{% set reg = { mode: 'crop', width: 400, height: 280, quality: 100 } %}
 <picture>
    <source srcset="{{ image.getUrl(webp) }}" data-srcset="{{ image.getUrl(webp) }}">
    <img class="mb-6 md:mb-0" src="{{ image.getUrl(reg) }}" alt="{{ post.title }}">
 </picture>

I don't have this problem in my local

Any help is highly appreciated

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.