freescout-help-desk/freescout

/system/status runs out of memory (even after increasing allowance by 400%)

Closed this issue · 4 comments

PHP version: 8.2.22
FreeScout version: 1.8.150
Database: MySQL
Are you using CloudFlare: Yes
Are you using non-official modules: No

Visits to /system/status always result in "Whoops, looks like something went wrong — check logs in /storage/logs".

The error logged there is always an out-of-memory:

[2024-08-27 10:14:51] production.ERROR: Allowed memory size of 209715200 bytes exhausted (tried to allocate 249856 bytes) {"userId":1,"email":"contact@example.com","exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 1): Allowed memory size of 209715200 bytes exhausted (tried to allocate 249856 bytes) at /var/www/websites/example.com/htdocs/overrides/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115)
[stacktrace]
#0 {main}
"} 

That's the error message at our previous setting of 200M. Reconfiguring PHP to use any other amount of memory (tried up to 1GB) results in the same error (just with the allowed size changed, of course - e.g. Allowed memory size of 524288000 bytes exhausted, etc).

No other pages have this result. The problem was first seen after we ran out of disk space, and made /var/www/websites to be a mount point that is separate from the root filesystem - though how that could be involved, I have no idea (all paths have remained the same, cache was regenerated, and Freescout upgraded to the latest version - before it was 1.8.147 and the same issue was occurring). There are no other visible problems after taking this action, and no other PHP errors logged (the Freescout instance is in continuous use with several logged-in active users processing support requests).

Apparently you have too many background jobs - check jobs and failed_jobs tables in DB.

This?

[examplecom]> SELECT COUNT(*) FROM jobs;
+----------+
| COUNT(*) |
+----------+
|    59337 |
+----------+
1 row in set (0.051 sec)

[examplecom]> SELECT COUNT(*) FROM failed_jobs;
+----------+
| COUNT(*) |
+----------+
|        8 |
+----------+
1 row in set (0.003 sec)

Change lin 83 in /app/Http/Controllers/SystemController.php to:

$queued_jobs = \App\Job::orderBy('created_at', 'desc')->limit(100)->get();

Yes, the page now loads. Thank you!