# Error 500 when moving posts

**URL:** https://meta.discourse.org/t/error-500-when-moving-posts/397654
**Category:** Bug
**Created:** [March 4, 2026, 8:14pm UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654 "2026-03-04T20:14:16Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [March 4, 2026, 8:14pm UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/1 "2026-03-04T20:14:16Z")

</div>

Moving a single or multiple posts of a thread into another thread located in another category results in http 500 error. I tested with both a moderator and admin account and with both a single post or multiple selected posts. Permission matrix of the categories:

| Category | Group | Permissions |
| --- | --- | --- |
| Source | anybody | see |
| Source | group01 | see reply create |
| Target | group01 | see reply create |

~~Note that we have we have a separate permission group for mods and admins and~~ I assume that the root cause is some tricky permissions issue. Ideas how to debug this are welcome 😎

**Update:** The source catogory in federated (ActivityPub), maybe this plugin code plays a role too… I removed the separate permission groups for mods and admins and tested again with two accounts which have “standard” mod (Moderator = Yes) or admin (Admin = Yes) permissions. Same results: The error 500 appears for any use case: new topic, existing topic, new message.

❕ **Note:** This bug was already reported a few times earlier and there were already some code fixes. I see it again in our instance with the **current** release 2026.3.0-latest

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [March 5, 2026, 1:28pm UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/2 "2026-03-05T13:28:48Z")

</div>

Anything in the console?

Does any of the post contains a solution?

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [March 5, 2026, 5:33pm UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/3 "2026-03-05T17:33:25Z")

</div>

I couldnt find a solution from older posts yet. Here is the screenshot

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/9/1/b914578b06a1791bb49ac3aa628223b1f0a32874.png)

The console shows that the 500 appears directly after a POST request for

```plaintext
https://forum.netzwissen.de/t/1431/move-posts
[HTTP/2 500 60ms]

```

which should be equivalent to clicking on the blue button. Any ideas how to debug that a bit deeper?

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [March 5, 2026, 5:37pm UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/4 "2026-03-05T17:37:12Z")

</div>

Is there something more helpful in the network tab of your browser console? That helped me in January with an error while moving posts.

> [@Make reason for 'error moving posts' visible in the interface](https://meta.discourse.org/t/make-reason-for-error-moving-posts-visible-in-the-interface/393690/1):
>
> finally, in the network tab, I found:  
> ![image](https://global.discourse-cdn.com/meta/original/4X/1/9/6/19614b8412ae663e6ac0586a72eff3841d9b1bc0.png)

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [March 5, 2026, 9:23pm UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/5 "2026-03-05T21:23:05Z")

</div>

… unfortunately not, at least I don’t see anything useful in the response in this (compressed) har file (see response following the line 165).

[forum.netzwissen.de\_t\_1431\_move-posts\_Archive [26-03-05 22-14-18].har.zip](https://meta.discourse.org/uploads/short-url/s0yOmURZ7JwellmciAScERcLuZA.zip) (2.8 KB)

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [March 6, 2026, 9:01am UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/6 "2026-03-06T09:01:43Z")

</div>

I did some deeper debugging. Even the nginx log inside the container shows no useful information about whats going on

`root@docker5-web-only:/var/log/nginx# tail -f access.log | grep 500 `  
`[06/Mar/2026:08:51:45 +0000] "``forum.netzwissen.de``" 10.10.10.21 "POST /t/1431/move-posts HTTP/1.0" "Mozilla/5.0 (X11; Linux x86`  
`_64; rv:148.0) Gecko/20100101 Firefox/148.0" "topics/move_posts" 500 432 "``https://forum.netzwissen.de/t/begehung-quartierszent`  
`rum-mettingen/1431/3" 0.053 0.052 "mainmod" "-" "-" "-" "-" "-" "-"`

I would guess that the root cause lies somewhere behind, e.g. in the database request from postgres (we use separate containers and a dedicated postgres server)

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [June 16, 2026, 2:11pm UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/7 "2026-06-16T14:11:04Z")

</div>

Unfortunately this issue is still unsolved and appears from time to time, but with no visible logic/preconditions behind. So its hard to reproduce.

Again I looked into the nginx log of the web application and there is no indication of any http 500 error on the containers server side.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [June 19, 2026, 5:50pm UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/8 "2026-06-19T17:50:32Z")

</div>

@here there’s a 55% chance 😅 this will fix the issue

> <https://github.com/discourse/discourse-activity-pub/pull/319>
>
> \### What
> 
> Moving one or more posts into a \`full\_topic\` topic could raise
> \`Active…Record::RecordNotUnique\` and surface to the user as an HTTP 500 — from
> core's \`TopicsController#move\_posts\`, which only rescues \`RecordInvalid\` /
> \`RecordNotSaved\`, so anything else becomes a 500.
> 
> Reported on Meta: https://meta.discourse.org/t/error-500-when-moving-posts/397654
> 
> \### Why
> 
> ActivityPub records are hidden once tombstoned, via \`IdentifierValidations\`'
> \`default\_scope { where.not(ap\_type: Tombstone.type) }\`. The row still exists,
> though, and still occupies the unique \`(model\_type, model\_id)\` index
> (\`unique\_activity\_pub\_collection\_models\`).
> 
> The \`:first\_post\_moved\` / \`:post\_moved\` handlers check
> \`!topic.activity\_pub\_object\` — which the default scope reports as \`nil\` for a
> tombstoned collection — and call \`create\_activity\_pub\_collection!\`, which
> blindly inserts a second collection for the same topic and collides on the
> unique index.
> 
> It's data-dependent (the destination topic's collection must have been
> tombstoned previously, e.g. via a delete/restore cycle), which matches the
> intermittent, "no visible preconditions" reports.
> 
> \### How
> 
> \`create\_activity\_pub\_collection!\` now looks the collection up \`unscoped\`,
> restores it when tombstoned, and reuses it instead of inserting a duplicate.
> This makes the method idempotent for all of its callers, and preserves the
> collection's \`ap\_id\` (its federation identity) rather than orphaning it.
> 
> \### Tests
> 
> \- Adds a regression test for moving posts into a topic whose collection was
> tombstoned.
> \- A second commit simplifies the \`move\_posts\` topic specs — collapsing the
> per-scenario example fan-out into one example each, with \`:aggregate\_failures\`
> on the group. Same coverage, 38 → 14 examples, roughly half the runtime.

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [June 20, 2026, 6:27am UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/9 "2026-06-20T06:27:44Z")

</div>

perfect, thanks. I assume this is part of the activitypub plugins code. I don’t remember if this plugin is already bundled with the main code (see [Bundling more popular plugins with Discourse core](https://meta.discourse.org/t/bundling-more-popular-plugins-with-discourse-core/373574) ). Anyway, it should come with the next build/container update, correct?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [June 22, 2026, 8:22am UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/10 "2026-06-22T08:22:17Z")

</div>

> [@Thomas\_Rother](#):
>
> I don’t remember if this plugin is already bundled with the main code

When a plugin is “bundled with the main code” that means it’s under [https://github.com/discourse/discourse/tree/main/plugins](https://github.com/discourse/discourse/tree/main/plugins) - in that case, the `discourse-activity-pub` is **not** bundled with the main code 😉

> [@Thomas\_Rother](#):
>
> Anyway, it should come with the next build/container update, correct?

![Matty Matheson Says Correct](https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/96/ed/c1mOAoaI.webp)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [June 27, 2026, 6:00am UTC](https://meta.discourse.org/t/error-500-when-moving-posts/397654/11 "2026-06-27T06:00:57Z")

</div>

This topic was automatically closed after 4 days. New replies are no longer allowed.
