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).
Multiple user reports over the course of several months.
19845402-hc
If this is only happening to 1 or 2 sites, we should log to the Happiness Feedback P2 or Atomic Requests P2 to troubleshoot things like some of the post or page content flagging a security warning.
The Gutenberg core fix would like likely be a more friendly error message.
Tracking added by @noahtallen in https://github.com/Automattic/wp-calypso/pull/40035
Just commenting that we had another report in 2912227-zen.
I did mention it in the P2 post where it's being tracked, but figured it was worth noting here too. The site in question doesn't have a lot of plugins, only our own and one social media icons plugin.
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:
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!
Let's get this one on the radar of the newly formed Gutenberg Platform Squad. cc @sirreal
linking this too with more debug info: p9F6qB-4PJ-p2
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. 馃
I can consistently reproduce the issue on those sites following these steps:
I am also able to reproduce this with only 1 instance of the editor open, however a bit less consistently:
I believe this may be stemming from the same root cause.
Thanks @Addison-Stavlo that's super helpful, I can replicate those first steps now. I'll do some more digging!
Have a user experiencing this issue today: 22862652-hc.
Did a browser refresh and the issue was gone.
+--------------------+----------+-----------+---------+ | name | status | update | version | +--------------------+----------+-----------+---------+ | akismet | active | none | 4.1.6 | | amp | active | none | 1.5.5 | | classic-editor | inactive | none | 1.5 | | coblocks | active | none | 2.1.0 | | full-site-editing | active | none | 1.14 | | gutenberg | active | available | 8.3.0 | | jetpack | active | none | 8.7.1 | | layout-grid | active | none | 1.2.4 | | page-optimize | active | none | 0.5.0 | | pretty-link | active | none | 3.1.1 | | wpcomsh-loader | must-use | none | | | advanced-cache.php | dropin | none | | | object-cache.php | dropin | none | | +--------------------+----------+-----------+---------+
We didn't do a plugin conflict test during the chat (as I recommended the copy/paste workaround, but noting this case here
Another one in #23143308-hc. Plugins (same error with Gutenberg activated):
+--------------------+----------+-----------+---------+
| name | status | update | version |
+--------------------+----------+-----------+---------+
| akismet | active | none | 4.1.6 |
| amp | active | none | 1.5.5 |
| classic-editor | inactive | none | 1.5 |
| coblocks | active | none | 2.1.0 |
| full-site-editing | active | none | 1.14 |
| gutenberg | inactive | available | 8.3.0 |
| jetpack | active | none | 8.8 |
| layout-grid | active | none | 1.2.4 |
| page-optimize | active | none | 0.5.0 |
| wordpress-seo | active | none | 14.6.1 |
| wpcomsh-loader | must-use | none | |
| advanced-cache.php | dropin | none | |
| object-cache.php | dropin | none | |
+--------------------+----------+-----------+---------+
PHP-Errors
[03-Aug-2020 20:30:35 UTC] PHP Warning: json_decode() expects parameter 1 to be string, array given in /wordpress/plugins/wpcomsh/2.4.128/wpcomsh.php on line 1067
User said it only showed up in Safari, and no amount of browser diagnostics could remove it. Everything works fine in Chrome.
Copied page code to another post to save their page content. After coming out of the original post the editor worked fine again.
This user has had the issue before and ticks the "too many copies of the same page" and "leaving open too long" boxes.
Some things I've noticed so far:
Yea, this is hard to debug without being able to reproduce it on ephemeral sites, simple sites, or simulating the api call that's being made 馃 but Addie's repro instructions work consistently馃憤.
When the "editing toolkit" is disabled, the page autosaves successfully
That's definitely an interesting find :thinking:
on second thought, it looks like that was a red herring, I'm not sure why I stopped being able to reproduce the bug when I deactivated the plugin.... but then I re-activated it and still couldn't reproduce the bug... the joys of this kind of debugging, hmmm I almost wonder if I've found a support workaround that I don't understand yet 馃槀
ahh weird!
Another report here: 23659379-hc
As a workaround, the user was able to create a new post from the wp-admin dashboard
on second thought, it looks like that was a red herring, I'm not sure why I stopped being able to reproduce the bug when I deactivated the plugin.... but then I re-activated it and still couldn't reproduce the bug... the joys of this kind of debugging
I know this pain all too well and sympathize with the frustration. 馃槶 馃檭
hmm I got very stuck on this and was no longer able to reproduce it on my test site or my other test site or even a new atomic site 馃 did this issue just fix itself with a gutenberg update or something?
Also, I've been thinking about this at a higher level. When a user is in this situation with two editors open, they are actually already set up for failure. Whether that is lost updates or potential unhandled cases like this, I think that a better approach would be to attempt to discourage users from using two editors at the same time pbxlJb-ms-p2
also, this is the P2 thread where this was originally reported for more context/cases p9F6qB-4PJ-p2.
I tried again to reproduce this and still can't get it to manifest itself any more
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.
I experienced it once myself after stepping away for a bit.
Oh, that's a nice observation. Do we get this response if the nonce is expired or otherwise invalid?
Hi @roo2! I assigned myself to this issue if that's OK. Please LMK if you're working on it.
Hi @roo2! I assigned myself to this issue if that's OK. Please LMK if you're working on it.
@alshakero
No, I really gave up on reproducing this and was looking to move forward changing how we handle two editors open at the same time instead. I hope you can make some progress on it! pbxlJb-ms-p2
This was a mean issue. Fix and explanation are ready here 馃帀
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鈥檛 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:
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.
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.
Wonderful! I want to mention that the error The response is not a valid JSON response
can occur for several reasons. It looks like we've fixed the most common one which caused customers to report it on WordPress.com. But I want to mention that it is possible that we may see some intermittent reports of the issue which have different causes.
Most helpful comment
This was a mean issue. Fix and explanation are ready here 馃帀