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

1 Like

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

I had the same issue. I was using NVM and turns out that my default node version does not meet the prerequisites.

I had the same issue today, but only when I had expressvpn enabled. Disconnecting the VPN fixed it.

Node version was also the issue for me.

  System:
    OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 18.12.1 - /tmp/xfs-5a3e579b/node
    Yarn: 3.2.3 - /tmp/xfs-5a3e579b/yarn
  Browsers:
    Firefox: 107.0
  npmPackages:
    @redwoodjs/core: ^3.7.1 => 3.7.1 

It turned out to be evil VS Code messing with my node. This was despite:

  • Seeing the correct value from nvm ls (very spooky :ghost:)
  • No warning from redwood during startup

Here’s what fixed it from me using node.js - Visual Studio Code to use node version specified by NVM - Stack Overflow

nvm alias default 16.19.0
# Then restart the IDE

I wish Atom, the open source community maintained editor, didn’t get killed by megacorp

1 Like

I have similar issue but with [ECONNREFUSED],

I have tried
RWJS_DEV_API_URL
and checked node, yarn versions

web | [webpack-dev-server] [HPM] Error occurred while proxying request localhost:8910/graphql to http://localhost:8911/ [ECONNREFUSED] (https: //nod ejs.o rg/api/errors.html#er rors_co mmon_system_errors)

I’m on Windows
node v16.13.1
yarn 3.3.1

and following Redwood tutorial:

I got it to work suddenly without explanation.

In my case the issue appears when api side is not properly compiled. The error should be visible bit earlier in the logs.

I was having this issue and found that I was running the wrong yarn and node versions. Now using .yvmrc and .nvmrc with correct versions in them. :+1:

I found this issue when I replaced my DB:

Using
DATABASE_URL=postgres://postgres:password1@postgres-local.XXXXX.us-east-1.rds.amazonaws.com:5432/mydb?connection_limit=1

works fine, but when I changed to a new DB instance

DATABASE_URL=postgres://postgres:password1@postgres-local.YYYYY.us-east-1.rds.amazonaws.com:5432/mydb?connection_limit=1

failed. I don’t have idea why.