# Troubleshooting S3 Uploads: Site hangs after rebuild, JS assets fail to load with net::ERR\_... on both R2 and GCS

**URL:** <https://meta.discourse.org/t/troubleshooting-s3-uploads-site-hangs-after-rebuild-js-assets-fail-to-load-with-net-err-on-both-r2-and-gcs/380668>\
**Category:** Product Support\
**Created:** [August 28, 2025, 4:36am UTC](https://meta.discourse.org/t/troubleshooting-s3-uploads-site-hangs-after-rebuild-js-assets-fail-to-load-with-net-err-on-both-r2-and-gcs/380668 "2025-08-28T04:36:57Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Ryze\_Chen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryze_chen/32/489198_2.png) [@Ryze\_Chen](https://meta.discourse.org/u/Ryze_Chen)\
**Post date:** [August 28, 2025, 4:36am UTC](https://meta.discourse.org/t/troubleshooting-s3-uploads-site-hangs-after-rebuild-js-assets-fail-to-load-with-net-err-on-both-r2-and-gcs/380668/1 "2025-08-28T04:36:57Z")

</div>

> Hello Discourse Team and Community,
> 
> I’ve been trying to configure my self-hosted Discourse instance to use an external S3-compatible object storage, but I’ve run into a very persistent and unusual issue. I would be very grateful for any help.

**My Environment:**

- **Discourse Version:** Standard Docker install, latest `tests-passed`.

- **Host:** `[YOUR VPS PROVIDER and OS]` _(请在这里填入您的服务商和系统)_

- **Reverse Proxy:** Caddy

**Goal:** My goal is to move all uploads (user uploads and site assets) from local storage to an external provider.

**Problem Summary:** After configuring `app.yml` for S3 (either Cloudflare R2 or Google Cloud Storage) and running `./launcher rebuild app`, the site hangs on the initial loading screen (the blue spinner). The browser’s developer tools show that most core JavaScript assets fail to load from the external CDN URL with a generic network error (`net::ERR_...`).

**Debugging Steps Taken:**

1. **Attempt with Cloudflare R2:**

2. **Crucial Test - Switching to Google Cloud Storage:**

**Current Status:**

- The `./launcher rebuild app` process completes without any errors displayed in the terminal.

- The `app` container is running correctly after the rebuild (verified with `docker ps`).

- The `./launcher logs app` command shows no errors; all internal services (unicorn, redis, postgres) appear to be running normally.

- The problem seems to be a network-level failure when the browser tries to fetch JS assets from the configured external CDN URL, and this happens regardless of which provider (R2 or GCS) is used.

**Here is the final `app.yml` configuration block we used for R2 (the GCS one was similar):**

# — Cloudflare R2 S3 Configuration START (Final Version) —

DISCOURSE\_FORCE\_HTTPS: true  
DISCOURSE\_USE\_S3: true  
DISCOURSE\_S3\_REGION: “us-east-1”  
DISCOURSE\_S3\_ENDPOINT: “[https://s3.ryzelan.sbs](https://s3.ryzelan.sbs)”  
DISCOURSE\_S3\_CDN\_URL: “[https://s3.ryzelan.sbs](https://s3.ryzelan.sbs)”  
DISCOURSE\_S3\_ACCESS\_KEY\_ID: “REDACTED”  
DISCOURSE\_S3\_SECRET\_ACCESS\_KEY: “REDACTED”  
DISCOURSE\_S3\_BUCKET: “ryzelan-discourse”  
DISCOURSE\_S3\_FORCE\_PATH\_STYLE: true

# — Cloudflare R2 S3 Configuration END —

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/3/9/5390cdf59bd9d186d65fff398a9b498c4ec43b74.png)

**My Question:** What could cause a fresh Discourse rebuild to consistently fail to load its own assets from two different, major cloud providers with a network error? Is there a known issue with certain VPS networking environments, Docker networking, or Caddy that could be causing this?

Thank you for your time and any insights you can provide.

---

_[View the full topic](https://meta.discourse.org/t/troubleshooting-s3-uploads-site-hangs-after-rebuild-js-assets-fail-to-load-with-net-err-on-both-r2-and-gcs/380668)._
