How to debug "Updating failed" and "Publishing failed"
Issue Overview
Hi there, I just installed Gutenberg today but am having issues updating an existing post or publishing a post. Basically, Save Draft, Preview and Publish doesn't result in the post being posted. I am only met with a rather unhelpful error message "Updating failed" or "Publishing failed". My WordPress is running on Nginx on Ubuntu 16.04 on a DigitalOcean VPS.
How do I go about debugging Gutenberg? Thank you.
Steps to Reproduce (for bugs)
- Create a new post in Gutenberg
- Click Save Draft, Preview, or Publish
- Error message shows up
Tried both chrome and firefox with same results.
Expected Behavior
It should save draft/ preview/ publish correctly.
Current Behavior
Cannot post/ preview/ publish.
Can you open the chrome dev tools, open the network tab, find the failing request (row in red) and check the response content?
I am getting the same issue. Have dev tools open to network tab, but not sure exactly what data you want from it. Not a dev, so let me know the steps you need me to take.
So, I discovered that CloudFlare is blocking it. Here is the message when I click on the red line under network tab:
Please enable cookies. Sorry, you have been blocked
You are unable to access cb1.io
Why have I been blocked?
This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.
What can I do to resolve this?
You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.
Cloudflare Ray ID: 3957e4485bee50ce • Your IP: 2602:306:80e9:5b50:c:4274:da70:9977 • Performance & security by Cloudflare •
I was able to whitelist my IP address at CloudFlare so I could publish and keep testing, but that is obviously not a general public solution.
What's the exact reason to block the request, any more details on cb1.io? Is it the "enable cookies" message? Why are cookies not enabled by default?
It seems that the CloudFlare proxy is too aggressive here.
Yep, I realise the thing blocking it is Cloudflare as well. Seems strange that no one brought it up until now.
Went to CloudFlare and exported to RAW the following error message:
{
"id": "395affffddb27026",
"country": "SG",
"ip": "[redacted]",
"protocol": "HTTP/2",
"method": "PUT",
"host": "www.describee.com",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0",
"uri": "/wp-json/wp/v2/posts/1262",
"request_duration": 0,
"triggered_rule_ids": [
"WP0025B"
],
"action": "block",
"cloudflare_location": "SIN",
"occurred_at": "2017-08-28T23:20:14.05Z",
"rule_detail": [
{
"id": "",
"description": "MATCHED_VAR"
}
],
"rule_message": "Prevent abuse against wp-json api Type B",
"type": "waf",
"rule_id": "WP0025B",
"zone_id": "2638dd05ae2835d407d4a8f321145b8f",
"cookie": ""
}
I really can't speak to the why. I will tell you that my setup is the standard off the shelf CloudFlare free account setup. I did not make any changes to what gets setup when you add a domain to their DNS except my DNS entries. This could be a bit of a problem for Gutenberg though with the level of use that CloudFlare has.
I do not have this problem using Divi with this domain. All publish options work properly in Divi going through CloudFlare, so I suspect something in the way Gutenberg send data is causing the issue.
I also cannot speak with any expertise as to the cookie message. I don't have anything special setup related to cookies though in that WordPress instance. I setup a brand new instance of WordPress to test Gutenberg. This install is in a subdirectory of the primary domain which has its own installation of WordPress using Divi.
Here is my Raw Export from CloudFlare. If anyone on your team would like to see any specific files, please feel free to reach out. Happy to help. Site is hosted with SiteGround in shared hosting.
{ "id": "3957f46bbaf450ce", "country": "US", "ip": "2602:306:80e9:5b50:c:4274:da70:9977", "protocol": "HTTP/2", "method": "PUT", "host": "cb1.io", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36", "uri": "/guttenbergtest/wp-json/wp/v2/posts/5", "request_duration": 3000064, "triggered_rule_ids": [ "WP0025B" ], "action": "block", "cloudflare_location": "MIA", "occurred_at": "2017-08-28T14:28:02.51Z", "rule_detail": [ { "id": "", "description": "MATCHED_VAR" } ], "rule_message": "Prevent abuse against wp-json api Type B", "type": "waf", "rule_id": "WP0025B", "zone_id": "b4b940faede0b52b8a99678ad1d0c31c", "cookie": "" }
Here's a screen from CloudFlare. Have a long list of blocks, but after randomly looking through, all the messages look the same.

Yep, I'm surprised this is the first time we see this, especially since we're using the standard API client which should be used elsewhere. I assume this is a general REST API concern and we should investigate why we're being blocked.
I'm getting a similar error ("Publishing failed.", "Updating failed.") after installing Gutenberg 1.0.0 today. My test site is NOT behind CloudFlare, so perhaps this is a different issue.
I am using WordPress 4.8.1 in Multisite mode. I did the usual Network Admin -> Plugins -> Add New to add the plugin. I did not "Network Activate" but instead went to one of my test sites (deepdark.blue) and activated the plugin for that site. I then went to "Gutenberg -> Add New" and began writing a post. I'm using Google Chrome on a Mac.
However, as soon as I dragged an image from my Mac desktop to Chrome, it said "Updating failed." and wouldn't let me add the image. I was able to go into the regular Media Library (from within Gutenberg), drag the image from my Mac desktop into there, and then insert into Gutenberg. I then wrote some more text and tried to save, at which point I got "Publishing failed."
Again, the test site ( http://deepdark.blue ) is NOT behind CloudFlare, so this may be something different. (Has Gutenberg been tested to work with multisite? with new gtlds?) Any suggestions on how to debug would be welcome. Thanks.
UPDATE - I activated the Gutenberg plugin on a second test site on the exact same WP Multisite server and had no problem using the plugin and creating a new post using Gutenberg. A potential difference is that the other site is danyork.ORG, so a traditional gTLD. It also uses a different theme so there could be other issues.
@danyork I suggest following the debug steps here https://github.com/WordPress/gutenberg/issues/2565#issuecomment-325289062 if possible and then if it's a different problem, feel free to create a new issue.
@youknowriad - Thanks. When I do that and look on the Headers tab at the red line under "Network" when I do a "Publishing failed", I see this (I removed the IP addresses):
Request URL:http://deepdark.blue/wp-json/wp/v2/posts/84
Request Method:PUT
Status Code:404 Not Found
Remote Address: <removed>:80
Referrer Policy:no-referrer-when-downgrade
when I try to drag and drop an image, I get:
Request URL:http://deepdark.blue/wp-json/wp/v2/media
Request Method:POST
Status Code:404 Not Found
Remote Address: <removed>:80
Referrer Policy:no-referrer-when-downgrade
When I look under the "Response" tab I see all the HTML that makes up the Gutenberg editor page.
FYI, I am also seeing red errors (on BOTH test sites) for "newest-note-date" with the header:
Request URL:wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data
Request Method:GET
Status Code:403 Forbidden
But that is happening on both the site where Gutenberg is working, and where it is not.
As noted in that issue 2596, my issue seems to have been fixed - and to have had nothing to do with the Cloudflare issue mentioned here.
Just a heads-up: this is still happening. I'm currently experiencing the issue with three separate WPMU installations.
Request URL:https://customerinforedacted.com/wp-json/wp/v2/posts/353
Request Method:PUT
Status Code:403
The Cloudflare incident message is the same reported above (rule WP0025B), but here it goes:
{
"id": "39f1d845ad104acd",
"country": "BR",
"ip": "Ip.Redacted",
"protocol": "HTTP/2",
"method": "PUT",
"host": "customer.info",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",
"uri": "/wp-json/wp/v2/posts/353",
"request_duration": 5999872,
"triggered_rule_ids": [
"WP0025B"
],
"action": "block",
"cloudflare_location": "GRU",
"occurred_at": "2017-09-16T06:42:16.58Z",
"rule_detail": [
{
"id": "",
"description": "MATCHED_VAR"
}
],
"rule_message": "Prevent abuse against wp-json api Type B",
"type": "waf",
"rule_id": "WP0025B",
"zone_id": "6e1fd92f8dcf1c32f654191579951f7e",
"cookie": ""
}
What didn't fix it
- Clearing cookies and cache,
- Re-installing Wordpress and Gutenberg,
- Creating a new Wordpress installation from scratch,
- Creating Page Rules disabling Performance, Security, Cache and Browser Integrity Checks at wordpresspath/wp-json* and wordpresspath/wp-admin*
What did "fix" it
- Whitelisting the client IP or IP range in Cloudflare's Application Firewall. While this works, surely this isn't a good solution.
- Not using Cloudflare. Also not really a solution.
As @youknowriad mentioned, given how Cloudflare is very widely adopted, I'm surprised we're not hearing more complains about this. I'm a bit dumbfounded by the whole thing.
Sorry to find about this just now. Whenever you find that Cloudflare has blocked a request you consider legitimate, you need to follow the instructions in this article of our Knowledge base and search for the event matching the request that was blocked. Once you have found the corresponding event, click on "Detail" to show the report as screenshotted above. In there, take note of the rule ID of the rule that was triggered (in the present case: "WP0025B").
You now need to decide if it's safe to disable the rule to let these requests through, and if so:
- visit the "Firewall" section of your domain in your Cloudflare account
- show the WAF tab
- scroll down to "Package: Cloudflare Rule Set"
- click on "Rule details", then "Advanced" at the bottom of the panel that unfolds
- search for the rule using the rule ID in the overlay that appears (in the present case "WP0025B"), see the screenshot below
- deactivate the rule

To answer @trenzterra, only users/domain with a Pro plan would have access to the WAF, so this is only a subset of the Cloudflare user base.
Confirmed, disabling WP0025B allows Gutenberg through.
Unfortunately, this means that Cloudflare free users will be left in the cold. Is there a workaround for this?
Confirmed indeed; disabling WP0025B works.
@trenzterra one workaround available to all users is using a pagerule to disable all Cloudflare security for the API's suburl:
- Disable security
- Browser integrity check: Off
- Cache Level: Bypass
- Disable Apps
- Disable Performance

This does consume one of the three pagerules available for a free user, but it works.
I'm getting the same issue. Once in a while on the same article it goes through, but most of the time I get the "Updating failed" message. Only thing that i change between attempts to update are minor, like changing/adding text to paragraphs.
Notes
- Changing theme has no impact
- Gutenberg v 1.5.2
- Wordpress v 4.8.2
- Classic editor works just fine
What stands out is the AJAX call result that is being sent to the WP API:
Request URL:http://localhost/wp-json/wp/v2/posts/1674
Request Method:PUT
Status Code:200 OK
Remote Address:127.0.0.1:80
Referrer Policy:no-referrer-when-downgrade
This gives me the following response body:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 </title>
</head>
<body>
<h2>HTTP ERROR: 404</h2>
<p>Problem accessing /nrksuper. Reason:
<pre> Not Found</pre></p>
<hr /><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.2.v20150730</a><hr/>
</body>
</html>
{JSON Object as usual which is also returned when everything is fine}
I have the same problem, but I think for a different cause (though it also relates to the API).
As I described here, because my site URL and my WP URL are different, anything to do with REST gets me this error:
Request header field X-WP-Nonce is not allowed by Access-Control-Allow-Headers in preflight response.
Followed by repeated
Failed to load resource: the server responded with a status of 403 (Forbidden)
I fixed the second one by disabling Jetpack and iThemes Security (as you say, firewall/cdn-related probably), but the Nonce remains a problem.