-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Chrome DevTools not able to connect to Node inspect since 7.5.0 #11591
Comments
/cc @nodejs/v8-inspector |
I've also seen this. Debugging seems to work locally but not remotely. This also affects |
I suspect #9691 is responsible. It harmonizes option parsing with the old debugger but it presumably changed the default from 0.0.0.0 to 127.0.0.1 (although I'm 80% sure that was the default for I'd say it's a good thing, security-wise. You can opt-out with |
Sounds like the debug port is bound to localhost by default now, since opening it to remote connections allows remote attackers unfettered access, but I don't see signs of this in the changelog. But there should be a way to change the default if its explicitly wanted. @ofrobots, do you know anything about this? |
@sam-github |
My comments and Ben's crossed on the wire. It was an unexpected change in how node behaves, it should have been documented. Experimental doesn't mean "we don't tell you when we changed it, post a github issue if you'd like to know more". I don't think it means "we reserve the right to make breaking changes in minor updates" either. cc: @Trott I think the change to default to localhost is a good one, but I'm not sure it should have happened before 8.x (though security fixes are allowed to majors even when breaking, the CTC has the power to give them special exemptions). Btw, something is wrong here: https://github.com/nodejs/node/pull/9691/files shows zero changes in the diff, and no commits, but also says its merged. I haven't seen that before in github, it sure makes it hard to review the PR retroactively to see what was merged. @eugeneo any idea what is going on with the PR? |
I can confirm |
@eugeneo can you PR some docs for the current state, something saying what address is listened on by default? |
While the I've tried variants of passing If someone has figured out a proper set of steps to use |
I don't think remote debugging was tested enough. I am assigning this over to me - I see issues like json/list returning 0.0.0.0 as a host name (should be detected), I also expect other similar problems. |
I also experience issues with |
It sounds like an unintended semver-major occurred between 7.4 .and 7.5, should it be reverted? @nodejs/ctc Change was:
Which is particularly problematic because there seems to be a (unrelated?) bug in the inspect option:
|
I performed some tests and the only issues I've seen had been caused by the code returning wrong IP addresses in the JSON responses - that was just fixed. I believe this can be closed now. |
Hi there, fixed. It works with latest versions 7.5+. |
JSON target list response will now return appropriate IP address for instances listening on 0.0.0.0. Refs: nodejs#11591 PR-URL: nodejs#11755 Reviewed-By: James Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This is still a rather annoying change. It would have been nice to just another parameter like --inspect-insecure or something... there's already a hash in the URL to protect against hijacking. |
I was using node app inside docker. I was unable to dubug it in Chrome dev tools. Later I found that, I have to change syntax. FROM
TO
Now debug is working. |
This works for me @nsisodiya. Thanks |
Took a while to get this working. Docker Compose
Make sure to publish ports, otherwise connection refused: Verified using "localhost" instead of 0.0.0.0, but
On Chrome:
I'm using the Node.js V8 --inspector Manager (NiM) Chrome plugin as well to get to the chrome-devtools address. |
i have node 7.4.0 and i am using mac. As I am starting node server in debug mode node --debug server.js The server starts successfully by giving message as Debugger listening on 127.0.0.1:5858 but my chrome not able to load 127.0.0.1:5858. Any workaround for this.? |
@sheetaldubey |
Thanks @nsisodiya |
To debug a node.js service in a docker stack from the Chrome DevTools locally you need to configure
That's all...chrome://inspect will be able to detect the listening debugger as usual.
|
How can I activate remote debugging it on an already running process when I activate the debug protocol by using |
@bnoordhuis Dude, you saved me!!! I spent 3 hours trying to figure out why my inspectors wouldn't work. I knew it had mostly to do with me running via docker. But the bind to 0.0.0.0 solved it!!!! You rock! |
Can't debug live. I use
Chrome 63.0.3239.108 (Official Build) (64-bit) |
Got this working. In package.json:
Then run and on my local box, go to node-inspector:
add (via configure) the remote device:
Save it, and the remote target list should give you a connection link. Click it and you're good to go. |
Oh My Lord @bnoordhuis, I try node --inspect-brk xx.js for 4days' debugging without any work. |
I am using puppeteer to launch headless chrome. The problem with me is that I can't use a static port. |
- This is required due to a change in node, [see here](nodejs/node#11591). - Also adds a new -K argument (inspect-brk). - Updated README and help text to explain new/updated arguments.
Current setup is a VM hosted on VMWare using NAT and port 9229 forwarded from VM to host. node --inspect-brk=0.0.0.0:9229 sample_debug.js thanks to @bnoordhuis @nsisodiya |
use node inspect ./index.js in node 12. it works |
When I run a script with
--inspect
, I am no longer able to connect via Chrome DevTools since Node 7.5.0. When I attempt to connect I get "Debugging connection was closed. Reason: WebSocket disconnected Reconnect when ready by reopening DevTools" Clicking reconnect DevTools does not reconnect."Simple script:
If I perform those steps on Node 7.4.0, it works. If I do the same steps in Node 7.5.0 or 7.6.0, the URL will no longer connect. I have the same results if I utilize Chrome 56.0.2924.87 or Canary 58.0.3025.0 on Windows.
I've recorded a screencast showing the steps to recreate and it functioning on 7.4.0 and failing on 7.6.0: https://www.screencast.com/t/vFyha8YI5
The text was updated successfully, but these errors were encountered: