You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from 4.4.x to 4.5.13 we have an issue with generating transformations from assets stored on a S3 bucket. We get the following error:
[x.x.x.x][1][-][error][craft\errors\ImageTransformException] craft\errors\FsObjectNotFoundException: The file "test-image.jpg" does not exist. in /mnt/dlfnova/htdocs/vendor/craftcms/cms/src/helpers/ImageTransforms.php:220
Stack trace:
#0 /mnt/dlfnova/htdocs/vendor/craftcms/cms/src/helpers/ImageTransforms.php(423): craft\helpers\ImageTransforms::getLocalImageSource(Object(craft\elements\Asset))
#1 /mnt/dlfnova/htdocs/vendor/craftcms/cms/src/imagetransforms/ImageTransformer.php(378): craft\helpers\ImageTransforms::generateTransform(Object(craft\elements\Asset), Object(craft\models\ImageTransform), Object(Closure), NULL)
[...]
We debugged the problem on the stage environment and could identify the
// And delete it after the request, if nobody wants it.
if (Craft::$app->getConfig()->getGeneral()->maxCachedCloudImageSize == 0) {
FileHelper::deleteFileAfterRequest($imageSourcePath);
}
code block as the source of the issue. Our general config for maxCachedCloudImageSize is 0 and the downloaded asset seems to be deleted immediately so the check in line 220
if (!is_file($imageSourcePath)) {
throw new FsObjectNotFoundException("The file \"{$asset->getFilename()}\" does not exist.");
}
throw the exception above. When we disable maxCachedCloudImageSize in the config, everything works fine and the transformations were generated.
As we can see in the file history, there were changes in 4.5.11. Maybe this is a new issue introduced with these changes.
Steps to reproduce
Set maxCachedCloudImageSize to 0.
Have a asset.getUrl('transformation') in a template.
Render the template.
Expected behavior
Generate asset transformation.
Actual behavior
Throws exception.
Craft CMS version
4.5.13
PHP version
8.1.18
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
kringkaste
changed the title
[4.x]: Local image source is delete before transformation has started
[4.x]: Local image source is deleted before transformation has started
Jan 3, 2024
What happened?
Description
After upgrading from 4.4.x to 4.5.13 we have an issue with generating transformations from assets stored on a S3 bucket. We get the following error:
We debugged the problem on the stage environment and could identify the
code block as the source of the issue. Our general config for
maxCachedCloudImageSize
is0
and the downloaded asset seems to be deleted immediately so the check in line 220throw the exception above. When we disable
maxCachedCloudImageSize
in the config, everything works fine and the transformations were generated.As we can see in the file history, there were changes in 4.5.11. Maybe this is a new issue introduced with these changes.
Steps to reproduce
maxCachedCloudImageSize
to0
.asset.getUrl('transformation')
in a template.Expected behavior
Generate asset transformation.
Actual behavior
Throws exception.
Craft CMS version
4.5.13
PHP version
8.1.18
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: