Atomic: Editor error “Updating failed. The response is not a valid JSON response” when publishing posts and pages

Users on a WordPress.com Business plan have reported encountering the following error when attempting to publish posts and pages through Calypso:

Updating failed. The response is not a valid JSON response.

As the original Happiness Engineer who reported the issue explained:

In this case, the post/page edits are not saved in a revision, and the changes must be copied/pasted manually in order to be saved.

This issue seems to occur when a user starts working on a post or page, and then steps away for a period of time. The issue doesn’t seem to be readily reproducible, so it’s tricky to troubleshoot.

This issue has been reported here too: Updating failed. Error message: The response is not a valid JSON response – Centos 7 · Issue #18783 · WordPress/gutenberg.

This issue is for added visibility, as suggested here: p1585558290023800-slack-C02FMH4G8 (the link to the expanded, internal report is in that discussion thread).

Context / Source

Multiple user reports over the course of several months.

4 thoughts on “Atomic: Editor error “Updating failed. The response is not a valid JSON response” when publishing posts and pages

  1. I’ve been able to recreate this somewhat consistently: it tends to happen when you have the editor open in multiple tabs/windows on your browser. I discovered it while batch-editing a bunch of posts on a personal site and it came up in two other cases here:

    #21438861-hc
    #21447362-hc

    In all cases, closing all additional tabs/windows and refreshing the page of the one tab you are editing in will fix it. Hope this helps!

  2. Noting we see this with some frequency in the forums (not often tagged consistently but there’s this). I’m not sure about the JSON thing. What we see is that the auto save has failed and kinda hung up. People see a similar issue with saving drafts.

    I experienced it once myself after stepping away for a bit. Had to copy my work and hard refresh, then paste again before I could save.

  3. I have been exploring trying to reproduce this error. So far it seems to be specific to “Business” and “eCommerce” plans that have undergone the ‘Automated Transfer’ (AT) process. Jetpack’d atomic ephemeral sites and others do not seem to have the issue. thinking

    I can consistently reproduce the issue on those sites following these steps:

    * Open a post in WP Admin & make small edit. Don’t save; leave tab open.
    
    * Switch to Calypso and open same post. Make edits and update post.
    
    * Switch back to WP Admin tab. JSON message has already appeared, presumably because auto save failed after the post was updated in Calypso. (may need to wait a minute, or even try hitting the 'Update' button)
    
    * The 403 error is observable both with auto-saves and trying to update manually from there:
    

    Screen Shot 2020-07-07 at 2 12 44 PM

    I am also able to reproduce this with only 1 instance of the editor open, however a bit less consistently:

    * Navigate to wp-admin in either the pages or posts management page.  Do not load the editor.
    
    * In a separate tab: open calypso, navigate to your site, and open the editor for a page or post.
    
    * Tab back to wp-admin, checkbox a post, select the bulk action to 'trash' and 'apply'
    
    * Notice you are redirected to a 403 Screen.
    

    Screen Shot 2020-07-07 at 2 25 36 PM

    I believe this may be stemming from the same root cause.

    Thanks a lot for investigating how to reproduce this issue, Addison! And thanks Omar for the fix! ❤️

    I just tried with Gutenberg 9.0 on Atomic and could reproduce it. I then tried with 9.1.1 and the issue didn’t happen, then repeated the whole process, same results.

    I’ll close this issue, but feel free to re-open it if we find out this is still an issue.

Comments are closed.