Maximum execution time of 0 seconds in Collection reduce method - php

In the past week, I started to receive the following message in the Laravel log, but there is nothing else on my stacktrace to give me any clue of what is going on. Any idea of what this could happen?
[2017-11-30 19:40:05] production.ERROR: Maximum execution time of 0 seconds exceeded {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 1): Maximum execution time of 0 seconds exceeded at /var/www/html/app/vendor/laravel/framework/src/Illuminate/Support/Collection.php:1201)
[stacktrace]
#0 {main}
"}
I'm currently using Laravel 5.5 and PHP 7.1.

I managed to solve the issue. I checked Apache error logs, and it showed me the URL where the error was and from that point, I was able to review what happened. And it was bug in our implementation that was causing a weird iteration that took a lot of time. Now, it's solved.

Related

PHP Fatal error: Maximum execution time of -1 seconds exceeded in

Been getting this error on my server all of a sudden -
Fatal error: Maximum execution time of -1 seconds exceeded in
This is happening inside my wordpress site. It shows up across many files so it's not isolated to one in particular.
Googling hasn't given me any results for the "-1 seconds" issue which is rather odd. I've tried increasing the time limit on the scripts but it doesn't resolve the issue.
I've found that refreshing the page many times will eventually give me the page I want.
I ended up reinstalling Wordpress, and I get the same issue again. I'm starting to think it's not a Wordpress issue, but have no idea where to start diagnosing the issue.
Try this in your php code(add top)
set_time_limit(0);
ini_set('max_execution_time', 0);
if you are getting error again and again increase the time limit and see

Laravel 5.1 random timeout in ExcludeDirectoryFilterIterator

I'm seeing quite a few timeout errors on a big laravel 5.1 site:
[2018-05-23 17:02:35] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Maximum execution time of 30 seconds exceeded' in /var/www/vhosts/{site}/httpdocs/bootstrap/cache/compiled.php:16501
Stack trace:
0 {main}
Looking into the compiled.php file on that line number leads me to: ExcludeDirectoryFilterIterator#hasChildren
This function is from symfony/finder (version v2.7.47)
https://github.com/symfony/finder/blob/34226a3aa279f1e356ad56181b91acfdc9a2525c/Iterator/ExcludeDirectoryFilterIterator.php#L73
I've used debug_backtrace on this function to see what's calling it and it looks to be laravel when loading the configuration from storage (local disk).
Does anybody know of any issue with this? Is the server disk getting hit hard at some times during the day causing loading the config to timeout?
Any help/suggestions much appreciated.

PHP: Max execution time 0 exceeded [duplicate]

This question already has answers here:
Fatal error: Maximum execution time of 0 seconds exceeded
(4 answers)
Closed 5 years ago.
I am using laravel 5.5.* and MySQL for the database. And when I am running a script I am receiving an error message saying that Maximum execution time of 0 seconds exceeded.
Anyone have any understanding as to what would be causing this error message?
[2017-11-18 11:40:50] live.ERROR: Maximum execution time of 0 seconds exceeded {"exception":"[object] (Symfony\Component\Debug\Exception\FatalErrorException(code: 1): Maximum execution time of 0 seconds exceeded at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:826)
[stacktrace]
#0 {main}
"}
[2017-11-18 13:04:01] live.ERROR: Maximum execution time of 0 seconds exceeded {"exception":"[object] (Symfony\Component\Debug\Exception\FatalErrorException(code: 1): Maximum execution time of 0 seconds exceeded at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:163)
[stacktrace]
#0 {main}
"}
My settings for PHP have the max_execution_time = 0 So it should never timeout. However it seems to be taking the 0 literally, and timing out straight away.
Is this a laravel setting ? Or is it something to do with the database?
UPDATE:
When I change the max_execution_time = 1 I get this response.
[2017-11-18 13:25:23] live.ERROR: Maximum execution time of 1 second exceeded {"exception":"[object] (Symfony\Component\Debug\Exception\FatalErrorException(code: 1): Maximum execution time of 1 second exceeded at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php:185)
[stacktrace]
#0 {main}
"}
Note: It does timeout after 1 second with 1, however when I have it on 0. It doesnt seem to time out straight away. Im unable to know exactly how long, but it lasts longer than 20 seconds, and possible a couple minutes at least.
Try setting both max_execution_time = 0 and max_input_time = -1. I had a similar issue where it was taking the 0 as literal. After I also max_input_time it worked.

Laravel memory exception 'Database/Connection.php:301'

I got a strange bug going down here, sometimes select queries dies from a memory exception. The big problem here is that I've never been able to see the error by myself. I know its existence from users and the laravel.log file that contains things like :
[2015-03-05 11:46:07] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Allowed memory size of 134217728 bytes exhausted (tried to allocate 196605 bytes)' in [...]/vendor/laravel/framework/src/Illuminate/Database/Connection.php:301
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []
My questions are :
How to debug the issue (find oud what is the query that blows everything up)
Or if there's a known workaround for this, what is it ?
I already tried to DB::disableQueryLog(); within my start/artisan.php
Main issue is:
The PHP process is running out of memory, aka hitting the memory_limit set in your php.ini. The cause may be various, i.e infinite loops, large select statements; so to say: anything that requires PHP to store information in memory during processing.
My specific Issue & Solution:
I had this issue due to long running php processes, i.e Queue workers.
Solved it by setting up a cron job that does a php artisan queue:restart every 20 mins.
As the error message said, the error was about a certain database query. But I also asked how I could traceback the faulty query. I used an error tracking service called Rollbar to find out which API call died. Pretty sure it isn't the best way to figure this out but it worked...

Issue of Maximum time execution in get_tweet.php using Phirehose.php twitter Stream Library

I am searching on Twitter Streaming api from last day but not exactly get to know how to use it. Finally I found 140dev streaming API framework. For this I followed every instruction from 140dev.com instructions. But when I run get_tweets.php file it display me an error
Fatal error: Maximum execution time of 300 seconds exceeded in
D:\xampp\htdocs\twitter-streaming\libraries\phirehose\Phirehose.php on line 741
I searched a lot on this and also increase max_execution_time from php.ini file but still the same problem.

Categories