Site logo

[Resolved] More “response is not a valid json response” woes

Home Forums Support [Resolved] More “response is not a valid json response” woes

Home Forums Support More “response is not a valid json response” woes

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2481129
    Kip

    I wrote earlier about my inability to save GeneratePress Elements here https://generatepress.com/forums/topic/dreaded-response-is-not-a-valid-json-response-error-cant-update-block-editor/.
    Afraid the issue still persists. Some new information:
    1) I worked on a new theme using GP/GB on a staging site (same server, different domain name, and no invalid response errors), but when I went to go live, I ran into the same problem. I tried a bunch of things but eventually gave up, recreated a clone VM using Azure backups (again, self hosted on an Azure VM/Ubuntu/nginx/mysql), pointed our live site (onmsft.com) to the backup, and then using wp_home and wp_siteurl in wp-config, pointed the broken site to a test domain (fluentonmsft.com).
    Now I’m able to edit and save Elements with no problems on fluentonmsft.com (remember it’s the exact same setup as the live site, a full cloned VM), but on the live site, now residing on a different VM/IP, the same valid json error is still here. This means:
    1) it’s not a plugin conflict, both VMs have the exact same setup and configuration
    2) it’s not an IP blocking issue, as the saves fail on two different IPs (not at the same time), it’s a problem with the domain
    3) the nginx sites-enabled config for both sites/VMs are exactly the same.
    4) both sites are running through Cloudflare with similar configs. I set up a WAF Firewall rule for onmsft.com, allowing “/wp-json/wp/v2/gp_elements/.” This rule is working, but it hasn’t changed anything.
    I created a ticket at Cloudflare (there is Cloudflare info in the 403 response from Inspect>Console) https://support.cloudflare.com/hc/en-us/requests/2661374 but have only received a bot answer so far (not sure if you can get to this link).
    I will start digging in to see if there’s something in Azure that is blocking me, but in the meantime any help you can provide would be much appreciated. Let me know and I can create an admin user on one or both boxes and one or both WP installs if you think you can help.

    #2481224
    Kip

    Hooray I finally found the answer! After disabling plugins, digging through the database, setting up multiple backup VMs, and filing multiple support tickets, I got someone at Cloudflare to actually help. I had read here https://generatepress.com/forums/topic/updating-failed-the-response-is-not-a-valid-json-response/#post-1690190 to create a firewall rule in Cloudflare to bypass “/wp-json/v2/gp_elements/” but it did not work for me. However, there needs to be one more step:
    “The reason that these requests are being blocked is the firewall rule isn’t quite configured right.
    The Allow action allows a request through the rest of your firewall rules, but doesn’t cover Managed Rules. The blocks are being caused by the OWASP Managed Rules challenging them”:
    Cloudflare managed rules bypass for not a valid json response error
    Setting the bypass feature did the trick (and not sure why the staging site worked, could be it had not exceeded the “Inbound Anomaly Score”). Anyway, that’s a lot of work to go through to get a “no code” solution to actually work, but at least now it does work.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘More “response is not a valid json response” woes’ is closed to new replies.