# 502 Error / Unicorn Timeout on Rewind page for highly active users

**URL:** https://meta.discourse.org/t/502-error-unicorn-timeout-on-rewind-page-for-highly-active-users/392494
**Category:** Bug
**Tags:** rewind
**Created:** [January 1, 2026, 1:34pm UTC](https://meta.discourse.org/t/502-error-unicorn-timeout-on-rewind-page-for-highly-active-users/392494 "2026-01-01T13:34:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [January 1, 2026, 1:34pm UTC](https://meta.discourse.org/t/502-error-unicorn-timeout-on-rewind-page-for-highly-active-users/392494/1 "2026-01-01T13:34:11Z")

</div>

Hello 👋

We are experiencing an issue with the Discourse Rewind plugin. For some of our most active users, the Rewind page fails to load and returns a 502 error.

- The issue seems to be a timeout during the data aggregation process.
- It consistently happens for users with high activity levels, while working fine for average users.
- The logs indicate that the Unicorn worker receives a `USR2` signal because it exceeds the timeout limit while executing a database query.

Error in console:

 ![Screenshot 2026-01-01 at 14.28.11](https://global.discourse-cdn.com/meta/original/4X/1/6/9/169012184e12aa54ed693fde2746b36d68ce21b8.png)

Warning in logs:

```plaintext
Message

Unicorn worker received USR2 signal indicating it is about to timeout, dumping backtrace for main thread
config/unicorn.conf.rb:204:in `backtrace'
config/unicorn.conf.rb:204:in `block (2 levels) in reload'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rack-mini-profiler-4.0.1/lib/patches/db/pg/alias_method.rb:112:in `exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rack-mini-profiler-4.0.1/lib/patches/db/pg/alias_method.rb:112:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:167:in `perform_query'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in `block (2 levels) in raw_execute'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/connection_adapters/abstract_adapter.rb:1017:in `block in with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/connection_adapters/abstract_adapter.rb:986:in `with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in `block in raw_execute'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/connection_adapters/abstract_adapter.rb:1137:in `log'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in `raw_execute'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in `...

Backtrace

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/broadcast_logger.rb:218:in `block in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/broadcast_logger.rb:217:in `map'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/broadcast_logger.rb:217:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/broadcast_logger.rb:129:in `warn'
/var/www/discourse/lib/signal_trap_logger.rb:40:in `public_send'
/var/www/discourse/lib/signal_trap_logger.rb:40:in `block (2 levels) in ensure_logging_thread_running'
<internal:kernel>:187:in `loop'
/var/www/discourse/lib/signal_trap_logger.rb:37:in `block in ensure_logging_thread_running'

```

Thanks

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 1, 2026, 9:50pm UTC](https://meta.discourse.org/t/502-error-unicorn-timeout-on-rewind-page-for-highly-active-users/392494/3 "2026-01-01T21:50:16Z")

</div>

Thanks @Don what scale are we talking here, can you give us a clue on how active this user is? (posts a year / likes a year)

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [January 1, 2026, 10:09pm UTC](https://meta.discourse.org/t/502-error-unicorn-timeout-on-rewind-page-for-highly-active-users/392494/5 "2026-01-01T22:09:01Z")

</div>

Sure, here are some stats (last year) for two of the affected users:

User 1

- **Posts created:** 11,709
- **Reactions given:** 41,569
- **Reactions received:** 74,603

User 2

- **Posts created:** 5,959
- **Reactions given:** 37,974
- **Reactions received:** 38,875

Both users trigger the 502 error, suggesting the timeout threshold is hit even with the moderately lower (but still high) activity of User 2.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 1, 2026, 10:14pm UTC](https://meta.discourse.org/t/502-error-unicorn-timeout-on-rewind-page-for-highly-active-users/392494/6 "2026-01-01T22:14:38Z")

</div>

Thanks heaps Don, someone will have a look over the next couple of weeks.

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [January 2, 2026, 2:04am UTC](https://meta.discourse.org/t/502-error-unicorn-timeout-on-rewind-page-for-highly-active-users/392494/8 "2026-01-02T02:04:28Z")

</div>

I think this fix should help:

[https://github.com/discourse/discourse/pull/36940/](https://github.com/discourse/discourse/pull/36940/)

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [January 13, 2026, 11:12am UTC](https://meta.discourse.org/t/502-error-unicorn-timeout-on-rewind-page-for-highly-active-users/392494/9 "2026-01-13T11:12:08Z")

</div>


