Skip to content

Captcha images are not uploaded to AWS S3

I have successfully activated remote storage to AWS S3 using the following steps

php magento config:set system/media_storage_configuration/media_database 0

php magento setup:config:set 
    --remote-storage-driver="aws-s3" 
    --remote-storage-bucket="bucket-name" 
    --remote-storage-prefix="" 
    --remote-storage-region="region-name" 
    --remote-storage-key="accesskey" 
    --remote-storage-secret="secretkey"

php magento config:set web/unsecure/base_media_url "https://<s3 bucket baseurl>/media/"

php magento config:set web/secure/base_media_url "https://<s3 bucket baseurl>/media/"

php magento remote-storage:sync

Everything works fine. I am able to upload product images and everything works fine. But there is an issue with Captcha images. When i enabled captcha in login form it threw 404. I checked the S3 path of generated URL and it is not found in the bucket. But once i ran

php magento remote-storage:sync

captcha image is uploaded to S3 and the same URL which threw 404 before works. Is there any fix to make sure captcha images is uploaded to S3 after generation?

Note : No custom modules added. Fresh installation with Luma theme after initial setup, just enabled the remote storage and did some testing and found this.