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

Inspect debug> restart There was an internal error in node-inspect. ECONNRESET Error: read ECONNRESET #37224

Closed
YATINDRA-07 opened this issue Feb 4, 2021 · 19 comments
Labels
inspector Issues and PRs related to the V8 inspector protocol

Comments

@YATINDRA-07
Copy link

YATINDRA-07 commented Feb 4, 2021

  • Version: 15.2.0
  • Platform:Microsoft Windows NT 10.0.19041.0 x64
  • Subsystem:

What steps will reproduce the bug?

Whenever I use debugger and inspect option and after completing the debug in chrome, then giving restart command in vs code terminal here :
debug> restart

How often does it reproduce? Is there a required condition?

Every time when I enter restart in debug > screen

What is the expected behavior?

Restart the inspect/debugger in chrome

What do you see instead?

debug> restart
There was an internal error in node-inspect. Please report this bug.
read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:213:20)
    at TCP.callbackTrampoline (node:internal/async_hooks:129:14)

Additional information

@YATINDRA-07 YATINDRA-07 changed the title Inspect debug> restart There was an internal error in node-inspect. Please report this bug. read ECONNRESET Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:213:20) at TCP.callbackTrampoline (node:internal/async_hooks:129:14) Inspect debug> restart There was an internal error in node-inspect. ECONNRESET Error: read ECONNRESET Feb 4, 2021
@PoojaDurgad PoojaDurgad added the inspector Issues and PRs related to the V8 inspector protocol label Feb 9, 2021
@picklit
Copy link

picklit commented Feb 20, 2021

I'm experiencing the same issue
node v15.5.1
Windows 10 Pro 20H2

There was an internal error in node-inspect. Please report this bug.
read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:213:20)
    at TCP.callbackTrampoline (node:internal/async_hooks:131:14)

@MattLusher
Copy link

MattLusher commented Mar 22, 2021

Same here.
node v15.0.1
Windows 10 Enterprise v1809

debug> restart
There was an internal error in node-inspect. Please report this bug.
read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:213:20)
    at TCP.callbackTrampoline (node:internal/async_hooks:129:14)

@Trott
Copy link
Member

Trott commented Apr 12, 2021

Is anyone able to confirm that this bug also happens with Node.js 15.0.0? And that it isn't there with Node.js 14.x?

@Trott
Copy link
Member

Trott commented Apr 12, 2021

Is anyone able to test with Node.js 14.5.0 and/or Node.js 14.4.0? 14.4.0 has node-inspect 1.x and 14.5.0 is the first version with node-inspect 2.0.0.

@eritbh
Copy link

eritbh commented Apr 15, 2021

Is anyone able to confirm that this bug also happens with Node.js 15.0.0? And that it isn't there with Node.js 14.x?

Confirmed not working on 15.0.0:

Microsoft Windows [Version 10.0.19041.928]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Erin>node --version
v15.0.0

C:\Users\Erin>node inspect test.js
< Debugger listening on ws://127.0.0.1:9229/4feaf157-29ea-4552-bc83-7259da
< 104fe9
< For help, see: https://nodejs.org/en/docs/inspector
< Debugger attached.
Break on start in test.js:1
> 1 let a = 1;
  2 a += 1;
  3 module.exports = a;
debug> restart
There was an internal error in node-inspect. Please report this bug.
read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:213:20)
    at TCP.callbackTrampoline (node:internal/async_hooks:129:14)

Is anyone able to test with Node.js 14.5.0 and/or Node.js 14.4.0? 14.4.0 has node-inspect 1.x and 14.5.0 is the first version with node-inspect 2.0.0.

14.4.0 seems like it's not working for an unrelated reason for me, so unable to confirm:

C:\Users\Erin>node --version
v14.4.0

C:\Users\Erin>node inspect test.js
Timeout (2000) waiting for 127.0.0.1:9229 to be free

14.5.0 appears to be working as intended:

C:\Users\Erin>node --version
v14.5.0

C:\Users\Erin>node inspect test.js
< Debugger listening on ws://127.0.0
< .1:9229/0df96a4b-f0d2-46f3-b975-52de39d64849
< For help, see: https://nodejs.org/en/docs/inspector
< Debugger attached.
Break on start in test.js:1
> 1 let a = 1;
  2 a += 1;
  3 module.exports = a;
debug> restart
< Debugger listening on ws://127.0.0.1:9229/0df96a4b-f0d2-46f3-b975-52de39d64849
< For help, see: https://nodejs.org/en/docs/inspe
debug> (node:8416) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
< Debugger listening on ws://127.0.0.1:9229/5337b1a4-e816-4ce9-b9df-8f5de3163c67
< For help, see: https://nodejs.org/en/docs/inspector
< Debugger attached.
Break on start in test.js:1
> 1 let a = 1;
  2 a += 1;
  3 module.exports = a;
debug>

@eiymba
Copy link

eiymba commented Apr 15, 2021

Inspector broken in node version 15 on windows

@Trott
Copy link
Member

Trott commented Apr 15, 2021

@eritbh @eiymba Working in 14.5.0 was definitely not the result I was expecting so that's a huge help. Thank you!

@Trott
Copy link
Member

Trott commented Apr 16, 2021

Bisecting on CI indicates 28e6626 introduced this problem.

  • 28e6626 was introduced in 15.0.0, so that's consistent with all 15.x versions showing this problem.

  • 28e6626 was introduced in 14.x as b634d4b, which first showed up in 14.3..0. Tests above indicate this bug is in 14.4.0 and disappears again in 14.5.0. Sure enough, the changelog for 14.5.0 shows that b634d4b was reverted. The revert ended up landing in 14.x as 7fdb507. So that explains why 14.5.0 started working again.

@Trott
Copy link
Member

Trott commented Apr 16, 2021

@ronag Do you have any idea what might be the cause of this? Or the correct fix? I imagine that somewhere deps/node-inspect needs modification and not the underlying core streams, but I'm having a hard time figuring out exactly what is going on. (It's a Windows-only problem which isn't helping me, unfortunately.)

@Trott
Copy link
Member

Trott commented Apr 16, 2021

Guess I'll ping @jkrems too in case he has any insight from the node-inspect side.

@eiymba
Copy link

eiymba commented Apr 16, 2021

You can DM on twitter and we can sit down together and pair program it. Download liveshare VS code extension and I'll give you access to my terminal so you have a Windows environment to work with.

@jkrems
Copy link
Contributor

jkrems commented Apr 16, 2021

I have no good theory here. The reset of the TCP connection makes sense on restart but afaict we pretty consistently attach error handlers to the HTTP requests and responses in inspect_client.js. There is a single httpRes without an error handler. I'm not sure if attaching a noop error handler there is enough to fix this?

P.S.: I don't understand though why the commit linked above would cause more ECONNRESET errors and/or why those errors would only happen on a specific platform.

@Trott
Copy link
Member

Trott commented Apr 17, 2021

@nodejs/platform-windows Any ideas how to debug this or what the cause might be? Maybe something to do with the way stdio on Windows is handled differently than on POSIX (buffering and so forth)?

@Trott
Copy link
Member

Trott commented Apr 17, 2021

Might be related that on Windows, output seems interleaved in the inspector but on POSIX it is not....

@Trott
Copy link
Member

Trott commented Apr 18, 2021

Looks like Windows communicates with the debugger via TCP socket (where the ECONNRESET is happening) while POSIX uses a pipe.

Whoops, I think that's wrong.

Trott added a commit to Trott/io.js that referenced this issue Apr 20, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 20, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 20, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 20, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 21, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 21, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 21, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 21, 2021
@Trott
Copy link
Member

Trott commented Apr 21, 2021

Happy to report that I (finally) figured out the correct fix for this and will include it in #38161 which I hope to get in the next 16.x release. (There's one more Windows bug I need to track down and fix.)

Trott added a commit to Trott/io.js that referenced this issue Apr 21, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 21, 2021
@eiymba
Copy link

eiymba commented Apr 21, 2021

awesome. I'll pull your PR and test. Thank you for your tireless efforts!

@eiymba
Copy link

eiymba commented Apr 21, 2021

Inspector working

Looks to be working, but I think it restarts multiple times?

Trott added a commit to Trott/io.js that referenced this issue Apr 21, 2021
@Trott
Copy link
Member

Trott commented Apr 21, 2021

Looks to be working, but I think it restarts multiple times?

Thanks for testing! Yeah, it does the double-restart on POSIX too. I've made a note to track that down and fix it (if no one beats me to it). There are a number of small fixes to be made in the inspector, all of which should be easier to maintain once it's integrated in core and the tests are running in our CI.

Trott added a commit to Trott/io.js that referenced this issue Apr 22, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 23, 2021
Trott added a commit to Trott/io.js that referenced this issue Apr 24, 2021
@Trott Trott closed this as completed in b0713b4 Apr 25, 2021
targos pushed a commit that referenced this issue Apr 29, 2021
Fixes: #37224

PR-URL: #38161
Refs: #36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Trott added a commit to Trott/io.js that referenced this issue May 30, 2021
Fixes: nodejs#37224

PR-URL: nodejs#38161
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Trott added a commit to Trott/io.js that referenced this issue May 30, 2021
Fixes: nodejs#37224

PR-URL: nodejs#38161
Backport-PR-URL: nodejs#38858
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Trott added a commit to Trott/io.js that referenced this issue Jun 1, 2021
Fixes: nodejs#37224

PR-URL: nodejs#38161
Backport-PR-URL: nodejs#38858
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
targos pushed a commit to Trott/io.js that referenced this issue Jun 5, 2021
Fixes: nodejs#37224

PR-URL: nodejs#38161
Backport-PR-URL: nodejs#38858
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
targos pushed a commit to Trott/io.js that referenced this issue Jun 6, 2021
Fixes: nodejs#37224

PR-URL: nodejs#38161
Backport-PR-URL: nodejs#38858
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
targos pushed a commit to Trott/io.js that referenced this issue Jun 6, 2021
Fixes: nodejs#37224

PR-URL: nodejs#38161
Backport-PR-URL: nodejs#38858
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Trott added a commit to Trott/io.js that referenced this issue Jul 15, 2021
Fixes: nodejs#37224

PR-URL: nodejs#38161
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Trott added a commit to Trott/io.js that referenced this issue Jul 15, 2021
Fixes: nodejs#37224

PR-URL: nodejs#38161
Backport-PR-URL: nodejs#38858
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
richardlau pushed a commit that referenced this issue Jul 16, 2021
Fixes: #37224

PR-URL: #38161
Backport-PR-URL: #38858
Refs: #36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
richardlau pushed a commit that referenced this issue Jul 20, 2021
Fixes: #37224

PR-URL: #38161
Backport-PR-URL: #38858
Refs: #36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
foxxyz pushed a commit to foxxyz/node that referenced this issue Oct 18, 2021
Fixes: nodejs#37224

PR-URL: nodejs#38161
Backport-PR-URL: nodejs#38858
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

No branches or pull requests

8 participants