Filament / Supabase - problem :(
Hi all, I am tinkering with Filament - loving its power - and I'm using Postgres as the DB (actually Supabase). Everything was going swimmingly until today when a particular query (that has been executed many, many times) appears to be timing out - now, to be clear, I am tracing the SQL commands issued and these are written to storage/logs/laravel.log so I can the exact query being executed and if I copy & paste the query in pgAdmin or the Supabase SQL client in the browser, the query completes in 1 second. But within my Laravel environment I see reported
Symfony\ Component\ ErrorHandler\ Error\ FatalError
Maximum execution time of 60 seconds exceeded
So I'm really confused - the SQL is good, the server will respond in 1 second, so what's causing the timeout? It was all working perfectly (and I literally did not change a thing, honest guv) when it hung for the first time. Other queries being executed against the Supabase backend by the Laravel app are working fine.
12 Replies
Please share your complete error with flare url.
Timeout 60sec means PHP is excuting someting that takes longer than 60 seconds.
The question is, what function or sript are you running when this apears?
Hi - not sure what a "flare url" is - I'm a a bit of a newbie. The function is this:
It's pretty much a default function generated by filament commands
php artisan code:models --table=stage_objects
php artisan make:filament-resource StageObject --generate
It's going to create a "table" view of the records in the table (24,000 of them so quite large)
When I say "pretty much" I changed a couple of column headings from the defaults and the sortable() property.
The odd thing is that it was working one minute and the next - boom - timeout - and nothing apparent changed, I was literally navigating around the app.
What is the stack trace of the error?
Because
php artisan make:filament-resource StageObject --generate
this normally wont break your complete application.
And does the StageObjectResource exsists? if so, what happens is you delete this resource?So the execution of the "php artisan make:filament-resource StageObject --generate" command didn't break the application - it gave me the CRUD features on the "stage_objects" table. And these CRUD features were working perfectly fine. Here is the Laravel SQL report
It's the final query that (appears to) never completes. But as I said, it actually takes around 1 second so I'm not convinced that the query per se is the problem. Not sure how I would access the "stack trace" - is this it?
Click the “share” link in the top right and paste the url here.
OK - thanks forr the tip - here it is: https://flareapp.io/share/67OWREk7#stack
Flare
Maximum execution time of 60 seconds exceeded - The error occurred at http://108.61.196.39:8000/admin/stage-objects
The problem seems to have gone away - without me modifying code - which is a concern. I had bounced the Supabase instance (before I posted this issue here) when I first hit this problem in case there was some kind of blocking session - which didn't solve it. But today it's working as before. I had also stopped and started the http server (using php artisan serve) beforehand in case there was something in there that was "stuck". So - now I don't know why it is working again (which isn't ideal as I'm bound to hit the same issue again)... any thoughts anyone?
I would check with supabase too. Seeing as how it is a remote db it’s possible the requests could have been throttled / rate limited from their side
I think that's where I'd logically take the investigation - I had a look at all of the available logs there that I could find and nothing appeared awry. Thanks to all of you who contributed to this thread.