Several Iterator Classes Failing with Max Execution Time

I got quite a bunch of errors in my log since a short time, but I dont see a reason for them.

Almost all of them are iterator classes, but the strange thing: Those actions which trigger the error work in case you restart them again directly after.

I’ve no idea where to start my search. Ideas are welcome…

#0 {main}  
[2024-01-07 00:03:29] prod.ERROR: Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:74
Stack trace:
#0 {main}  
[2024-01-07 00:03:29] prod.ERROR: Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php:122
Stack trace:
#0 {main}  
[2024-01-07 00:03:40] prod.ERROR: Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:74
Stack trace:
#0 {main}  
[2024-01-07 00:03:42] prod.ERROR: Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php:45
Stack trace:
#0 {main}  
[2024-01-07 00:04:06] prod.ERROR: Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php:122
Stack trace:
#0 {main}  
[2024-01-07 00:04:14] prod.ERROR: Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:74
Stack trace:
#0 {main}  
[2024-01-07 00:04:20] prod.ERROR: Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php:45
Stack trace:
#0 {main}  
[2024-01-07 00:04:25] prod.ERROR: Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php:74
Stack trace:
Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/symfony/finder/SplFileInfo.php:32 	
	67932 	Today at 10:25 PM 	
Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded in /var/www/mchv2_prod/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php:122 

It can happen like everywhere: Calling handlers, open forms from a regular list… everywhere, frontend and backend. So I guess it’s a more central thing.

Looks like you use file based sessions and the directory you’re using has a loooooooot of session files.
You need to manually clear the directory, probably on a terminal. There are methods to clear the files with Laravel, but you will run into the same problem.

1 Like

6.8 million files.

Well, I guess you’re right.

For some reason the .env session time was significantly higher then 120 seconds. I change it so this+ removing the session files should solved the issue.

In case someone face the same issue and face the problem that rm -Rf * does abort (argument list to long), use this command inside the session folder: find . -type f -delete

1 Like