Followed the How: To exactly, after which when i visit S3 i see the bucket been created.
But when i upload an image it says access denied. How do i troubleshoot this issue?
User Alankrit_Choudh set up S3 following the official guide but encountered an “access denied” error when uploading images. schleifer suggested checking the error logs, which revealed a permission issue. itsbhanusharma also suspected incorrect permissions. After schleifer pointed out that the error was from a background task, Alankrit_Choudh added the s3:PutLifecycleConfiguration permission, which fixed the background task issue. However, the “access denied” error persisted. schleifer asked for the full error message, but Alankrit_Choudh was able to resolve the issue by re-following the official guide.
Followed the How: To exactly, after which when i visit S3 i see the bucket been created.
But when i upload an image it says access denied. How do i troubleshoot this issue?
You can get more information from Admin → Logs → Error Logs.
Probably incorrect permissions to your AWS access group!
Message
Job exception: Access Denied
Backtrace
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-core-3.21.2/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-s3-1.14.0/lib/aws-sdk-s3/plugins/sse_cpk.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-s3-1.14.0/lib/aws-sdk-s3/plugins/dualstack.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-s3-1.14.0/lib/aws-sdk-s3/plugins/accelerate.rb:35:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-core-3.21.2/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-core-3.21.2/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-core-3.21.2/lib/aws-sdk-core/plugins/param_converter.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-core-3.21.2/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-core-3.21.2/lib/seahorse/client/plugins/response_target.rb:23:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-core-3.21.2/lib/seahorse/client/request.rb:70:in `send_request'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/aws-sdk-s3-1.14.0/lib/aws-sdk-s3/client.rb:4557:in `put_bucket_lifecycle_configuration'
/var/www/discourse/lib/s3_helper.rb:121:in `update_lifecycle'
/var/www/discourse/lib/s3_helper.rb:130:in `update_tombstone_lifecycle'
/var/www/discourse/lib/file_store/s3_store.rb:77:in `purge_tombstone'
/var/www/discourse/app/jobs/scheduled/purge_deleted_uploads.rb:8:in `execute'
/var/www/discourse/app/jobs/base.rb:134:in `block (2 levels) in perform'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.5/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/app/jobs/base.rb:129:in `block in perform'
/var/www/discourse/app/jobs/base.rb:125:in `each'
/var/www/discourse/app/jobs/base.rb:125:in `perform'
/var/www/discourse/app/jobs/base.rb:180:in `perform'
/var/www/discourse/lib/scheduler/manager.rb:91:in `process_queue'
/var/www/discourse/lib/scheduler/manager.rb:37:in `block in initialize'
Env
hostname goodgamer-app
process_id 2224
application_version 6bcdc3ba4b67bb9c33496889e1c2aee6cfff36f0
current_db default
current_hostname teh.gg
job Jobs::PurgeDeletedUploads
problem_db default
opts
That’s not the error from a failing upload; it’s from a background task running on the server. Adding s3:PutLifecycleConfiguration to the permissions will fix that, though.
After you add the new permission, what errors are there in the logs?
When I visit myurl.com/logs there are none, but access denied
Check the javascript console for errors.
What’s the full message?
Has been fixed, followed as per the official thread here again and it worked flawlessly.