Serverless functions randomly crashing
Unanswered
Hackberry nipple gall parasitoid posted this in #help-forum
Hackberry nipple gall parasitoidOP
I'm out of ideas trying to debug an issue with my NextJS app on vercel. It seems to happen at random on any api route. The client gets back an error 405 (not a status code we ever manually return, it must be NextJs returning that) and the logs just have some very generic errors. None of the log statements from inside the api route handlers is present in the logs. The only thing we get are a collection of log entries like this:
or like this
I did see one one time that mentioned that Node.js exited with signal 9: SIGKILL.
So far I have tried increasing the serverless memory limit, changing the next version and a whole bunch of logging. None of this has worked. It works fine always locally, this only happens in the vercel deployment. I'm out of ideas here.
FWIW, we are on next version 14.1.4 and node version 20 now.
Unhandled Rejection: TypeError: fetch failed
at node:internal/deps/undici/undici:12502:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async globalThis.fetch (/var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36091) {
[cause]: ConnectTimeoutError: Connect Timeout Error (attempted addresses: 76.76.21.93:443)
at onConnectTimeout (node:internal/deps/undici/undici:6635:28)
at node:internal/deps/undici/undici:6587:50
at Immediate._onImmediate (node:internal/deps/undici/undici:6619:13)
at process.processImmediate (node:internal/timers:478:21)
at process.callbackTrampoline (node:internal/async_hooks:130:17) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.or like this
FUNCTION_INVOCATION_FAILED: This Serverless Function has crashedI did see one one time that mentioned that Node.js exited with signal 9: SIGKILL.
So far I have tried increasing the serverless memory limit, changing the next version and a whole bunch of logging. None of this has worked. It works fine always locally, this only happens in the vercel deployment. I'm out of ideas here.
FWIW, we are on next version 14.1.4 and node version 20 now.