Next.js Discord

Discord Forum

Page started returning 504 with 10s timeout, i cant find any log with error on vercel, works locally

Unanswered
Siamese posted this in #help-forum
Open in Discord
SiameseOP
i have a page which makes a rest call to service with my DB, the page used to work but then started returning 504 next day, no change or deployment, works locally, there is no detail in vercel log, even when i added additional logging to the ssr part of app still no logs on vercel except for the 504... pls help xd

9 Replies

Asian black bear
It just means your call to the service is timing out so it's something on your end where your backend doesn't respond in time for the function to execute.
So you'd have to check the runtime logs of the service you're attempting to fetch from.
SiameseOP
the service i am calling is turso sqllite db, i am on hobby plan there so no analytics, but there is no problem on their end as when i call them locally everything works... is it possible there is some kind of problem with routing on vercel side?
Asian black bear
It is technically possible, but highly unlikely. For debugging purposes you could attempt to adjust your code to have a racing promise to timeout your access to Turso after say 7500ms so that you can verify that it is indeed that particular line of code that is causing your timeout on Vercel.
SiameseOP
what i don't understand is why i see none of my console.log logs in vercel runtime logs for the 504 timeout calls, i put console.log at the very start of the problem ssr page (other pages work), am i missing something about logs vs vercel?
SiameseOP
ok, made a standalone docker build and deployed to google run, it works there... i guess i will just move there, ty anyways
Spectacled bear
Shot in the dark but have you uploaded the env variables to vercel? Could it be the it doesn't even connect to the db?
SiameseOP
it started working randomly on vercel as well with no change from my side... idk, i wouldn't mind if i had detailed logs to see what's exactly going on but this is not it
Spectacled bear
Ah, well then