Server is regularly terminated with `Error: connect ECONNREFUSED :::8911`

I have a new redwood project running on rw 8.4.1.
I’ve got DB Auth, Mantine UI, and zustand but other than that, basically no other dependencies of note. I’m just running stock redwood cells, pages, components, etc.

Every 3 minutes or so of development I encounter this Error: connect ECONNREFUSED :::8911 error that kills the node server and I have to restart it manually. Any ideas what’s going on? I tried creating a new project and did not setup any auth or anything and still saw this error regularly.

I’ve been using rw since probably v4 and never encountered something like this before.

Any ideas? I’m not able to see anything helpful in these logs.

api | Server listening at http://[::]:8911/
api | Took 477 ms
api | API server listening at http://localhost:8911/
api | GraphQL endpoint at http://localhost:8911/graphql
api | 15:26:25 🌲 incoming request POST xxx /graphql
api | 15:26:25 🐛 Parsing request to extract GraphQL parameters
api | 15:26:25 🐛 Processing GraphQL Parameters
api | 15:26:25 🌲 Starting a postgresql pool with 25 connections.
api | 🗒 Custom
api | {
api |   "prisma": {
api |     "clientVersion": "5.20.0"
api |   },
api |   "timestamp": "2024-12-14T22:26:25.561Z",
api |   "target": "quaint::pooled"
api | }
api | 15:26:25 🐛 graphql-server GraphQL execution started: __REDWOOD__AUTH_GET_CURRENT_USER
api | 15:26:25 🌲 request completed 454ms
api | 15:26:25 🐛 graphql-server GraphQL execution completed: __REDWOOD__AUTH_GET_CURRENT_USER
api | 15:26:25 🐛 Processing GraphQL Parameters done.
api | API server did not exit within 2 seconds, forcefully closing it.
web | 3:26:27 PM [vite] http proxy error: /graphql
web | Error: connect ECONNREFUSED :::8911
web |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16)
web | 3:26:30 PM [vite] http proxy error: /auth?method=getToken
web | Error: connect ECONNREFUSED :::8911
web |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16)
web | 3:26:30 PM [vite] http proxy error: /graphql
web | Error: connect ECONNREFUSED :::8911
web |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16)

Update - i think it breaks the api server anytime a make a change to the code on the api side. Still can’t figure out why tho.

Hi @nathanmacfarlane, can you please try with the latest Canary version of RW and see if that solves your problem?

Same with 8.4.1. for me. 8.4.0 works

@mat Can you also please try with the latest canary release?

From a quick round of testing on 9.0.0-canary.284, I cannot reproduce the issue. So I think it’s fixed there. I’ll continue testing as I have more time in the coming weeks but wanted to follow up here.

Thank you. I’ll try to get a new release out of Redwood this week

1 Like

9.0.0-canary.284 works for me
Note that when using trusted documents there is a always a kill/respawn cycle of api when starting rw dev.
It seems rw gen overwrites/touch trustedDocumentsStore.ts even if there is no change and the file is not excluded from the hot reload list