NextJS 13 returns fetch failed with UND_ERR_CONNECT_TIMEOUT after running in production mode for a day #57384
Replies: 19 comments 24 replies
-
Next.js 14 removes undici. Try upgrading. |
Beta Was this translation helpful? Give feedback.
-
Hi, My Next.js version 14.2.3 and Node v20.11.1 but still getting the error,
|
Beta Was this translation helpful? Give feedback.
-
Me too. We are using Vercel, in the logs I see that some request go through without errors. Others have one or two of these "next": "14.1.2"
|
Beta Was this translation helpful? Give feedback.
-
getting same issue during
|
Beta Was this translation helpful? Give feedback.
-
We're running nextjs 14.1.3, Vercel Node 18, and randomly getting this error on some api calls (trpc). It seems that subsequent requests are ok on that same endpoint. |
Beta Was this translation helpful? Give feedback.
-
i have same issue with my next14 |
Beta Was this translation helpful? Give feedback.
-
I am getting this locally randomly when trying to run next.js usin 14.1.4 and node v18.17.1 |
Beta Was this translation helpful? Give feedback.
-
randomly getting this in production while fetching mailchimp transactional from a serverless function. maxDuration set to 300 so it's not that
using next 14.0.4 |
Beta Was this translation helpful? Give feedback.
-
This discussion have been rolling for almost a year now and I am just wondering why have no one raised an issue for this yet. |
Beta Was this translation helpful? Give feedback.
-
I am also getting a bunch of undici errors as well recently. These are the 3 main ones "next": "^14.2.3",
|
Beta Was this translation helpful? Give feedback.
-
Since a few days getting very similar, also undici:
both locally and in prod on Vercel. Sometimes after deleting .next and rebuilding the first request goes through but subsequent fail. Somehow prod seems more stable, locally happens all the time. tried upgrading |
Beta Was this translation helpful? Give feedback.
-
is there a solution for this? i get the same error with node 21 and next |
Beta Was this translation helpful? Give feedback.
-
I get the same error with node v21.7.3 and next v14.2.4.
|
Beta Was this translation helpful? Give feedback.
-
The same situation. Couple of hours ago Nextjs app in Docker container stopped funtioning normally.
Note that container was up almost 2 weeks and had no issue. I tried to restart Container, and it does not helped, then restarted NGINx. Updated OS itself (Ubuntu) and restarted, but that doesn't helped either. |
Beta Was this translation helpful? Give feedback.
-
This is still an issue for us. Considering moving away from Vercel at this point. |
Beta Was this translation helpful? Give feedback.
-
same here [cause]: ConnectTimeoutError: Connect Timeout Error Node v20.15.0 |
Beta Was this translation helpful? Give feedback.
-
Hey guys So I've resolved my issue by creating this small script and attaching that to the next build (ofc install undici beforehand)
and attaching it to the build in package.json |
Beta Was this translation helpful? Give feedback.
-
I faced this issue while i was working on a slack slash commands API, vercel provides a waitUntil feature which immediately close the response but the waitUntil request can proceed. https://vercel.com/docs/functions/functions-api-reference#waituntil |
Beta Was this translation helpful? Give feedback.
-
Summary
Environment
next 13.4
node 18.16.0
running with pm2
Problem
Sometimes nextjs freezes and stop responding. (on production mode, we found that after running for 23 hours)
it returns 500 Internal Server Error on browser, and UND_ERR_CONNECT_TIMEOUT on server.
for me, it does not look like memory leak problem because pm2 says it uses memory under 100MB
When this happens, even pm2 does not restart automatically. it detects nextjs as status: online
Check additional information for detailed server error
is there someone who have same problem? or any workaround on this?
I can't post code because it is already too big code bases and security issue
Additional information
detailed error
environment
Beta Was this translation helpful? Give feedback.
All reactions