Hello,
I’m facing a strange issue with my Discourse where 502 errors happen only for one specific user (admin) account after login, while:
-
Anonymous users can access the site normally
-
Other user accounts can log in and use the site normally
-
The problem only appears for one specific account (admin account)
Environment
-
Discourse installed via official Docker setup
-
Reverse proxy / CDN: ArvanCloud (similar to Cloudflare)
-
Access to international internet is restricted / unstable (GitHub and some external services not reachable)
-
Discourse has not been updated for ~1 month
Symptoms
When accessing the site:
-
If I open the site in private/incognito mode → site loads fine
-
If I log in using my main account → immediately get 502 Bad Gateway
-
If I log in using another account → everything works fine
So the problem is clearly user-specific and triggered after authentication.
CDN (ArvanCloud) error logs
Two main errors appear:
1. Upstream timeout while reading upstream
upstream timed out (110: Connection timed out) while reading upstream
Affected URLs are mostly assets, for example:
-
/assets/browser-detect-*.js
-
/assets/plugins/automation-*.js
-
/assets/plugins/discourse-gamification-*.js
-
/assets/plugins/discourse-lazy-videos-*.js
2. Upstream prematurely closed connection
upstream prematurely closed connection while reading response header from upstream
For example:
-
/stylesheets/common_theme_rtl_*.css
-
/theme-javascripts/*.js
So CDN is waiting for response from Discourse but backend times out or closes connection.
What I found on the backend
In Rails stack traces, the error path points to:
-
current_user_serializer.rb -
discourse_updates.rb -
method:
DiscourseUpdates.has_unseen_features?
Which suggests the crash/timeout happens while checking new feature announcements for logged-in users.
Since only one user is affected, this strongly suggests the problem is triggered during user-specific serialization, not global site rendering.
Any guidance would be appreciated.
Thanks a lot.