We get "the deployment failed while serving the request." back with next.js api randomly

PLEASE help us help you by writing a good post!

  • Site id: 3989e53a-b653-43ff-843d-d98de0c7c5ca
  • dns: propalt.io

We keep getting failed calling next.js api by message “the deployment failed while serving the request.“

It is happening randomly and not reliable.

What is happening and how should we do to fix this problem ?

Hi,

It would be more helpful if you can share function logs (from Netlify’s dashboard) for failed requests. For now you can check for possible causes, like the ones below:

  1. Next.js API routes on Netlify run as serverless functions, which may experience cold starts. If your API takes longer than 10 seconds (Netlify’s default timeout), it’ll fail. So you can try increasing the timeout in netlify.tml

  2. Netlify functions have memory constraints (e.g., 1GB on the free tier). Heavy processing can cause crashes. You can debug this by checking function logs in Netlify Dashboard > Functions for Out of Memory errors.

Hope this helps!

I’ve routed this request to our helpdesk, we’ll follow up via email.

1 Like

Hi Sid, Thank you very much forwarding the request to the helpdesk, I don’t suppose you know whether or not they have managed to take a look? We receive a lot more failed requests this morning resulting in an outage on our platform. If you have any further information that could help, please could you forward to Nontachai. Kind Regards, Rich

Hi @RichProp we followed up last week, could you check your spam to see if the message ended up there?