Open market-south opened 1 year ago
Hi, thanks for reaching out.
It’s possible that the asset with the filename of “Logo_HPD_Colour_61b970d7a9284.jpg” existed at one point, it’s now deleted, but the image transform index for it still exists.
Have you tried clearing the Asset transform index? You can do that via Control Panel > Utilities > Caches or command line with php craft clear-caches/transform-indexes
. I’d try that first and then check if those errors are no longer being added to the log.
As for the other case - it’s also possible for an asset to exist in the CMS, but its actual file could have been deleted from the disk. It might still show seemingly fine on the assets list if that particular transform has been generated and the transformed file wasn’t deleted, but new transforms can’t be generated because the original file is gone.
Prior to 4.4.0, the queue job responsible for generating transforms could be dealing with multiple assets (GeneratePendingTransforms
- plural, was deprecated and replaced with GenerateImageTransform
- singular, and it deals with a single image transform at the time (https://github.com/craftcms/cms/pull/12340)).
That’s why you can see logs from one queue job regarding multiple assets being transformed.
I’d check if the file “5900-MB.jpg” still exists on the disk. You can do that manually, or you can go to the edit page for it in the Control Panel and try to download it via the “Download” button at the top.
As a side note, you can turn off transforming SVGs via https://craftcms.com/docs/4.x/config/general.html#transformsvgs.
Hi there,
Thanks for the detailed information, much appreciated.
Regarding the image "Logo_HPD_Colour_61b970d7a9284.jpg", you are right it existed a month ago. But the above logs are recorded after clearing the transform index via CP.
Regarding the other case - the image does exist in the web server and it's been assigned to an entry and visible in the front end of the website.
We have upgraded Craft to its latest version(4.4.16.1). We will monitor the logs and see whether the issue has been resolved.
Re SVG transform - please advise on whether disabling it will also not transform an actual SVG that may be added to the Asset volume in the future.
Thanks for the update!
Re SVG transform - please advise on whether disabling it will also not transform an actual SVG that may be added to the Asset volume in the future.
Yes, it will apply to the svgs added in the future.
What happened?
Description
Hi, we have a multisite website that has assets for each site. Randomly, some of the images were not showing a thumbnail preview before the filename under the Assets volume. While reviewing the logs under storage/logs/queue.log, noticed Craft was unable to perform image transformation for those images. After further insights, found out the images don't exist in the web directory which clarified why Craft was logging
craft\\errors\\ImageException
.But now we have two scenarios as follows:
1) Queue is now logging the same exception
craft\\errors\\ImageException
for an image that is not listed under Assets and I can confirm we don't have any file under that name. And also, I am not sure why it's logging "Failed to load SVG string" when the file is not an SVG. A screenshot is attached for reference.2) Same as above but this time the image does exist in the CMS Assets. A screenshot is attached for reference.
Some of the logs for reference
Scenario 1 logs:
Scenario 2 logs
Steps to reproduce
Expected behaviour
The queue shouldn't be trying to transform the image that doesn't exists in the Assets volume.
Actual behaviour
Craft CMS version
4.2.5.2
PHP version
8.1.6
Operating system and version
Linux 5.4.0-51-generic
Database type and version
MySQL 5.7.32
Image driver and version
Installed plugins and versions