# Discourse Activitypub gives 502 after rebuilding

**URL:** https://meta.discourse.org/t/discourse-activitypub-gives-502-after-rebuilding/412982
**Category:** Bug
**Tags:** activitypub, fixed
**Created:** [September 22, 2026, 8:57am UTC](https://meta.discourse.org/t/discourse-activitypub-gives-502-after-rebuilding/412982 "2026-09-22T08:57:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [September 22, 2026, 8:57am UTC](https://meta.discourse.org/t/discourse-activitypub-gives-502-after-rebuilding/412982/1 "2026-09-22T08:57:17Z")

</div>

Self hosted 2-container, and when rebuilded today (latest) Activitypub makes error 502. Commenting it out from `web_only.yml` helps.

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [September 22, 2026, 1:06pm UTC](https://meta.discourse.org/t/discourse-activitypub-gives-502-after-rebuilding/412982/2 "2026-09-22T13:06:11Z")

</div>

I can confirm; it needed to be disabled as well.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [September 22, 2026, 1:47pm UTC](https://meta.discourse.org/t/discourse-activitypub-gives-502-after-rebuilding/412982/3 "2026-09-22T13:47:35Z")

</div>

Looks like there was a recent fix [FIX: Correct polymorphic attachment association - Pull Request #340 - discourse/discourse-activity-pub - GitHub](https://github.com/discourse/discourse-activity-pub/pull/340), do you know if your Discourse core version has Rails 8.1 or not? @techAPJ we may need to add a compatibility entry for this change.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [September 22, 2026, 2:38pm UTC](https://meta.discourse.org/t/discourse-activitypub-gives-502-after-rebuilding/412982/5 "2026-09-22T14:38:25Z")

</div>

I think so:

```plaintext
root@foorumi-hel-web-only:/var/www/discourse# bundle exec rails --version
Rails 8.1.3.1

```

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [September 22, 2026, 2:39pm UTC](https://meta.discourse.org/t/discourse-activitypub-gives-502-after-rebuilding/412982/6 "2026-09-22T14:39:12Z")

</div>

@pmusaraj I checked this against Rails 8.0.5.1 and 8.1.3.1. A compatibility entry shouldn’t be needed: the corrected association works on both versions. The previous declaration fails to load on Rails 8.1 because it specifies `class_name` alongside `polymorphic: true`.

The initial report was posted about ~15 minutes before the fix merged, so it could have been from a rebuild without the fix.

@Jagster @satonotdead could you try rebuilding again with ActivityPub enabled? If you still get a 502, please share error log from `/logs`.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [September 22, 2026, 2:53pm UTC](https://meta.discourse.org/t/discourse-activitypub-gives-502-after-rebuilding/412982/7 "2026-09-22T14:53:39Z")

</div>

Rebuilding worked nicely!
