Skip to content
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

npm run dev picks up IPV6 address and fails with listen EINVAL on Fedora #812

Closed
sebastien opened this issue Feb 15, 2024 · 12 comments
Closed
Labels
bug Something isn’t working

Comments

@sebastien
Copy link

On Fedora 39, running npm run dev on a freshly created blank project:

npm run dev

> dev
> observable preview


Unexpected error: listen EINVAL: invalid argument XXX::XXXX:XXXX:XXXX:XXXX:3000

Tip: To see the full stack trace, run with the --debug flag.

If you think this is a bug, please file an issue at
↳ https://github.com/observablehq/framework/issues

where the argument is my laptop's IPv6 address instead of the IPv4.

Now trying to run npm run observablepreview --host=localhost --port=8000 also leads to the same error.

@sebastien sebastien added the bug Something isn’t working label Feb 15, 2024
@mythmon
Copy link
Member

mythmon commented Feb 16, 2024

@sebastien Could you run this with the --debug flag, to help pinpoint where the error is coming from?

Also, do you have any idea what is different about your system that is causing IPv6 there? I'm also on a Linux system, so maybe I could try and reproduce this, which would make things easier to fix.

@osgav
Copy link

osgav commented Feb 22, 2024

I have the same issue on an earlier version of Fedora. I haven't had any luck getting a stack trace to appear by adding --debug – I'm not sure where npm commands like this expect that flag, so I tried everywhere but I got the same message (as per sebastian above) each time.

Are there other debugging options we could try?

@mbostock
Copy link
Member

Was this fixed by #854?

@mythmon
Copy link
Member

mythmon commented Feb 22, 2024

I have the same issue on an earlier version of Fedora. I haven't had any luck getting a stack trace to appear by adding --debug – I'm not sure where npm commands like this expect that flag, so I tried everywhere but I got the same message (as per sebastian above) each time.

Are there other debugging options we could try?

When using npm run, to pass arguments to the underlying command instead of npm, you have to separate them with --. The full command you would need to run is

npm run dev -- --debug

@elevenchars
Copy link
Contributor

elevenchars commented Feb 23, 2024

I'm having the same issue (also on Fedora 39). Here's the output from npm run dev -- --debug:

[willi@fedora]~/code/hello-framework% npm run dev -- --debug

> dev
> observable preview --debug


Unexpected error: listen EINVAL: invalid argument fe80::xxxx:xxxx:xxxx:xxxx:xxxx
The full error follows

node:internal/errors:563
    ErrorCaptureStackTrace(err);
    ^

Error: listen EINVAL: invalid argument fe80::xxxx:xxxx:xxxx:xxxx:xxxx
    at __node_internal_captureLargerStackTrace (node:internal/errors:563:5)
    at __node_internal_uvExceptionWithHostPort (node:internal/errors:660:12)
    at Server.setupListenHandle [as _listen2] (node:net:1855:21)
    at listenInCluster (node:net:1920:12)
    at GetAddrInfoReqWrap.doListen [as callback] (node:net:2069:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:8) {
  code: 'EINVAL',
  errno: -22,
  syscall: 'listen',
  address: 'fe80::xxxx:xxxx:xxxx:xxxx',
  port: 3000
}

@Fil
Copy link
Contributor

Fil commented Feb 23, 2024

This upstream node issue seems relevant
nodejs/node#51732

@mbostock
Copy link
Member

I expect this has been fixed by #854; @elevenchars likely has a HOSTNAME environment variable set to an ipv6 address.

@cedricr
Copy link

cedricr commented Feb 23, 2024

I got the same problem with Fedora 39 with a brand new install; I can confirm that switching to
"@observablehq/framework": "observablehq/framework#6b1e943771dfb81e7eaf41dc96fa5e6b7be695ff", (that is, #854) as a dependency works, where as
"@observablehq/framework": "observablehq/framework#3f09fab3ea186531eddeda670b27233af1bc09ce", (the previous commit) won’t.
So, fixed for me!

@elevenchars
Copy link
Contributor

I expect this has been fixed by #854; @elevenchars likely has a HOSTNAME environment variable set to an ipv6 address.

My HOSTNAME variable is set to fedora. I suspect it's the upsteam issue @Fil linked since it is a link-local address.

@mbostock
Copy link
Member

mbostock commented Mar 4, 2024

Fixed in #854.

@mbostock mbostock closed this as completed Mar 4, 2024
@alabhyajindal
Copy link

Hi, I'm facing the same issue on Fedora, getting the same error as @elevenchars.

Can you help me understand how to get it to work?

@Fil
Copy link
Contributor

Fil commented Mar 4, 2024

@alabhyajindal either run the code from github or wait for the next release (which we plan to do this week)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

No branches or pull requests

8 participants