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

Node inspector doesn't work: address already in use #202

Closed
shumkov opened this issue Feb 13, 2018 · 5 comments
Closed

Node inspector doesn't work: address already in use #202

shumkov opened this issue Feb 13, 2018 · 5 comments
Assignees

Comments

@shumkov
Copy link

shumkov commented Feb 13, 2018

Hello guys, thank you for your amazing work.

I use ipfsd-ctl for spawning IPFS instance in mocha test in a very similar way as in OrbitDb tests.
It's cool but it doesn't work with node inspector:

node_modules/.bin/mocha --inspect test/**/*.js

Debugger listening on ws://127.0.0.1:9229/7c0ad2d6-146b-4ae1-bf2c-7e9873c18304
For help see https://nodejs.org/en/docs/inspector


  Storage
    1) "before all" hook: before


  0 passing (33ms)
  1 failing

  1) Storage
       "before all" hook: before:
     Error: non-zero exit code 12

            while running: /Users/ivanshumkov/Projects/dashevo/dashdrive/node_modules/go-ipfs-dep/go-ipfs/ipfs init -b 2048


            Starting inspector on 127.0.0.1:9229 failed: address already in use

      at Stream.listeners.done.once (node_modules/ipfsd-ctl/src/exec.js:39:11)
      at Stream.f (node_modules/once/once.js:25:25)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

@dryajov
Copy link
Member

dryajov commented Feb 13, 2018

Unfortunately, thats a known (and annoying ) issue. debugging doesn't work with forked processes in nodejs - nodejs/node#9435

@shumkov
Copy link
Author

shumkov commented Feb 13, 2018

Ahh... Do you know any workarounds? Like this one askmike/gekko#1666?

@dryajov
Copy link
Member

dryajov commented Feb 15, 2018

@shumkov Interesting, thanks for pointing that one out - it's worth a try for sure. Would you feel comfortable sending a PR that fixes this?

@vmx
Copy link
Member

vmx commented Feb 16, 2018

I just ran into this issue and didn't know there was already one open. I'll do a PR soon.

@shumkov
Copy link
Author

shumkov commented Feb 16, 2018

@dryajov @vmx Seems I'm late :) Don't hesitate to ask my help if needed.

vmx added a commit that referenced this issue Feb 16, 2018
When running a script that involves `ipfsd-ctl` and you pass on
additional parameters it used to pass on those parameters to
the subprocesses it spaws. This lead to issues especially with
`--inspect-brk` as it would spawn another inspector which then
would fail because there is already one running on the same port.

Fixes #202.
@ghost ghost assigned vmx Feb 16, 2018
@ghost ghost added the status/in-progress In progress label Feb 16, 2018
@vmx vmx closed this as completed in #204 Feb 16, 2018
vmx added a commit that referenced this issue Feb 16, 2018
When running a script that involves `ipfsd-ctl` and you pass on
additional parameters it used to pass on those parameters to
the subprocesses it spaws. This lead to issues especially with
`--inspect-brk` as it would spawn another inspector which then
would fail because there is already one running on the same port.

Fixes #202.
@ghost ghost removed the status/in-progress In progress label Feb 16, 2018
dryajov pushed a commit that referenced this issue Feb 17, 2018
When running a script that involves `ipfsd-ctl` and you pass on
additional parameters it used to pass on those parameters to
the subprocesses it spaws. This lead to issues especially with
`--inspect-brk` as it would spawn another inspector which then
would fail because there is already one running on the same port.

Fixes #202.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants