Tutorial Issue : Error occurred while proxying request localhost:8910/graphql to http://[::1]:8911/

I’m getting the following error if I simply

create the app, setup prisma, then scaffold the post then go to posts or posts/new.

I started w/ the tutorial, then just went to quick startup to get to the scaffolding bit fast. Two separate apps same outcome, so less likely I fuddled the code.

Edit: I’m on Arch Linux, nvm, yarn 3.2, node 16.3

(node:1028999) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
gen | (node:1029214) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
gen | (Use `node --trace-warnings ...` to show where the warning was created)
gen | Generating TypeScript definitions and GraphQL schemas...
gen | 28 files generated
web | (node:1029227) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
web | (Use `node --trace-warnings ...` to show where the warning was created)
api | (node:1029561) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
api | (Use `node --trace-warnings ...` to show where the warning was created)
api | Building... Took 304 ms
api | Debugger listening on ws://127.0.0.1:18911/107078fb-a8fc-4dbc-86bb-8805e36c3ff3
api | For help, see: https://nodejs.org/en/docs/inspector
web | assets by path static/js/*.js 4.44 MiB
web |   asset static/js/app.bundle.js 2.88 MiB [emitted] (name: app) 1 related asset
web |   asset static/js/src_pages_Post_PostsPage_PostsPage_tsx.chunk.js 458 KiB [emitted] 1 related asset
web |   asset static/js/src_pages_Post_PostPage_PostPage_tsx.chunk.js 456 KiB [emitted] 1 related asset
web |   asset static/js/src_pages_Post_EditPostPage_EditPostPage_tsx.chunk.js 319 KiB [emitted] 1 related asset
web |   asset static/js/src_pages_Post_NewPostPage_NewPostPage_tsx.chunk.js 318 KiB [emitted] 1 related asset
web |   asset static/js/runtime-app.bundle.js 48.9 KiB [emitted] (name: runtime-app) 1 related asset
web |   asset static/js/src_pages_NotFoundPage_NotFoundPage_tsx.chunk.js 3.38 KiB [emitted] 1 related asset
web | asset README.md 1.9 KiB [emitted] [from: public/README.md] [copied]
web | asset favicon.png 1.7 KiB [emitted] [from: public/favicon.png] [copied]
web | asset index.html 483 bytes [emitted]
web | asset robots.txt 24 bytes [emitted] [from: public/robots.txt] [copied]
web | Entrypoint app 2.93 MiB (2.89 MiB) = static/js/runtime-app.bundle.js 48.9 KiB static/js/app.bundle.js 2.88 MiB 2 auxiliary assets
web | orphan modules 408 KiB [orphan] 116 modules
web | runtime modules 32.8 KiB 17 modules
web | modules by path ../node_modules/ 2.76 MiB 830 modules
web | modules by path ./src/ 72 KiB
web |   modules by path ./src/components/Post/ 32.9 KiB 7 modules
web |   modules by path ./src/pages/ 10.3 KiB
web |     modules by path ./src/pages/Post/ 4.86 KiB 4 modules
web |     + 2 modules
web |   modules by path ./src/*.css 22.2 KiB
web |     ./src/scaffold.css 2.39 KiB [built] [code generated]
web |     + 3 modules
web |   modules by path ./src/*.tsx 4.47 KiB
web |     ./src/App.tsx 1.62 KiB [built] [code generated]
web |     ./src/Routes.tsx 2.85 KiB [built] [code generated]
web |   ./src/layouts/PostsLayout/PostsLayout.tsx 1.97 KiB [built] [code generated]
web | webpack 5.70.0 compiled successfully in 3344 ms
web | <e> [webpack-dev-server] [HPM] Error occurred while proxying request localhost:8910/graphql to http://[::1]:8911/ [EADDRNOTAVAIL] (https://nodejs.org/api/errors.html#errors_common_system_errors)
api | Starting API Server...
api | Loading server config from /home/patrick/dev/projects/mine/erp/rwblog/api/server.config.js
api |
api | Importing Server Functions...
api | /graphql 108 ms
api | (node:1030115) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
api | (Use `node --trace-warnings ...` to show where the warning was created)
api | ...Done importing in 110 ms
api | Took 140 ms
api | API listening on http://localhost:8911/
api | GraphQL endpoint at /graphql
api | 17:30:44 🌲 Server listening at http://[::]:8911
web | <e> [webpack-dev-server] [HPM] Error occurred while proxying request localhost:8910/graphql to http://[::1]:8911/ [EADDRNOTAVAIL] (https://nodejs.org/api/errors.html#errors_common_system_errors)
web | <e> [webpack-dev-server] [HPM] Error occurred while proxying request localhost:8910/graphql to http://[::1]:8911/ [EADDRNOTAVAIL] (https://nodejs.org/api/errors.html#errors_common_system_errors)

Hmm, I’ve never seen this before, but it seems strange that your browser is initiating an IPv6 [::1] request for the api port… I’ve only ever seen it use the same domain, like localhost, unless you override the value for apiUrl in redwood.toml.

What happens if you try to open http://localhost:8911/graphql in a browser?

I’m seeing’s this too, same context as OP. Tried overriding host in both the api and web sections of redwood.toml. Server log says it’s listening on [::]. Weird.

I’m going to try again on a different machine later.

I get taken to graphql playground.

I wonder if it could be some dirty ENV_VAR from my system breaking things.
Also haven’t rebooted in weeks, so might give that a try. It’s blocked docker before after upgrades and things.

yeah, I tried multiple different settings in the .toml file as well, including: localhost, 127.0.0.1, 0.0.0.0, blog.test (all .tests route to localhost via dnsmasq).

Hi @squarism and @patrickcurl – let’s see if we can help here.

Are you both on Linux? I have to admit, I haven’t tested on Linux, but Redwood does do CI on ubuntu for each PR:

image

Question:

  1. Might the port somehow be in use? Maybe from a dev process that didn’t clean up?
  2. Have you tried other ports? Maybe in a different range?
[web]
  title = "Redwood App"
  port = 8910
  apiUrl = "/.redwood/functions"
  includeEnvironmentVariables = []
[api]
  port = 8911
[browser]
  open = true

You can set the web and api ports in redwood.toml. And then restart.

Any luck?

Hi all! I believe the dev server does route API requests via ipv6 loopback [::1]. It may be possible that the ipv6 interface is unavailable for some reason?

Can you try running RWJS_DEV_API_URL="http://localhost" yarn rw dev and see if it fixes the issue?

3 Likes

That fixed it for me, thanks!

3 Likes

Same env fix worked here. Put this in my .env and /posts works. The ipv6 listening address in the server log (:evergreen_tree:Server listening) is not indicative I guess. Take it out, errors again. On mac. I have lo0 and en0 (what this would hit based on the routes) both with ipv6 addresses.

1 Like

This is really strange, @aguscha333 having the same problem, but after adding a field to the database and starting the dev server: dbAuth signup failure - #7 by aguscha333

this proposed fixed didn’t work for me

Just looked into the linked dbAuth thread. I see you’re seeing ECONNREFUSED, I think this workaround would help only with EADDRNOTAVAIL.