pristas-peter / wp-graphql-gutenberg

Query gutenberg blocks with wp-graphql
https://wp-graphql-gutenberg.netlify.app
GNU General Public License v3.0
299 stars 61 forks source link

"Saving of preview blocks failed." Error when editing post #136

Open PolMrt opened 2 years ago

PolMrt commented 2 years ago

Hi,

Thanks for your plugin, it's really helpful.

I have an issue since wp 5.9, I get the error "Saving of preview blocks failed." when editing an article. Seems to be related to WP GraphQL Gutenberg (see network screenshot) but also seems to be realted to ACF since I don't have the issue with a similar site with same config except ACF.

The error on the Gutenberg editor: Screenshot 2022-02-01 at 9 45 06 AM

The request that seems to be causing the error: Screenshot 2022-02-01 at 9 45 29 AM

My plugins: Screenshot 2022-02-01 at 9 47 58 AM

I also get the error "The response is not a valid JSON response." when trying to update block registry.

The error on WP-Graphql Gutenberg tab: Screenshot 2022-02-01 at 9 57 40 AM

The request that seems to be causing the error: Screenshot 2022-02-01 at 9 58 06 AM

If anyone is experiencing the same issue and managed to find a way to resolve it, I'll be really grateful if you can help me.

zewas-digital commented 2 years ago

Dose anyone allready have a fix for this?

louieheaton commented 1 year ago

Okay have found a solution which worked for me and thought I should share... So digging deeper I found a log file which contained the following error...

"upstream sent too big header while reading response header from upstream"

This relates to an issue to do with nginx and fastcgi buffers. After going and changing my nginx.conf file (either globally or for each individual config inside /etc/nginx/sites-available) and adding the following lines in the relevant block...

fastcgi_buffers 16 16k; fastcgi_buffer_size 32k;

it then worked fine from then onwards.

Answer found on stackoverflow, https://stackoverflow.com/questions/23844761/upstream-sent-too-big-header-while-reading-response-header-from-upstream

mathieuCatapulpe commented 1 year ago

Okay have found a solution which worked for me and thought I should share... So digging deeper I found a log file which contained the following error...

"upstream sent too big header while reading response header from upstream"

This relates to an issue to do with nginx and fastcgi buffers. After going and changing my nginx.conf file (either globally or for each individual config inside /etc/nginx/sites-available) and adding the following lines in the relevant block...

fastcgi_buffers 16 16k; fastcgi_buffer_size 32k;

it then worked fine from then onwards.

Answer found on stackoverflow, https://stackoverflow.com/questions/23844761/upstream-sent-too-big-header-while-reading-response-header-from-upstream

It works like a charm but only on php7.4 :(

On php8 there is an error 500, do you know if there's any plans to have a better compatibility @jasonbahl ? image