magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.47k stars 9.28k forks source link

Captcha not working with remote storage #33051

Open marvincaspar opened 3 years ago

marvincaspar commented 3 years ago

I have setup remote storage for a magento shop and this works fine for nearly all media files excepts for the captcha images. They are generated and stored on the local filesystem and are not synced to the s3 bucket.

https://github.com/magento/magento2/blob/212d69a21e42581ed77ecde6de8200f2be89c6f0/app/code/Magento/Captcha/Helper/Data.php#L154)

Nginx than tries to find the image in the s3 bucket and returns a 404. The result is that the user can't see the captcha and for example is unable to reset the password. Current workaround is to disable the captcha feature.

Preconditions (*)

  1. magento 2.4.2
  2. enable remote storeage for s3 bucket

Steps to reproduce (*)

  1. enable remote storage for s3 bucket
  2. sync initial media files to s3
  3. enable captcha for customer forget password page
  4. go to customer forget password page

Expected result (*)

  1. captcha is displayed correctly

Actual result (*)

  1. browser sends 404 for the captcha image
  2. captcha is not displayed

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 3 years ago

Hi @marvincaspar. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 3 years ago

Hi @engcom-Alfa. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Alfa commented 3 years ago

Hi @marvincaspar Tried reproducing the issue with provided steps but needs clarity on syncing the initial media files to S3 . Kindly provide more steps for syncing the files.

marvincaspar commented 3 years ago

Hi @engcom-Alfa, I followed the steps from the documentation page https://devdocs.magento.com/guides/v2.4/config-guide/remote-storage/config-remote-storage-aws-s3.html and than run bin/magento remote-storage:sync. After that I visit a page where the captcha enabled and the generated captcha is stored locally and is not synced to s3

m2-assistant[bot] commented 3 years ago

Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Hotel commented 2 years ago

Hello @marvincaspar,

I have tried to reproduce the issue in Magento 2.4-develop branch with mentioned steps with NGINX server. To enable S3 storage we have followed this devdocs link and this link.

After enabling, tried to access the forgot password page, but we are able to get the captcha image. Please refer below screenshot:

image

Please try to reproduce the issue in Magento 2.4-develop branch and let us know, if you are still able to reproduce it.

Thanks

engcom-Hotel commented 2 years ago

Hello @marvincaspar,

We have noticed that this issue has not been updated for a period of more than 14 Days. Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket if you need more assistance on this.

Regards

zakdma commented 1 month ago

Please reopen it. To reproduce the issue you have to configure nginx to get media files from s3 bucket directly. Using proxy_pass like on this example https://github.com/magento/magento2/blob/2.4-develop/nginx.conf.sample#L149 In this case, nginx will not get local files, only s3 ones. Since captcha files are generated ONLY on the local filesystem, they never get to s3, so nginx cannot retrieve them.

marvincaspar commented 1 month ago

This also doesn't work if you have multiple Magento instances running because of high availability or high traffic.

engcom-Hotel commented 4 weeks ago

Thanks @zakdma @marvincaspar, for the response.

We are reopening the issue for further investigation.

Thanks

engcom-Hotel commented 1 week ago

Hello @marvincaspar @zakdma,

The issue has been reproducible for us now: image

Hence confirming the issue.

Thanks

github-jira-sync-bot commented 1 week ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12881 is successfully created for this GitHub issue.

m2-assistant[bot] commented 1 week ago

:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.