'This block has encountered an error and cannot be previewed.' Where to look? (conflict with Plesk and the temporary workaround to disable their security add-on)
#SOLVED
Hi,
I used Gutenberg from the very first beginning and it al seemed to work fine. But since the last 2 or 3 versions I get the following message all the time in many situation: with or without other plugins activated, in 3rd party themes, but also in the base 2017 theme. And on various sites. I cannot isolate the following message (on any block, even in the demo):
'This block has encountered an error and cannot be previewed.'
In anyway 'an error' does not give any clear information and should be changed for the normal endusers who might 'meet' this message ;-)
My server is on Plesk 17.x and running PHP 7.x, running Fastcgi or FPM. I tried playing with other settings, but nothing helped. This happens in any browser. I am on 4.9.7.....
Thanks for any help.
Peter Luit The Netherlands
I don't think it has anything to do with PHP and/or server settings, looking at the 'inspector'

Judging by the 403 error, your server's security/firewall settings might be blocking access to some files. You might try asking your hosting provider about this.
Well, I don't think so..... All websites just operate fine in any situation. It seems kind of strange that I have to call my hosting provider just because of one error in a plugin. This must be something else....... And it worked a couple of versions ago........
O yes, you were right anyhow. In my Plesk WordPress Security setting, the next switch was on: Security of the wp-includes folder. I switched it off, and now access is ok. Thanks a lot, for just letting my eyes looking into another direction ;-)
Great!
For those who want to know wether the above came from. I just re-opened this issue, since it seems that many people have this issue. Thank to @mrleemon for just pointing me to this server/hosting issue!!!
OK, let me explain the issue here and the possible solution. I am on Plesk and the latest Plesk version does supply an enormous amount of protections. So the wp-includes folder will be protected against external (plugins) execution of php files (if you set all protections on). There is one files there: wp-tinymce.php which is needed by Gutenberg. If you use the Plesk protection, you will see the error message, caused by the fact that this file cannot be executed (error 403, if you use 'inspect' in Chrome'.

OK, the solution, switch off the protection of the wp-includes folder and add the following in an independent .htacces file in the wp-includes folder:

Sorry, I cannot insert this in plain text here, the editor does not seem to leek the code....... If you don't want any .htaccess file in you wp-includes, don't worry, just don't do what I adviced. It makes you protection less secure, but at least Gutenberg will work. I insert the .htaccess always in my wp-includes, and you see the exception of the wp-tinymce.php there.
Please let me know if you have any questions. This works and solved the problem for me. I had it on all sites running in the same Plesk protection of that wp-includes folder. Don't know if Direct Admin does te same, but this should do the job.
Peter
Thank you for the extra information, @peterluit.
It seems that Plesk are aware that this configuration breaks the Classic Editor under some circumstances, and their current recommendation is to disable their security add-on.
Could you please contact Plesk support to let them know that their configuration will be incompatible with WordPress 5.0, not just with a few plugins?
I'm going to close this issue, as there's nothing we can do from the Gutenberg side, but please let us know what you hear back from Plesk.
@pento It seems that Plesk is aware of this issue in their WordPress Toolkit and they are working on a solution. See last comment: https://support.plesk.com/hc/en-us/articles/213925505-Unable-to-use-WordPress-plugin-403-Forbidden
Hi all, I'm getting the same exact error, but mine doesn't seem to be server related as I have no such errors in my console: https://screencast.com/t/PRh4j0nQff8 Any ideas?
Well, this one should be solved by now, with either WP 4.9.8 with the latest Gutenberg, or 5.0
I do have 5.0. Actually, updating my theme seems to have fixed the issue. Thank you :) @peterluit
I have had this issue several times in recent months, and I re-encountered it just now. Not very rewarding to suddenly just lose all the content of a block. This needs to be reopened.
I've just come to add a new post to a client's web page - first time in quite a while, and we're unablet o add links to the post. So this is still a big issue.