[GH-ISSUE #325] storage_system: s3 option not working #750

Closed
opened 2026-03-15 15:16:08 +03:00 by kerem · 13 comments
Owner

Originally created by @st-pmd on GitHub (Dec 7, 2021).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/325

Originally assigned to: @sadok-f on GitHub.

storage_system: s3 option not working
after following https://github.com/flyimg/flyimg/blob/main/docs/application-options.md#using-aws-s3-as-storage-provider, added all the necessary details in paramters.yml.

I am able to see image pushed to aws bucket but flyimg upload API gives following ErrorException.

Warning: filemtime(): stat failed for /var/www/html/web/uploads/659ccacd040f105ddbc1db05100b6498.webp

(1/1) ErrorExceptionWarning: filemtime(): stat failed for /var/www/html/web/uploads/659ccacd040f105ddbc1db05100b6498.webp
--
in Response.php line 75
at Response->getLastModifiedDate(object(OutputImage))in Response.php line 66
at Response->generateHeaders(object(OutputImage))in Response.php line 100
at Response->generateImageResponse(object(OutputImage))in DefaultController.php line 28
at DefaultController->uploadAction('w_300,h_250,c_1', 'https://media.wired.com/photos/5b899992404e112d2df1e94e/master/pass/trash2-01.jpg')in HttpKernel.php line 158
at HttpKernel->handleRaw(object(Request), 1)in HttpKernel.php line 80
at HttpKernel->handle(object(Request), 1, true)in Application.php line 496
at Application->handle(object(Request))in Application.php line 477


<br class="Apple-interchange-newline">

Note that with storage_system: local everything is working fine.

Originally created by @st-pmd on GitHub (Dec 7, 2021). Original GitHub issue: https://github.com/flyimg/flyimg/issues/325 Originally assigned to: @sadok-f on GitHub. storage_system: s3 option not working after following https://github.com/flyimg/flyimg/blob/main/docs/application-options.md#using-aws-s3-as-storage-provider, added all the necessary details in paramters.yml. I am able to see image pushed to aws bucket but flyimg upload API gives following ErrorException. > Warning: filemtime(): stat failed for /var/www/html/web/uploads/659ccacd040f105ddbc1db05100b6498.webp ``` (1/1) ErrorExceptionWarning: filemtime(): stat failed for /var/www/html/web/uploads/659ccacd040f105ddbc1db05100b6498.webp -- in Response.php line 75 at Response->getLastModifiedDate(object(OutputImage))in Response.php line 66 at Response->generateHeaders(object(OutputImage))in Response.php line 100 at Response->generateImageResponse(object(OutputImage))in DefaultController.php line 28 at DefaultController->uploadAction('w_300,h_250,c_1', 'https://media.wired.com/photos/5b899992404e112d2df1e94e/master/pass/trash2-01.jpg')in HttpKernel.php line 158 at HttpKernel->handleRaw(object(Request), 1)in HttpKernel.php line 80 at HttpKernel->handle(object(Request), 1, true)in Application.php line 496 at Application->handle(object(Request))in Application.php line 477 <br class="Apple-interchange-newline"> ``` Note that with storage_system: local everything is working fine.
kerem 2026-03-15 15:16:08 +03:00
Author
Owner

@sadok-f commented on GitHub (Dec 7, 2021):

Hi @st-pmd,
Thank you for opening this issue and the details you provided.
I'll investigate it and back to you asap!

Thank you again!

<!-- gh-comment-id:987833095 --> @sadok-f commented on GitHub (Dec 7, 2021): Hi @st-pmd, Thank you for opening this issue and the details you provided. I'll investigate it and back to you asap! Thank you again!
Author
Owner

@sadok-f commented on GitHub (Dec 7, 2021):

Hi @st-pmd ,
could you give it a try again with the new release?
thanks

<!-- gh-comment-id:988284317 --> @sadok-f commented on GitHub (Dec 7, 2021): Hi @st-pmd , could you give it a try again with the new release? thanks
Author
Owner

@st-pmd commented on GitHub (Dec 8, 2021):

Thank you @sadok-f for your swift actions.
Let me check & confirm.

<!-- gh-comment-id:988493376 --> @st-pmd commented on GitHub (Dec 8, 2021): Thank you @sadok-f for your swift actions. Let me check & confirm.
Author
Owner

@st-pmd commented on GitHub (Dec 8, 2021):

@sadok-f It is working fine. Thanks a ton!

<!-- gh-comment-id:988507834 --> @st-pmd commented on GitHub (Dec 8, 2021): @sadok-f It is working fine. Thanks a ton!
Author
Owner

@sadok-f commented on GitHub (Oct 20, 2023):

Hi @st-pmd
I'm wondering if you still use Flyimg in your company/organisation ?
If so, it would be great if you could add your entry here in the Adoperts file
https://github.com/flyimg/flyimg/blob/main/ADOPTERS.md
many thanks!

<!-- gh-comment-id:1772337839 --> @sadok-f commented on GitHub (Oct 20, 2023): Hi @st-pmd I'm wondering if you still use Flyimg in your company/organisation ? If so, it would be great if you could add your entry here in the Adoperts file https://github.com/flyimg/flyimg/blob/main/ADOPTERS.md many thanks!
Author
Owner

@jonathanlundstrom commented on GitHub (Feb 16, 2024):

@sadok-f I am still experiencing this issue, although in my forked version (to add S3 endpoint support). The upload to buckets works as intended but then I get this trace:

Message: Warning: filesize(): stat failed for /var/www/html/web/uploads/148e946001d70c70b3a61cc02cfdfa3f.avif 
File: /var/www/html/src/Core/Entity/Response.php
Line: 47
Trace: #0 /var/www/html/src/Core/Entity/Response.php(102): Core\Entity\Response->generateHeaders(Object(Core\Entity\Image\OutputImage))
#1 /var/www/html/src/Core/Controller/DefaultController.php(28): Core\Entity\Response->generateImageResponse(Object(Core\Entity\Image\OutputImage))
#2 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Core\Controller\DefaultController->uploadAction('w_130,h_113,q_9...', 'https://placeki...')
#3 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#4 /var/www/html/vendor/silex/silex/src/Silex/Application.php(496): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#5 /var/www/html/vendor/silex/silex/src/Silex/Application.php(477): Silex\Application->handle(Object(Symfony\Component\HttpFoundation\Request))
#6 /var/www/html/web/index.php(4): Silex\Application->run()
#7 {main}

Any idea why this might still be broken?

<!-- gh-comment-id:1947980665 --> @jonathanlundstrom commented on GitHub (Feb 16, 2024): @sadok-f I am still experiencing this issue, although in my forked version (to add S3 endpoint support). The upload to buckets works as intended but then I get this trace: ``` Message: Warning: filesize(): stat failed for /var/www/html/web/uploads/148e946001d70c70b3a61cc02cfdfa3f.avif File: /var/www/html/src/Core/Entity/Response.php Line: 47 Trace: #0 /var/www/html/src/Core/Entity/Response.php(102): Core\Entity\Response->generateHeaders(Object(Core\Entity\Image\OutputImage)) #1 /var/www/html/src/Core/Controller/DefaultController.php(28): Core\Entity\Response->generateImageResponse(Object(Core\Entity\Image\OutputImage)) #2 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Core\Controller\DefaultController->uploadAction('w_130,h_113,q_9...', 'https://placeki...') #3 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #4 /var/www/html/vendor/silex/silex/src/Silex/Application.php(496): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #5 /var/www/html/vendor/silex/silex/src/Silex/Application.php(477): Silex\Application->handle(Object(Symfony\Component\HttpFoundation\Request)) #6 /var/www/html/web/index.php(4): Silex\Application->run() #7 {main} ``` Any idea why this might still be broken?
Author
Owner

@jonathanlundstrom commented on GitHub (Feb 16, 2024):

Also, I've submitted by changes in a PR so that you can review them. They have already been tested with Scaleway and it works as intended, with the exception of the stat error. For reference on endpoint support in Flysystem 1.X you can read here: https://flysystem.thephpleague.com/v1/docs/adapter/scaleway-object-storage/.

See PR: https://github.com/flyimg/flyimg/pull/409

<!-- gh-comment-id:1948133577 --> @jonathanlundstrom commented on GitHub (Feb 16, 2024): Also, I've submitted by changes in a PR so that you can review them. They have already been tested with Scaleway and it works as intended, with the exception of the stat error. For reference on endpoint support in Flysystem 1.X you can read here: https://flysystem.thephpleague.com/v1/docs/adapter/scaleway-object-storage/. See PR: https://github.com/flyimg/flyimg/pull/409
Author
Owner

@jonathanlundstrom commented on GitHub (Feb 16, 2024):

@sadok-f, may I ask that this issue be reopened? ☺️

<!-- gh-comment-id:1948459089 --> @jonathanlundstrom commented on GitHub (Feb 16, 2024): @sadok-f, may I ask that this issue be reopened? ☺️
Author
Owner

@sadok-f commented on GitHub (Feb 16, 2024):

I'll look into the issue, thanks for reporting it

<!-- gh-comment-id:1948471950 --> @sadok-f commented on GitHub (Feb 16, 2024): I'll look into the issue, thanks for reporting it
Author
Owner

@sadok-f commented on GitHub (Feb 18, 2024):

@jonathanlundstrom I found the problem related to the issue you reported when using s3 as a storage provider the Content-Length header should read from the storage_handler instead of reading directly from the generated output.
I'll be fixing it soon and releasing and new tag.

<!-- gh-comment-id:1951255475 --> @sadok-f commented on GitHub (Feb 18, 2024): @jonathanlundstrom I found the problem related to the issue you reported when using s3 as a storage provider the `Content-Length` header should read from the `storage_handler` instead of reading directly from the generated output. I'll be fixing it soon and releasing and new tag.
Author
Owner

@sadok-f commented on GitHub (Feb 18, 2024):

@jonathanlundstrom the fix just got released in the v 1.3.1, can you give it a try ?
thanks

<!-- gh-comment-id:1951383811 --> @sadok-f commented on GitHub (Feb 18, 2024): @jonathanlundstrom the fix just got released in the v 1.3.1, can you give it a try ? thanks
Author
Owner

@jonathanlundstrom commented on GitHub (Feb 19, 2024):

Hey @sadok-f! Thanks for merging my changes and fixing the problem. I've checked out the release and can verify that everything seems to work as intended. Now using Scaleway without issues, and other providers should work as well 👌

I think we can close this issue 🖖

<!-- gh-comment-id:1951910774 --> @jonathanlundstrom commented on GitHub (Feb 19, 2024): Hey @sadok-f! Thanks for merging my changes and fixing the problem. I've checked out the release and can verify that everything seems to work as intended. Now using Scaleway without issues, and other providers should work as well 👌 I think we can close this issue 🖖
Author
Owner

@sadok-f commented on GitHub (Feb 19, 2024):

thank you for confirming @jonathanlundstrom
if you're using Flyimg, it would be great if you could add your Organisation here in the Adoperts file:
https://github.com/flyimg/flyimg/blob/main/ADOPTERS.md

<!-- gh-comment-id:1952023443 --> @sadok-f commented on GitHub (Feb 19, 2024): thank you for confirming @jonathanlundstrom if you're using Flyimg, it would be great if you could add your Organisation here in the Adoperts file: https://github.com/flyimg/flyimg/blob/main/ADOPTERS.md
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#750
No description provided.