Random 404 errors when editing posts

I’ve been getting random 404 errors when editing replies in my forum.

When edits work, they send a PUT request to the endpoint /posts/:post_id with a 200 response.

But when they don’t work, I can see in the developer tools a PUT request to /post_replies/:post_id that returns a 404. When I refresh the page, the errors go away and I’m able to save the edit correctly (via /posts/:post_id, the :post_id doesn’t change).

I’m not sure if there is a special condition that could make /posts turn into /post_replies by mistake or if it’s a different problem. I recently quadrupled my server’s RAM and I haven’t seen anything weird in the logs.

Any help is appreciated.

2 Likes

I continue to get these random errors when trying to save an edit for other people’s posts. It happens with both old and new posts, but always randomly:

And it goes away when I refresh the page and save the edit:

I’m on the latest version and can confirm this is still happening: trying to save an edit on other another user’s post randomly triggers a dialog box with a not_found message:

The requested URL or resource could not be found.

If I reload the page and press the “Save Edit” button again, the error goes away and the edit is saved.

Those two requests are getting PUT to different URLs.

Right. But why? I’m pressing the same “Save Edit” button in the same post. The only difference is a page refresh

Maybe try checking the browser backtrace next time it happens? Since it’s hitting different endpoints it may be going via different methods in the EmberJS app.

1 Like

@Falco It just happened again. This is all I see when I open the console after I get the error:

And if I try saving again with the console open:

Then I refresh the page and it lets me edit:

image

This is the path of the initiator (VM73:1 Script):

1 Like