⚠️Saving failed! Someone else is editing this post

Hey team,

I’ve been working with Ghost editor for a while now.

Recently, I’m facing an issue while saving/publishing an article.

Here’s the error - ‘Saving failed! Someone else is editing this post’

This error is displayed even when I’m the only person logged in.

I’ve tried refreshing the page and logged in via incognito too.

Haven’t fixed it yet.

1 Like

This can happen if you are editing a post in a primary browser, then want to check to something in a secondary browser, so you open the post in the secondary browser, possibly test a change so you see “Draft - Saved” and then close the secondary browser.

Now in the primary browser, it will be impossible to save the post because of this error. Because the second browser session has been closed, it’s impossible to fix it there either. In the logs the error will appear as “UPDATE_COLLISION”.

By reading the source code, I learned that Ghost is detecting a collision and throwing an error by comparing the updated_at timestamp send by the current browser with the updated_at column of the posts table for this post. If the two don’t exactly match, the post is rejected. That code is here:

Knowing that, there is a (painful, technical) solution to resolve the issue and allow saving the post if you are self-hosting Ghost. Developer tools have to open be in the browser throwing the error. The next time the failing post is made, find the matching network request, then look at the JSON that’s being submitted. In the JSON, you’ll find an updated_at property. Copy that. It will look like this “2022-06-18T19:22:57.000Z”.

Next, you have to log into the database server you are using and use the MySQL client to open the database for the site. Using the unique slug (“Post URL”) for the post, you can run a manual update statement to set the updated_at value on the server to match the one on the client. For example:

update posts set updated_at = '2022-06-18 19:22:57' WHERE slug = 'your-post-slug-here';

Notice you have to reformat the date slightly for MySQL.

After these steps, the time the browser saves or publishes, it should work.