Settings page looped up to error 504

Your software
My Mautic version is:3.3.3
My PHP version is:7.3.28
My Database type and version is:10.3.29-MariaDB

Your problem
My problem is:
The main error is 504 after a few minutes Loop. Rarely does it show Error 500, I believe that 500 is not about accessing the Settings page.

For permission testing
I changed the permissions on the “var” and “config” folders to 777.
I changed the permissions of the files in the “config” folder to 777.

This error also happened in Version 3.3.1, I made the update to version 3.3.3 to check if the error would be corrected.

I took the steps in this tutorial: Uh Oh, Mautic upgrade was not successful | John Linhart.

I have other installations on the same server with the same configurations described below, but only the one with this error.

PHP-FPM settings
I have already made changes, but it only extended the time until Error 504. The page is loaded for 10 minutes until reaching error 504.

Also, test with PHP-FPM disabled.

Server resources would not be the problem.

These errors are showing in the log:
these errors only happen when I give permission 777 for files and folders. I don’t believe they are related to the error on the settings page.

[2021-05-12 13:06:30] mautic.WARNING: PHP Warning - require(/home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/getTemplating_Helper_RouterService.php): failed to open stream: No such file or directory - in file /home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/appProdProjectContainer.php - at line 6121 {“file”:“getTemplating_Helper_RouterService.php”,“lazyLoad”:true}
[2021-05-12 13:06:30] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/getTemplating_Helper_RouterService.php’ (include_path=’.:/opt/cpanel/ea-php73/root/usr/share/pear’) - in file /home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/appProdProjectContainer.php - at line 6121
[2021-05-12 13:06:30] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/getTemplating_Helper_RouterService.php’ (include_path=’.:/opt/cpanel/ea-php73/root/usr/share/pear’) - in file /home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/appProdProjectContainer.php - at line 6121
[2021-05-12 13:06:30] mautic.WARNING: PHP Warning - require(/home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/getMautic_Exception_ListenerService.php): failed to open stream: No such file or directory - in file /home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/appProdProjectContainer.php - at line 6121 {“file”:“getMautic_Exception_ListenerService.php”,“lazyLoad”:true}
[2021-05-12 13:06:30] mautic.WARNING: PHP Warning - require(/home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/getRouting_LoaderService.php): failed to open stream: No such file or directory - in file /home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/appProdProjectContainer.php - at line 6121 {“file”:“getRouting_LoaderService.php”,“lazyLoad”:true}
[2021-05-12 13:06:30] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/getRouting_LoaderService.php’ (include_path=’.:/opt/cpanel/ea-php73/root/usr/share/pear’) - in file /home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/appProdProjectContainer.php - at line 6121
[2021-05-12 13:06:30] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/getRouting_LoaderService.php’ (include_path=’.:/opt/cpanel/ea-php73/root/usr/share/pear’) - in file /home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/appProdProjectContainer.php - at line 6121
[2021-05-12 13:06:30] mautic.WARNING: PHP Warning - require(/home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/getMautic_Exception_ListenerService.php): failed to open stream: No such file or directory - in file /home/mymautic/public_html/mkt.mymautic.com/var/cache/prod/Container9kpdfhj/appProdProjectContainer.php - at line 6121 {“file”:“getMautic_Exception_ListenerService.php”,“lazyLoad”:true}

Steps I have tried to fix the problem:

  1. Access https://mymautic.com/s/config/edit

Hello.

Disregard the error log information, as it was caused by permission incompatible with PHP-FPM.

I can access the Settings Page if I change the Server Timeout to 10 Minutes.
Keep-Alive Timeout = 10 Minutes
Timeout = 3000

This installation has 4GB of Database, the other 1GB of Database, this is the only difference, that I see.

What does the Settings page load? Where does it look for the data, in addition to the local.php file?

Looking at the performance of the server / database, they do not reach 10% of vCPU consumption and the memory is always below 50% of consumption.

All pages load well, except the settings page.

I made some microtime () for the files
config_file_row.html.php
ConfigController.php
form.html.php

But I believe that the problem is at an even deeper level.
With these searches I see that Mautic loads even things that are not used for the settings page, for example, he loaded the assets in json, at the beginning of the pages and even listed all the assets in the html, which seems to me that it loads all the pages of the Menu even though it will not be used.