On a site I randomly get a popup with ‘Error 500’. It doesn’t say more than that. The site works fine.
(I had to ‘test 123’ to the topic title, because it wasn’t accepted? I got a strange error here as well, really annoying)
Does this happen in the manager?
If it happens regularly (or you can repeat the action that makes the popup appear), then open the “Network” tab of the browser developer tools first, so that you can determine what exact request returns the error.
Maybe you could also take a look at the server error log (That’s not the error log in MODX) to see if something (relevant to this) gets logged there.
Also, what version of MODX are you using?
Yeah sorry, in the Manager. Unfortunately it does not show up in de Developers tool.
MODX version is 3.0.3. Packages etc. are all up to date.
I found these Apache errors in the server log:
mod_fcgid: stderr: PHP Fatal error: Uncaught TypeError: readdir(): supplied resource is not a valid Directory resource in /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/Cache/xPDOCacheManager.php:485, referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: Stack trace:, referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #0 /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/Cache/xPDOCacheManager.php(485): readdir(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #1 /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/Cache/xPDOFileCache.php(92): xPDO\Cache\xPDOCacheManager->deleteTree(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #2 /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/Cache/xPDOCacheManager.php(703): xPDO\Cache\xPDOFileCache->delete(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #3 /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php(2378): xPDO\Cache\xPDOCacheManager->delete(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #4 /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/Om/xPDOObject.php(1493): xPDO\xPDO->toCache(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #5 /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/Om/xPDOObject.php(1590): xPDO\Om\xPDOObject->save(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #6 /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/Om/xPDOObject.php(1541): xPDO\Om\xPDOObject->_saveRelatedObject(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #7 /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/Om/xPDOObject.php(1348): xPDO\Om\xPDOObject->_saveRelatedObjects(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #8 /var/www/vhosts/domain.nl/httpdocs/core/src/Revolution/modX.php(2458): xPDO\Om\xPDOObject->save(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #9 [internal function]: MODX\Revolution\modX->MODX\Revolution\{closure}(), referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: #10 {main}, referer: https://www.domain.nl/manager/?a=resource/update&id=3
mod_fcgid: stderr: thrown in /var/www/vhosts/domain.nl/httpdocs/core/vendor/xpdo/xpdo/src/xPDO/Cache/xPDOCacheManager.php on line 485, referer: https://www.domain.nl/manager/?a=resource/update&id=3
I’m not really convinced that this error causes the 500 popup.
You could try changing the system setting log_deprecated
to No
and test if that solves the issue.
It looks like you may have enabled the cache_db system setting. I would disable that.
It looks disabling the cache_db setting helped.