Manager: Image viewing and upload broken after MODX 3 upgrade

I just upgraded a MODX 2.8.6 site to 3.0.4. I had a few issues, mainly dealing with file permissions, all of a sudden getting a ton of 403 errors. After chmodding all folders (775) and files (664) it looked like everything was working again.

The only issue left is, that when I’m viewing the media browser, it’s not loading thumbnails for the images. Then, I also get logged out after a short amount of time after viewing a media source.

The dev console shows a ton of 401 errors for the image requests.

There’s also a lot of these errors in the error log:

(ERROR @ core/src/Revolution/Sources/modMediaSource.php : 2244) PHP warning: exif_read_data(Brand-Logo-Alpha-Web.png): File not supported
(ERROR in xPDO\xPDOConnection::connect @ core/vendor/xpdo/xpdo/src/xPDO/xPDOConnection.php : 89) SQLSTATE[HY000] [1203] User o9431840 already has more than 'max_user_connections' active connections
(ERROR @ core/vendor/xpdo/xpdo/src/xPDO/Om/xPDOQuery.php : 670) Could not construct or prepare query because it is invalid or could not connect: SELECT `modExtensionPackage`.`id`, `modExtensionPackage`.`namespace`, `modExtensionPackage`.`name`, `modExtensionPackage`.`path`, `modExtensionPackage`.`table_prefix`, `modExtensionPackage`.`service_class`, `modExtensionPackage`.`service_name`, `modExtensionPackage`.`created_at`, `modExtensionPackage`.`updated_at`, Namespace.path AS namespace_path FROM `mx_extension_packages` AS `modExtensionPackage` JOIN `mx_namespaces` `Namespace` ON `modExtensionPackage`.`namespace` =  `Namespace`.`name` ORDER BY namespace ASC 
(ERROR @ core/vendor/xpdo/xpdo/src/xPDO/Om/xPDOQuery.php : 670) Could not construct or prepare query because it is invalid or could not connect: SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `mx_session` AS `modSession` WHERE `modSession`.`id` = ? 
(ERROR @ core/vendor/xpdo/xpdo/src/xPDO/Om/xPDOObject.php : 250) Error preparing statement for query: SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `mx_session` AS `modSession` WHERE `modSession`.`id` = ?  - Array
(
    [0] => 00000
    [1] => 
    [2] => 
)

Any ideas?

Could it be this issue

I’m on PHP 8.2 (sorry, should’ve mentioned that)

Any different ideas for this issue?

You can ignore the exif_read_data warning.

I suspect User ... already has more than 'max_user_connections' active connections is the real problem and the rest are subsequent errors (because the DB-connection doesn’t exist).

I have no idea though why the code tries to create too many DB-connections. I would expect the code to connect once and the reuse the connection.
Maybe there is some sort of recursion occuring.

I’m really lost with this. But it has something to do with the images. I can’t upload any through the manager either. Whenever I try to upload one, I just get an error prompt with the name of the file. Nothing in the error log. The dev console shows a request but no response so not even an error code here.

Update: When I upload the files via FTP it’s all fine, when uploading through the manager, it removes the dot . before the file type. So image.jpg gets uploaded to imagejpg. Why would it do that? Also all filenames get converted into lowercase letters.

What would be responsible for this?

So I think something major broke during the upgrade. I reverted back to a backup and started again. Still ran into some issues but those might get their own thread… thank you guys for the support!

1 Like