# 设置 S3 后：访问被拒绝

**URL:** https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730
**Category:** Support
**Created:** [2018年六月25日 19:15 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730 "2018-06-25T19:15:01Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Alankrit\_Choudh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alankrit_choudh/32/119698_2.png) [@Alankrit\_Choudh](https://meta.discourse.org/u/Alankrit_Choudh)
#### Post date: [2018年六月25日 19:15 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/1 "2018-06-25T19:15:02Z")

</div>

> [@Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229):
>
> So, you want to use S3 to handle image uploads? Here’s the definitive guide, but also see [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916) to see how to configure your app.yml. S3 registration Head over to [https://aws.amazon.com/free/](https://aws.amazon.com/free/) and click on [Create a Free Account] During the create account process, make sure you provide payment information, otherwise you won’t be able to use S3. There’s no registration fee, you will only be charged for [what you use](https://aws.amazon.com/s3/pricing/), if you exceed the [AWS …](https://aws.amazon.com/free/)

Followed the How: To exactly, after which when i visit [S3](https://s3.console.aws.amazon.com/s3/home?region=us-east-1) i see the bucket been created.

But when i upload an image it says access denied. How do i troubleshoot this issue?

---

<div class="post-metadata">

### Author: ![Alankrit\_Choudh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alankrit_choudh/32/119698_2.png) [@Alankrit\_Choudh](https://meta.discourse.org/u/Alankrit_Choudh)
#### Post date: [2018年六月25日 19:42 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/2 "2018-06-25T19:42:13Z")

</div>

Here is a screen shot

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/8/f8cd7e57ca15ec63c07abac3f8ee8e02094c51b4.jpg)

---

<div class="post-metadata">

### Author: ![schleifer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schleifer/32/86416_2.png) [@schleifer](https://meta.discourse.org/u/schleifer)
#### Post date: [2018年六月26日 14:51 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/3 "2018-06-26T14:51:31Z")

</div>

> [@Alankrit\_Choudh](#):
>
> How do i troubleshoot this issue?

You can get more information from Admin → Logs → Error Logs.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2018年六月26日 15:47 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/4 "2018-06-26T15:47:50Z")

</div>

Probably incorrect permissions to your AWS access group!

---

<div class="post-metadata">

### Author: ![Alankrit\_Choudh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alankrit_choudh/32/119698_2.png) [@Alankrit\_Choudh](https://meta.discourse.org/u/Alankrit_Choudh)
#### Post date: [2018年六月26日 17:48 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/5 "2018-06-26T17:48:27Z")

</div>

```
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	

```

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/c/0c03348176e4d8fee3b10e7a96a0e44828f473a0.jpg)

---

<div class="post-metadata">

### Author: ![schleifer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schleifer/32/86416_2.png) [@schleifer](https://meta.discourse.org/u/schleifer)
#### Post date: [2018年六月26日 18:29 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/6 "2018-06-26T18:29:38Z")

</div>

> [@Alankrit\_Choudh](#):
>
> Jobs::PurgeDeletedUploads

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.

---

<div class="post-metadata">

### Author: ![schleifer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schleifer/32/86416_2.png) [@schleifer](https://meta.discourse.org/u/schleifer)
#### Post date: [2018年六月27日 01:35 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/7 "2018-06-27T01:35:25Z")

</div>

After you add the new permission, what errors are there in the logs?

---

<div class="post-metadata">

### Author: ![Alankrit\_Choudh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alankrit_choudh/32/119698_2.png) [@Alankrit\_Choudh](https://meta.discourse.org/u/Alankrit_Choudh)
#### Post date: [2018年六月27日 03:08 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/8 "2018-06-27T03:08:53Z")

</div>

When I visit [myurl.com/logs](http://myurl.com/logs) there are none, but access denied

---

<div class="post-metadata">

### Author: ![schleifer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schleifer/32/86416_2.png) [@schleifer](https://meta.discourse.org/u/schleifer)
#### Post date: [2018年六月28日 15:02 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/9 "2018-06-28T15:02:25Z")

</div>

Check the javascript console for errors.

> [@Alankrit\_Choudh](#):
>
> access denied

What’s the full message?

---

<div class="post-metadata">

### Author: ![Alankrit\_Choudh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alankrit_choudh/32/119698_2.png) [@Alankrit\_Choudh](https://meta.discourse.org/u/Alankrit_Choudh)
#### Post date: [2018年六月28日 15:41 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/10 "2018-06-28T15:41:36Z")

</div>

Has been fixed, followed as per the official thread here again and it worked flawlessly.

> [@Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229):
>
> So, you want to use S3 to handle image uploads? Here’s the definitive guide, but also see [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916) to see how to configure your app.yml. S3 registration Head over to [https://aws.amazon.com/free/](https://aws.amazon.com/free/) and click on [Create a Free Account] During the create account process, make sure you provide payment information, otherwise you won’t be able to use S3. There’s no registration fee, you will only be charged for [what you use](https://aws.amazon.com/s3/pricing/), if you exceed the [AWS …](https://aws.amazon.com/free/)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2018年七月28日 15:41 UTC](https://meta.discourse.org/t/after-setting-up-s3-access-denied/90730/11 "2018-07-28T15:41:47Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
