Closed umkasanki closed 2 years ago
I've use Craft with saving assets in AWS S3 volumes.
https://github.com/craftcms/aws-s3
On trying to publish new entry in Craft all works as expected. But on try to edit existing entry I got an error:
Server error: `POST https://bc67-86-57-209-70.ngrok.io/nl/storychief/webhook` resulted in a `500 Internal Server Error` response: {"message":"File already exists at path: yellow-house_99a07ff99aec1bd44dac99319f83bb93_2000.jpg","code":0,"debug":"/app/ (truncated...) (Hide details) {"message":"File already exists at path: yellow-house_99a07ff99aec1bd44dac99319f83bb93_2000.jpg","code":0,"debug":"/app/vendor/craftcms/cms/src/base/FlysystemVolume.php: line 92","trace":"#0 /app/vendor/craftcms/cms/src/elements/Asset.php(2260): craft\\base\\FlysystemVolume->createFileByStream('yellow-house_99...', Resource id #31, Array)\n#1 /app/vendor/craftcms/cms/src/elements/Asset.php(2000): craft\\elements\\Asset->_relocateFile()\n#2 /app/vendor/craftcms/cms/src/services/Elements.php(2700): craft\\elements\\Asset->afterSave(true)\n#3 /app/vendor/craftcms/cms/src/services/Elements.php(784): craft\\services\\Elements->_saveElementInternal(Object(craft\\elements\\Asset), true, false, true)\n#4 /app/vendor/storychief/craft-cms-v3-storychief/src/storychief/FieldTypes/AssetsStoryChiefFieldType.php(49): craft\\services\\Elements->saveElement(Object(craft\\elements\\Asset))\n#5 /app/vendor/storychief/craft-cms-v3-storychief/src/controllers/WebhookController.php(298): storychief\\storychiefv3\\storychief\\FieldTypes\\AssetsStoryChiefFieldType->prepFieldData(Object(craft\\fields\\Assets), 'https://images....')\n#6 /app/vendor/storychief/craft-cms-v3-storychief/src/controllers/WebhookController.php(178): storychief\\storychiefv3\\controllers\\WebhookController->_map(Object(craft\\elements\\Entry))\n#7 /app/vendor/storychief/craft-cms-v3-storychief/src/controllers/WebhookController.php(53): storychief\\storychiefv3\\controllers\\WebhookController->handleUpdateEventType()\n#8 [internal function]: storychief\\storychiefv3\\controllers\\WebhookController->actionCallback()\n#9 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)\n#10 /app/vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams(Array)\n#11 /app/vendor/yiisoft/yii2/base/Module.php(552): yii\\base\\Controller->runAction('callback', Array)\n#12 /app/vendor/craftcms/cms/src/web/Application.php(287): yii\\base\\Module->runAction('storychief-v3/w...', Array)\n#13 /app/vendor/yiisoft/yii2/web/Application.php(103): craft\\web\\Application->runAction('storychief-v3/w...', Array)\n#14 /app/vendor/craftcms/cms/src/web/Application.php(272): yii\\web\\Application->handleRequest(Object(craft\\web\\Request))\n#15 /app/vendor/yiisoft/yii2/base/Application.php(384): craft\\web\\Application->handleRequest(Object(craft\\web\\Request))\n#16 /app/web/index.php(24): yii\\base\\Application->run()\n#17 {main}"}
Could you fix it?
P.S. Assets stored on local volumes do not have this problem.
What version of Craft are you running? Possible related to this?
Craft Pro 3.7.30.1 Storychief v3 1.0.10 Amazon S3 1.3.0
Solved in release v1.0.11
I've use Craft with saving assets in AWS S3 volumes.
https://github.com/craftcms/aws-s3
On trying to publish new entry in Craft all works as expected. But on try to edit existing entry I got an error:
Could you fix it?
P.S. Assets stored on local volumes do not have this problem.