Open jamie-s-white opened 1 year ago
Are you able to confirm what volume filesystem you're using? Local, S3 or other?
S3
This also happens when I just click save on an image that has already been uploaded.
I have done a bit of additional debugging on this, and I can see in:
src/services/Service.php
We have:
public function beforeHandleAssetFile(AssetEvent $event)
{
$asset = $event->sender;
$filename = $asset->filename;
$path = $asset->tempFilePath;
When this bug occurs, $asset->tempFilePath is NULL.
Evidently it has other file information, such as $asset->filename, which is correctly set.
When we upload a fresh file, $path returns:
/var/www/example.com/releases/63/storage/runtime/temp/rc365084d3fe1c347.79901316.jpg
Should be fixed for the next release. To get this early, run composer require verbb/image-resizer:"dev-craft-3 as 2.2.1"
.
Hi,
Now when we save a file, we get the error:
Could not open create the stream for “test.jpg”
(Where test.jpg is the name of the file).
From line 200 of vendor/craftcms/cms/src/base/FlysystemVolume.php
Hmm, so that must be a result of $asset->getImageTransformSourcePath()
which is supposed fetch the local copy of the asset for remote volumes. Can I ask what your S3 volume settings are?
Name: Files Handle: Files Assets in this volume have public URLs: true Subfolder: None Make uploads public: true Attempt to set the focal point automatically?: False Cache duration: 1 day CloudFront Distribution ID: Set CloudFront Path Prefix: Not set
Please let me know if you need any more information
Looks identical to mine! I'll keep digging to try and replicate this.
Let me know if admin access to our staging environment might help, and I'll see if I can get that.
Also keep in mind that we are on Craft 3.7.16, in case that makes a difference. I'm not sure this client has the budget to update to the latest 3.9.x version. We are however using the latest version of the craftcms/aws-s3 plugin.
That might be useful, and best to get in touch via support@verbb.io
. I have been testing on Craft 3.9 as I wasn't under the impression it'd make a difference as there haven't been massive changes between those. But I'll spin up a site just in case.
Thank you! I have put in a request to grant you access, but we won't get that until next week. I will reach out to support@verbb.io when I know more.
I have now been pulled from this job due to lack of budget to take this further forward, so I will not be able to assist any further with this bug report. We have decided to resize the images manually instead of using this plugin, apologies.
I will also add that we are seeing this issue on at least one other of our projects however, and whenever we see the issue, we get the same result:
Could not open create the stream for “test.jpg”
Thanks for the update, and sorry we haven't been able to get to the bottom of it. I'll keep at it on my end. I did test out on Craft 3.7 specifically, just in case that was a factor, but wasn't able to reproduce it.
Describe the bug
When uploading an image with a filename that already exists, and chosing "rename", image-resizer errors
Steps to reproduce
Craft CMS version
3.7.16
Plugin version
2.2.1
Multi-site?
No
Additional context
No response