[SOLVED] Redirect Error in Server Action on Docker (fetch failed)
Answered
Chien Français Tricolore posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Chien Français TricoloreOP
I have a server action that does a redirect (next/navigation)
It works successefully if I look at the browser(the user is successfully redirected), but in the server I get this console logged:
It's all deployed inside a docker, which also contains nginx. I hope this isn't causing any trouble.
It works successefully if I look at the browser(the user is successfully redirected), but in the server I get this console logged:
| failed to get redirect response TypeError: fetch failed
web | at node:internal/deps/undici/undici:13737:13
web | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
web | at async globalThis.fetch (/app/.next/server/chunks/137.js:11:171105)
web | at async rm (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:4292)
web | at async rg (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:741)
web | at async rz (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:24709)
web | at async doRender (/app/node_modules/next/dist/server/base-server.js:1394:30)
web | at async cacheEntry.responseCache.get.routeKind (/app/node_modules/next/dist/server/base-server.js:1555:28)
web | at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1463:28)
web | at async NextNodeServer.renderPageComponent (/app/node_modules/next/dist/server/base-server.js:1856:24) {
web | [cause]: Error: connect ECONNREFUSED 127.0.0.1:80
web | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1605:16)
web | at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
web | errno: -111,
web | code: 'ECONNREFUSED',
web | syscall: 'connect',
web | address: '127.0.0.1',
web | port: 80
web | }
web | }
It's all deployed inside a docker, which also contains nginx. I hope this isn't causing any trouble.
Answered by Chien Français Tricolore
Omg i am so happy. I think last canary version fixed this
14 Replies
![Avatar](https://cdn.discordapp.com/avatars/678259999201427466/a_54265510de155a7d7909e4d21d587a76.gif?size=256)
Clown
What next version? Also any fetch calls? Especially fetch your own api?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Chien Français TricoloreOP
No fetch calls at all, it just uses cookies().delete() too, which also is working successfully
The next version is 14.1.0
The next version is 14.1.0
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Chien Français TricoloreOP
I just wish I understood why its trying to connect to something on Port 80 since nextjs is running on port 3000 -_-
![Avatar](https://cdn.discordapp.com/avatars/678259999201427466/a_54265510de155a7d7909e4d21d587a76.gif?size=256)
Clown
Your http server runs on port 80
Maybe its related to not using https or something. Im not 100% sure
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Chien Français TricoloreOP
But what is it trying to connect to?
shouldn't it just give the response and thats it?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Chien Français TricoloreOP
this is the comment in the source code in the place the error is thrown
![Image](https://cdn.discordapp.com/attachments/1222566754396409966/1222588547848999062/image.png?ex=6616c350&is=66044e50&hm=05cabbe94e279ae9cca83bce8905804ccdaf0fee109c6d6a3907cb9d27668a91&)
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Chien Français TricoloreOP
Omg i am so happy. I think last canary version fixed this
Answer
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Chien Français TricoloreOP
I will be using canary version for now
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Chien Français TricoloreOP
Hmmm, actually it only fixed in 1 out of 2 cases 🤔 weird
better than nothing i guess
NVM the other case was literally my fault
so its all fixed now 💯 🔥![:ultrafast_parrot:](https://cdn.discordapp.com/emojis/767748059513094144.gif)
so its all fixed now 💯 🔥
![:ultrafast_parrot:](https://cdn.discordapp.com/emojis/767748059513094144.gif)
![:egp_giveaway:](https://cdn.discordapp.com/emojis/807614929658052618.gif)
![:egp_giveaway:](https://cdn.discordapp.com/emojis/807614929658052618.gif)
![:egp_giveaway:](https://cdn.discordapp.com/emojis/807614929658052618.gif)