Hi!
Lately my builds started to fail. I’m deploying a nextjs project (latest version, latest netlify plugin).
Locally i can build the project fine, im using a strapi cms to get the data during build time. roughly 200 requests… not a lot. This is a full static export, so just getting the data from the CMS, building the pages, then deploy as is.
So locally it builds fine, then i can deploy it via netlify cli too. But on netlify i get weird fetch errors like during Generating static pages:
11:22:39 AM: TypeError: fetch failed
11:22:39 AM: at Object.fetch (node:internal/deps/undici/undici:11372:11) {
11:22:39 AM: cause: _SocketError: other side closed
11:22:39 AM: at Socket.onSocketEnd (node:internal/deps/undici/undici:7998:26)
11:22:39 AM: at Socket.emit (node:events:529:35)
11:22:39 AM: at endReadableNT (node:internal/streams/readable:1368:12)
11:22:39 AM: at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
11:22:39 AM: code: "UND_ERR_SOCKET",
11:22:39 AM: socket: {
11:22:39 AM: localAddress: "::1",
11:22:39 AM: localPort: 48700,
11:22:39 AM: remoteAddress: undefined,
11:22:39 AM: remotePort: undefined,
11:22:39 AM: remoteFamily: undefined,
11:22:39 AM: timeout: undefined,
11:22:39 AM: bytesWritten: 1574,
11:22:39 AM: bytesRead: 248
11:22:39 AM: }
11:22:39 AM: }
11:22:39 AM: }
or
11:22:53 AM: TypeError: fetch failed
11:22:53 AM: at Object.fetch (node:internal/deps/undici/undici:11372:11)
11:22:53 AM: at async globalThis.fetch (/opt/build/repo/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:111:13700)
11:22:53 AM: at async invokeRequest (/opt/build/repo/node_modules/next/dist/server/lib/server-ipc/invoke-request.js:17:12)
11:22:53 AM: at async invokeIpcMethod (/opt/build/repo/node_modules/next/dist/server/lib/server-ipc/request-utils.js:45:21)
11:22:53 AM: at async /opt/build/repo/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:111:17891 {
11:22:53 AM: cause: Error: read ECONNRESET
11:22:53 AM: at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
11:22:53 AM: at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
11:22:53 AM: errno: -104,
11:22:53 AM: code: "ECONNRESET",
11:22:53 AM: syscall: "read"
11:22:53 AM: }
11:22:53 AM: }
Then the build fails. Sometimes it does run though, but its like 1 out of 10 nowadays… tried deleting the build cache too, sometimes worked… but currently it just fails
Any ideas, suggestions how can i fix this? I can see strapi side the incoming requests, the log says all good with statuscode 200.
thanks a lot