#Please HELP

19 messages · Page 1 of 1 (latest)

noble patio
#

Link to the code that reproduces this issue
https://github.com/space1worm/serverless-timeout-test

Hey everyone,

Next.js version : 13.5.3
Dir: App Directory

Do you have any ideas about why Vercel is returning a 504 error? I'm on the pro plan, and my serverless function is configured to run for a maximum of 5 minutes. my function for testing purposes needs 1.5m to execute.

In the logs, I can see that the serverless function is returning a 200 status code, and it's executing correctly. However, when I access it through postman, after exactly 1 minute, it returns a 504 error.

Everything works fine locally. What could be the issue?

Here is step by step description how to reproduce:
Go to -> https://test-liart-seven-84.vercel.app/
Click -> 'click to fetch' button

Expected behaviour -> after 1m30s you should see 'Hello World' text
Current behaviour -> Returns 504 Gateway Timeout Error

GitHub

Contribute to space1worm/serverless-timeout-test development by creating an account on GitHub.

dry falconBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

noble patio
steel hare
#

Check if the browser console or the logs are giving you more information

#

Ohhh btw shouldn't it be "api/hello.ts"

#

In the function config

#

Also i dont think you need to specifically set the maxDuration, it should probably automatically set it to 300s if you were on Pro when you created project

noble patio
#

No it should be full path to the file, otherwise it throws build error

#

Also browser console doesn’t give me any info at all

noble patio
steel hare
#

Btw try doing

export const maxDuration = 300

In your route handler as well

noble patio
#

Yes I have tried that as well

#

The thing is I can confirm that maxDuration is 5m and also the function is wxecuted because I see logs which tells me that status is 200 BUt i het in browser gateway timeout which is very odd

#

I have opened issue on this matter

#

In vercel/nextjs

#

There is also discussion about this, some people are experiencing same issue

obtuse thicket
#

Having pretty much the same issue here... maxDuration not being honored, and getting a 504.
Have you had any luck here @noble patio ?