Front end shows 500 error and a message “The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.”
architecture: using a LAMP on Ubuntu installation. Old version: going to restore my droplet snapshot I took just before the update attempt and report back.
system (terminal) record to show you what I did and when:
➜ html cd mautic
➜ mautic php bin/console mautic:update:find
Version 6.0.0 of Mautic is available for download. Please visit https://github.com/mautic/mautic/releases/tag/6.0.0 for more information.
To update, you can run 'php bin/console mautic:update:apply' from the command line.
➜ mautic php bin/console mautic:update:apply
Are you sure you wish to update Mautic to the latest version? y
Step 7 [------->--------------------] Clearing the cache
<warning>IMPORTANT: Run the same command again with --finish. For example 'php bin/console mautic:update:apply --finish'</warning>
➜ mautic php bin/console mautic:update:apply --finish
Step 2 [============================] Success! You are now running version 6.0.0 of Mautic.
➜ mautic php bin/console mautic:update:find
Great! You are running the current version of Mautic.
➜ mautic cat /var/log/apache2/error.log
[Sat Mar 29 00:00:03.858113 2025] [mpm_prefork:notice] [pid 2122728] AH00163: Apache/2.4.58 (Ubuntu) OpenSSL/3.0.13 configured -- resuming normal operations
[Sat Mar 29 00:00:03.858154 2025] [core:notice] [pid 2122728] AH00094: Command line: '/usr/sbin/apache2'
[Sat Mar 29 07:59:08.098895 2025] [core:error] [pid 2626492] [client 183.215.230.24:36148] AH10244: invalid URI path (/cgi-bin/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/bin/sh)
[Sat Mar 29 07:59:09.668670 2025] [core:error] [pid 2627150] [client 183.215.230.24:37628] AH10244: invalid URI path (/cgi-bin/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/bin/sh)
➜ mautic cat /var/log/apache2/error.log
[Sat Mar 29 00:00:03.858113 2025] [mpm_prefork:notice] [pid 2122728] AH00163: Apache/2.4.58 (Ubuntu) OpenSSL/3.0.13 configured -- resuming normal operations
[Sat Mar 29 00:00:03.858154 2025] [core:notice] [pid 2122728] AH00094: Command line: '/usr/sbin/apache2'
[Sat Mar 29 07:59:08.098895 2025] [core:error] [pid 2626492] [client 183.215.230.24:36148] AH10244: invalid URI path (/cgi-bin/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/bin/sh)
[Sat Mar 29 07:59:09.668670 2025] [core:error] [pid 2627150] [client 183.215.230.24:37628] AH10244: invalid URI path (/cgi-bin/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/bin/sh)
After update (right before I read the apache error log) the front-end error was shown.
Last 3 lines of [installation folder]/var/logs/mautic_prod-2025-03-29.php show these errors at every page refresh:
[2025-03-29T21:05:39.847819+00:00] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/url_matching_routes.phpaZAVQO" to "/var/www/html/mautic/var/cache/prod/url_matching_routes.php": rename(/tmp/url_matching_routes.phpaZAVQO,/var/www/html/mautic/var/cache/prod/url_matching_routes.php): Permission denied" at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php line 320 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/url_matching_routes.phpaZAVQO\" to \"/var/www/html/mautic/var/cache/prod/url_matching_routes.php\": rename(/tmp/url_matching_routes.phpaZAVQO,/var/www/html/mautic/var/cache/prod/url_matching_routes.php): Permission denied at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php:320)"} {"hostname":"lamponubuntu2404-s-2vcpu-4gb-syd1-01","pid":2666623}
[2025-03-29T21:05:39.899063+00:00] mautic.CRITICAL: Exception thrown when handling an exception (Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("Unable to write in the cache directory (/var/www/html/mautic/var/tmp/twig/1b)."). at /var/www/html/mautic/app/bundles/CoreBundle/Resources/views/Error/500.html.twig line 1) {"exception":"[object] (Twig\\Error\\RuntimeError(code: 0): An exception has been thrown during the rendering of a template (\"Unable to write in the cache directory (/var/www/html/mautic/var/tmp/twig/1b).\"). at /var/www/html/mautic/app/bundles/CoreBundle/Resources/views/Error/500.html.twig:1)\n[previous exception] [object] (RuntimeException(code: 0): Unable to write in the cache directory (/var/www/html/mautic/var/tmp/twig/1b). at /var/www/html/mautic/vendor/twig/twig/src/Cache/FilesystemCache.php:57)"} {"hostname":"lamponubuntu2404-s-2vcpu-4gb-syd1-01","pid":2666623}
[2025-03-29T21:05:39.906156+00:00] mautic.ERROR: Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("Unable to write in the cache directory (/var/www/html/mautic/var/tmp/twig/1b)."). - in file /var/www/html/mautic/app/bundles/CoreBundle/Resources/views/Error/500.html.twig - at line 1 [] {"hostname":"lamponubuntu2404-s-2vcpu-4gb-syd1-01","pid":2666623}