Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Infinite loop failed to forward action response error #77568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Abdubek opened this issue Mar 28, 2025 · 2 comments
Open

Infinite loop failed to forward action response error #77568

Abdubek opened this issue Mar 28, 2025 · 2 comments
Labels
Middleware Related to Next.js Middleware. Server Actions Related to Server Actions.

Comments

@Abdubek
Copy link

Abdubek commented Mar 28, 2025

Link to the code that reproduces this issue

https://github.com/recokz/app

To Reproduce

I didn't find a stable and precise way to reproduce the error.
But the error always occurs when the user interacts with the application.
The error occurs both in dev mode and in production.

Current vs. Expected behavior

I noticed a lot of errors with the POST request that returns a 404 error, then the error failed to forward action response appears, which does not stop until I restart the application.
I will attach screenshots of the logs below:

Image

Image

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 20.10.0
  npm: 10.2.3
  Yarn: 1.22.21
  pnpm: 9.4.0
Relevant Packages:
  next: 15.2.3 // There is a newer version (15.2.4) available, upgrade recommended! 
  eslint-config-next: 15.1.7
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.3
Next.js Config:
  output: standalone
 ⚠ There is a newer version (15.2.4) available, upgrade recommended! 
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Which area(s) are affected? (Select all that apply)

Middleware, Server Actions

Which stage(s) are affected? (Select all that apply)

next start (local), next dev (local)

Additional context

No response

@github-actions github-actions bot added Middleware Related to Next.js Middleware. Server Actions Related to Server Actions. labels Mar 28, 2025
@LosTigeros
Copy link

I'm at v15.2.4
I have the same issue in prod at a rate of ~265 error logs per second.
They're all:

failed to forward action response
TypeError: fetch failed
    at node:internal/deps/undici/undici:13502:13
    at async tN (/service/webapp/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:127:10147)
    at async tL (/service/webapp/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:127:14254)
    at async r0 (/service/webapp/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:133:16292)
    at async doRender (/service/webapp/node_modules/next/dist/server/base-server.js:1650:34)
    at async NextNodeServer.renderToResponseWithComponentsImpl (/service/webapp/node_modules/next/dist/server/base-server.js:1915:28)
    at async NextNodeServer.renderErrorToResponseImpl (/service/webapp/node_modules/next/dist/server/base-server.js:2660:24)
    at async pipe.req.req (/service/webapp/node_modules/next/dist/server/base-server.js:2526:30)
    at async NextNodeServer.pipeImpl (/service/webapp/node_modules/next/dist/server/base-server.js:1003:25)
    at async invokeRender (/service/webapp/node_modules/next/dist/server/lib/router-server.js:235:21)
caused by: HeadersTimeoutError: Headers Timeout Error
    at FastTimer.onParserTimeout [as _onTimeout] (node:internal/deps/undici/undici:6249:32)
    at Timeout.onTick [as _onTimeout] (node:internal/deps/undici/undici:2210:17)
    at listOnTimeout (node:internal/timers:581:17)
    at process.processTimers (node:internal/timers:519:7)

or:

fetch failed: connect ECONNREFUSED 10.0.252.64:80
TypeError: fetch failed
    at node:internal/deps/undici/undici:13502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async tN (/service/webapp/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:127:10147)
    at async tL (/service/webapp/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:127:14254)
    at async r0 (/service/webapp/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:133:16292)
    at async doRender (/service/webapp/node_modules/next/dist/server/base-server.js:1650:34)
    at async NextNodeServer.renderToResponseWithComponentsImpl (/service/webapp/node_modules/next/dist/server/base-server.js:1915:28)
    at async NextNodeServer.renderErrorToResponseImpl (/service/webapp/node_modules/next/dist/server/base-server.js:2660:24)
    at async pipe.req.req (/service/webapp/node_modules/next/dist/server/base-server.js:2526:30)
    at async NextNodeServer.pipeImpl (/service/webapp/node_modules/next/dist/server/base-server.js:1003:25)
caused by: Error: connect ECONNREFUSED 10.0.252.64:80
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16)
    at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)

Recently I upgraded from v14.1.0, didn't have this issue before. It slows down the service to the point, that my health checks fail.

@SupraSmooth
Copy link

Chasing the same error for some weeks now, the error is thrown somewhere in the nextjs core. I find that really hard to debug since the origin of the ServerAction calls is not really traceable. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Middleware Related to Next.js Middleware. Server Actions Related to Server Actions.
Projects
None yet
Development

No branches or pull requests

3 participants