gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

'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)

Open peterluit opened this issue 8 years ago • 13 comments

#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

peterluit avatar Jul 21 '18 06:07 peterluit

I don't think it has anything to do with PHP and/or server settings, looking at the 'inspector' beeld 329

peterluit avatar Jul 21 '18 09:07 peterluit

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.

mrleemon avatar Jul 22 '18 07:07 mrleemon

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........

peterluit avatar Jul 22 '18 09:07 peterluit

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 ;-)

peterluit avatar Jul 22 '18 10:07 peterluit

Great!

mrleemon avatar Jul 22 '18 10:07 mrleemon

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'.

beeld 329

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:

beeld 330

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

peterluit avatar Jul 22 '18 19:07 peterluit

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 avatar Jul 23 '18 04:07 pento

@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

peterluit avatar Jul 23 '18 05:07 peterluit

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?

nikolay-advolodkin avatar Dec 10 '18 16:12 nikolay-advolodkin

Well, this one should be solved by now, with either WP 4.9.8 with the latest Gutenberg, or 5.0

peterluit avatar Dec 10 '18 17:12 peterluit

I do have 5.0. Actually, updating my theme seems to have fixed the issue. Thank you :) @peterluit

nikolay-advolodkin avatar Dec 10 '18 17:12 nikolay-advolodkin

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.

vesaraiskila avatar May 08 '19 05:05 vesaraiskila

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.

munrobasher avatar Jul 26 '19 20:07 munrobasher