Moderator move post, get 500 internal error, how to troubleshoot

Hello everyone,

if we try to move a post from one thread to another, we sometimes get a ‘500 internal server error’

Is there some tutorial how to troubleshoot issues like this? Where i can find the log files to get details about the issue?

Thx für every reply :slight_smile:

Greetings, Ronny

We are also seeing 500 errors when moving posts. I managed to trigger it by moving a post to another topic, then attempting to move it back to the original topic.

Here are the details:

SyntaxError: Unexpected token < in JSON at position 0
    at Function.parse [as parseJSON] (<anonymous>)
    at t (_application-1aa5dba826bc3ed623e07f37fc542db9746ecf4a5fcf6b519e5921036bface8d.js:12468)
    at _application-1aa5dba826bc3ed623e07f37fc542db9746ecf4a5fcf6b519e5921036bface8d.js:34707
    at f (_ember_jquery-d430881a3fb1403871256e5a02423c4b20a78793685e92088613ca9a701baf88.js:70136)
    at T (_ember_jquery-d430881a3fb1403871256e5a02423c4b20a78793685e92088613ca9a701baf88.js:70309)
    at E (_ember_jquery-d430881a3fb1403871256e5a02423c4b20a78793685e92088613ca9a701baf88.js:70295)
    at y (_ember_jquery-d430881a3fb1403871256e5a02423c4b20a78793685e92088613ca9a701baf88.js:70231)
    at t.invoke (_ember_jquery-d430881a3fb1403871256e5a02423c4b20a78793685e92088613ca9a701baf88.js:64637)
    at e.t.flush (_ember_jquery-d430881a3fb1403871256e5a02423c4b20a78793685e92088613ca9a701baf88.js:64527)
    at e.t.flush (_ember_jquery-d430881a3fb1403871256e5a02423c4b20a78793685e92088613ca9a701baf88.js:64731)

Thank you for your reply!

In the meantime i found the causing problem in the Table post_timings in the database. In this table is stored, to which post the users already read in the threads. Under (for me) unknown circumstances it can happen, that the server tries to write entries in the table, that already existing.

I’ve searched in the logs and found a hint to this database table. Unfortunally i don’t know anymore, which logs i searched… :confused:

The solution for me, was simply to delete the content of the table. All users lost their progress of reading threads, and some people had to write a new entry in existing threads just to overwrite browser cached stuff.I have a very little forum with just approx. 20 users, i don’t think, this is applicable for a forum with more users :wink:

Greetings Ronny

3 Likes

Thanks Ronny, and yikes! I don’t think my 10k users will be very happy about losing their read history. I’ve also received reports from many users that their posts are not being marked as read properly in the past weeks. This explains that too, I guess.

Is there any way to clean this up without deleting the table, @sam or others? :slight_smile:

1 Like

This resolved bug probably explains the unread states:

2 Likes

I just tried to reproduce this error in my local environment. I was able to move a post to a new topic and then move it back.

I can’t tell if the commit being mentioned here is causing the error. It doesn’t alter the post_timings table and it’s part of an experimental feature we’ve been working on (disabled by default). Just to be sure, I tried moving posts when the feature is enabled but it also worked correctly.

If someone could share some logs, that could be really helpful.

1 Like

I take a look, if i have my old logs about the datatable error. But the deletion of the table content fixed the problem for sure (with the side effects i mentioned)

Sorry, i’ve searched for it, but cannot find it anymore… :confused:

For what it’s worth, I’m also getting this 500 error when trying to move a particular post from one thread to another. I haven’t tried anything fancy, so if someone from Discourse wants logs, let me know what to look for and I’ll see if I can do that.

6 Likes

Thanks, I’ll try it when the next beta ships.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.