Images not loading in editor - 500 errors in console

Hello,
I’m having increasing difficulties on a landing page I’m designing with some images not loading in the editor. It’s different on every page load, and everything loads reliably on the front end.

This is a page with a large number of images (20+), but even if I copy a few blocks to a clean page, it exhibits a similar issue.

Cwicly version 1.3.4.5
PHP 8.2

The console it littered with 500 errors, so I assume perhaps I need to change server config to play better with Cwicly? Any suggestions? It’s getting unusable.

This is an example of one of the console errors:

GET https://example.com/index.php/wp-json/wp/v2/media/143?context=edit&_locale=user 500 (Internal Server Error)
j @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
h @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
P @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
a @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
P.method.r @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
a @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
t @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
g @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
A @ api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
(anonymous) @ core-data.min.js?ver=99b262137df116eb6013:2
await in (anonymous) (async)
(anonymous) @ data.min.js?ver=dc5f255634f3da29c8d5:2
(anonymous) @ redux-routine.min.js?ver=0be1b2a6a79703e28531:9
(anonymous) @ data.min.js?ver=dc5f255634f3da29c8d5:2
(anonymous) @ data.min.js?ver=dc5f255634f3da29c8d5:2
(anonymous) @ data.min.js?ver=dc5f255634f3da29c8d5:2
setTimeout (async)
s @ data.min.js?ver=dc5f255634f3da29c8d5:2
i @ data.min.js?ver=dc5f255634f3da29c8d5:2
(anonymous) @ index.js?ver=1.3.4.5:3
(anonymous) @ data.min.js?ver=dc5f255634f3da29c8d5:9
__unstableMarkListeningStores @ data.min.js?ver=dc5f255634f3da29c8d5:2
(anonymous) @ data.min.js?ver=dc5f255634f3da29c8d5:2
l @ data.min.js?ver=dc5f255634f3da29c8d5:9
(anonymous) @ data.min.js?ver=dc5f255634f3da29c8d5:9
Je @ data.min.js?ver=dc5f255634f3da29c8d5:9
Qe @ data.min.js?ver=dc5f255634f3da29c8d5:9
_o.name @ index.js?ver=1.3.4.5:3
e @ index.js?ver=1.3.4.5:3
wt @ react-dom.min.js?ver=18.2.0:10
js @ react-dom.min.js?ver=18.2.0:10
wl @ react-dom.min.js?ver=18.2.0:10
bl @ react-dom.min.js?ver=18.2.0:10
yl @ react-dom.min.js?ver=18.2.0:10
ol @ react-dom.min.js?ver=18.2.0:10
v @ react.min.js?ver=18.2.0:10
ce @ react.min.js?ver=18.2.0:10
api-fetch.min.js?ver=0fa4dabf8bf2c7adf21a:2
Web server	LiteSpeed
PHP version	8.2.13 (Supports 64bit values)
PHP SAPI	litespeed
PHP max input variables	1000
PHP time limit	30
PHP memory limit	256M
PHP memory limit (only for admin screens)	512M
Max input time	60
Upload max filesize	64M
PHP post max size	64M
cURL version	7.87.0 OpenSSL/1.1.1w
Is SUHOSIN installed?	No
Is the Imagick library available?	Yes
Are pretty permalinks supported?	Yes

Update: copying the site to local results in the editor loading fully, so I wonder if the hosting needs more CPU to handle Cwicly properly.

However, when running it locally, the global styles are borked and won’t regenerate:

Hello @Graphnic,

Is this only happening with calls to v2/media? This is a Gutenberg API endpoint, not Cwicly. In fact, we don’t touch Gutenberg APIs at any stage.

500 errors typically indicate that you have something on your setup which is causing a fatal error (which comes across with the critical error message).

I don’t see any reason to suggest this is CPU related.

Cheers,

Hey Louis, thanks for the fast response! Yes, it seems mainly to be v2/media and one instance of v2/components.

It appears the hosting CPU is maxing out. It’s a shared host I use a lot with Gutenberg, but I’ve never hosted Cwicly there before.

There are a lot of images loading in the editor. On the front end of course, the appropriate size is loaded via srcset but the editor, I guess is pulling in the full-size version. Perhaps this isn’t helping?

Hello @Graphnic,

This seems strange as media calls are also made by the Gutenberg core image block the same way… Would you mind letting me know how many images we’re talking about? Definitely something to look into.

Would be great if you could send to support@cwicly.com a copy of your debug log if you have one. Or if you send us temporary FTP details, we can check it out for you.

Cheers,

Will do, I’m waiting for the host to check their side too. I have just copied one block off into an new page, and see the same issue… so it’s not related to the number of images, it would seem.

@louis, I have emailed you directly. Our web host has identified the problem is due to the number of concurrent database connections exceeding their limit… I’ve sent you the details.

Many thanks as always!

Hello @Graphnic,

We’ve replaced calls to the native WordPress media API with batched Cwicly calls in 1.3.4.6.

I would be grateful if you could let me know if this fixes the issue you were encountering with your host and the limited database connections they allow.

Thanks in advance.

Cheers,

I have the same issues with Cwicly 1.3.4.6. And the font manager don’t upload my custom fonts.

err500

Hello @Yaland,

Would you possibly send support@cwicly.com a copy of your debug log so that we can investigate this further?

Thanks in advance.

Cheers,

Thanks @Louis, this seems to have cured the problem - at least at first glance. I need to work on this site today, so will verify. Thank you :smiley:

1 Like

Just to confirm, this patch does appear to resolve the problem with limited permitted DB connections on this host. I have been using the editor heavily today and it all seems fine. Thanks for the swift resolution!

Hello @Graphnic,

Thanks for letting us know, much appreciated!
Moving to Fixed Bugs.

Cheers,