1

I'm on Craft 3 and I've just switched some of my asset sources to S3. I'm developing on a local instance, and it all seems to be working. However, I needed to reconnect a couple images in my homepage single entry because I changed the path to one of the subfolders.

When I save the entry after selecting the images I want to use from my new S3 volume, I get an error page with the following:

fopen({my local root}/craft/storage/runtime/assets/tempuploads/user_1/my-file.jpeg): failed to open stream: No such file or directory

I opened up the tempuploads folder and (as expected) only 2 of the 3 images I wanted to change were in there. Ok. So I manually added the third image, thinking it was a fluke and tried again.

I got the error again, but for a different image. I went back to the folder and only 1 image was in there.

It seems there's something wonky going on with the temp upload process. Has anyone run across this before?

Here's the stack trace:

yii\base\ErrorException: fopen(/Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/storage/runtime/assets/tempuploads/user_1/home-video-still.jpeg): failed to open stream: No such file or directory in /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/league/flysystem/src/Adapter/Local.php:181
Stack trace:
#0 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/web/ErrorHandler.php(84): yii\base\ErrorHandler->handleError(2, 'fopen(/Users/ah...', '/Users/ahall/Pr...', 181)
#1 [internal function]: craft\web\ErrorHandler->handleError(2, 'fopen(/Users/ah...', '/Users/ahall/Pr...', 181, Array)
#2 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/league/flysystem/src/Adapter/Local.php(181): fopen('/Users/ahall/Pr...', 'rb')
#3 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/league/flysystem/src/Filesystem.php(196): League\Flysystem\Adapter\Local->readStream('user_1/home-vid...')
#4 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/base/FlysystemVolume.php(173): League\Flysystem\Filesystem->readStream('user_1/home-vid...')
#5 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/base/FlysystemVolume.php(187): craft\base\FlysystemVolume->getFileStream('user_1/home-vid...')
#6 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/elements/Asset.php(1387): craft\base\FlysystemVolume->saveFileLocally('user_1/home-vid...', '/Users/ahall/Pr...')
#7 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/elements/Asset.php(1224): craft\elements\Asset->_relocateFile()
#8 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/services/Elements.php(463): craft\elements\Asset->afterSave(false)
#9 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/services/Assets.php(187): craft\services\Elements->saveElement(Object(craft\elements\Asset))
#10 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/fields/Assets.php(402): craft\services\Assets->moveAsset(Object(craft\elements\Asset), Object(craft\models\VolumeFolder))
#11 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/base/Element.php(1808): craft\fields\Assets->afterElementSave(Object(craft\elements\MatrixBlock), false)
#12 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/elements/MatrixBlock.php(395): craft\base\Element->afterSave(false)
#13 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/services/Elements.php(463): craft\elements\MatrixBlock->afterSave(false)
#14 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/services/Matrix.php(683): craft\services\Elements->saveElement(Object(craft\elements\MatrixBlock), false, true)
#15 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/fields/Matrix.php(646): craft\services\Matrix->saveField(Object(craft\fields\Matrix), Object(craft\elements\Entry))
#16 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/base/Element.php(1808): craft\fields\Matrix->afterElementSave(Object(craft\elements\Entry), false)
#17 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/elements/Entry.php(987): craft\base\Element->afterSave(false)
#18 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/services/Elements.php(463): craft\elements\Entry->afterSave(false)
#19 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/controllers/EntriesController.php(539): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#20 [internal function]: craft\controllers\EntriesController->actionSaveEntry()
#21 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#22 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#23 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/web/Controller.php(76): yii\base\Controller->runAction('save-entry', Array)
#24 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-entry', Array)
#25 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('entries/save-en...', Array)
#26 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/web/Application.php(522): craft\web\Application->runAction('entries/save-en...', Array)
#27 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/craftcms/cms/src/web/Application.php(258): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#28 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#29 /Users/ahall/Projects/Perforce/depot/Websites/SchellGames/2017Update/Website/2.1_Craft3Microsites/craft/web/index.php(21): yii\base\Application->run()
#30 {main}
  • Usually when you see that "failed to open stream: No such file or directory" error, some other fatal error has happened during the upload process. i.e. memory limits, execution times, s3 permissions, etc. Anything useful in Craft's or your web server's error logs? – Brad Bell May 8 '18 at 21:59
  • I update the post with my stack trace. I checked my craft error files but didn't see any entries for the days I was testing it. I don't know how to find my server error logs. I'm using Imager - thought it could be related to that, but it seems to be doing fine with the S3 buckets I'm using elsewhere. This error seems to be specifically related to me updating an asset using a new path. – Andrea Hall May 10 '18 at 15:51
  • Im in a similar boat. Same error. However, Ive got the bugsnag plugin that should output all errors to bugsnag. I only see this error, no error related to uploading the document. I can try the same document a moment later, and succeed. The problem is intermittent. – kenyabob Jun 1 '18 at 23:26
1

I was able to fix the issue by manually uploading my images to the new S3 location via the AWS console and refreshing my asset indexes.

It seems like it was just getting confused with the old local asset connections. Hopefully it's not indicative of an underlying problem with my setup.

|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.