# How to debug S3 uploads

**URL:** https://meta.discourse.org/t/how-to-debug-s3-uploads/213616
**Category:** Self-hosting
**Created:** [January 2, 2022, 2:06am UTC](https://meta.discourse.org/t/how-to-debug-s3-uploads/213616 "2022-01-02T02:06:07Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [January 2, 2022, 2:06am UTC](https://meta.discourse.org/t/how-to-debug-s3-uploads/213616/1 "2022-01-02T02:06:08Z")

</div>

For a brief moment I had S3 uploads to a bucket working. Then I followed the several posts here to make sure it is all correct and now all uploads go local. I cant see any clues in the error log.

How does one go about debugging this complex setup?

One post suggests you have to do it with mostly environment variables, but the other does not, and the admin panel seems to have all the S3 parameters necessary. I am basically confused.

I have double checked all the values for S3 in the system.

---

<div class="post-metadata">

### Author: ![tggm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tggm/32/212852_2.png) [@tggm](https://meta.discourse.org/u/tggm)
#### Post date: [January 2, 2022, 11:07am UTC](https://meta.discourse.org/t/how-to-debug-s3-uploads/213616/2 "2022-01-02T11:07:20Z")

</div>

Hi @Andro

I’m also struggling with this. Could you please share your S3 IAM policy ? I can’t even get past that part.

Also, what did you set for the following config flags?

- s3 configure tombstone policy
- enable s3 inventory

Thanks!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 2, 2022, 11:15am UTC](https://meta.discourse.org/t/how-to-debug-s3-uploads/213616/3 "2022-01-02T11:15:44Z")

</div>

The one to follow is [Using Object Storage for Uploads (S3 & Clones)](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916). Things work a bit differently if you use those environment variables and that’s what you want. Don’t forget the part at the top about the rake task.

I think that there is some issue with knowing just how to create the bucket permissions.

---

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [January 2, 2022, 2:08pm UTC](https://meta.discourse.org/t/how-to-debug-s3-uploads/213616/4 "2022-01-02T14:08:27Z")

</div>

Not looking so good. Launcher rebuild app after adding rake command as per instructions:

> ## FAILED
> 
> Pups::ExecError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload\_assets failed with return #\<Process::Status: pid 1347 exit 1\>  
> Location of failure: /pups/lib/pups/exec\_command.rb:112:in `spawn’  
> exec failed with the params {“cd”=\>“$home”, “cmd”=\>[“sudo -E -u discourse bundle exec rake s3:upload\_assets”]}  
> c0b19d01faa8c6e1f217b209bdd5293c1a1dcd2016f286d17050c299f676256c  
> \*\* FAILED TO BOOTSTRAP \*\* please scroll up and look for earlier error messages, there may be more than one.  
> ./discourse-doctor may help diagnose the problem.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 2, 2022, 4:25pm UTC](https://meta.discourse.org/t/how-to-debug-s3-uploads/213616/5 "2022-01-02T16:25:51Z")

</div>

You likely missed one of the env variables. Having them in the database is not enough.

---

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [January 3, 2022, 3:21am UTC](https://meta.discourse.org/t/how-to-debug-s3-uploads/213616/6 "2022-01-03T03:21:17Z")

</div>

I added all the S3 variables but still the same failure.

What to try next? The launcher rebuild log just says exit with 1 and no further clue.

Does anybody have an example of working app.yml values (edited for privacy)?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 3, 2022, 6:23am UTC](https://meta.discourse.org/t/how-to-debug-s3-uploads/213616/7 "2022-01-03T06:23:26Z")

</div>

The next guess is that you have s permissions issue on the bucket that’s keeping you from uploading.

Those example stanzas in the Clones topic **are** the example `app.yml` file.
