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

Error [ERR_INTERNAL_ASSERTION] with autoSelectFamily enabled #46669

Closed
marcopdonoso opened this issue Feb 15, 2023 · 11 comments · Fixed by #46587
Closed

Error [ERR_INTERNAL_ASSERTION] with autoSelectFamily enabled #46669

marcopdonoso opened this issue Feb 15, 2023 · 11 comments · Fixed by #46587
Labels
confirmed-bug Issues with confirmed bugs. net Issues and PRs related to the net subsystem.

Comments

@marcopdonoso
Copy link

marcopdonoso commented Feb 15, 2023

Version

Node.js v19.6.0

Platform

Darwin MacBook-Pro-de-Marco.local 22.3.0 Darwin Kernel Version 22.3.0: Thu Jan 5 20:48:54 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

Just connect to the mongod using mongosh, and after a while the console shows the Error maessage and stop the process.

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

Every time

What is the expected behavior?

Normal using

What do you see instead?

node:internal/assert:14
    throw new ERR_INTERNAL_ASSERTION(message);
    ^

Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at new NodeError (node:internal/errors:399:5)
    at assert (node:internal/assert:14:11)
    at internalConnectMultiple (node:net:1070:3)
    at Timeout.internalConnectMultipleTimeout (node:net:1565:3)
    at listOnTimeout (node:internal/timers:570:11)
    at process.processTimers (node:internal/timers:511:7) {
  code: 'ERR_INTERNAL_ASSERTION'
}

Node.js v19.6.0

Additional information

No response

@bnoordhuis
Copy link
Member

@addaleax you can probably tell if this is a node bug or something mongosh is doing?

@addaleax
Copy link
Member

Fascinating, a mongosh issue here :)

We just enabled calling net.setDefaultAutoSelectFamily?.(true) in the latest release, so that’s what would be causing this to occur now. We don’t do anything out of the ordinary when creating network connections, so I would assume for now that this is a real Node.js bug. I’m not sure if #46587 would affect this.

I couldn’t reproduce this out of the box though, I would imagine there’s more to it than generically “connect to a mongod server”.


@marcopdonoso A few things: You most likely installed mongosh through homebrew. If you get the compiled version through https://www.mongodb.com/try/download/shell, that should make this issue go away for you.

Then, can you share more information about what exactly you are doing? A mongosh log file might be a good start (be sure to look through it and redact sensitive information before sharing).

@Bhutania
Copy link

I'm encountering a similar issue:

node:internal/assert:14
    throw new ERR_INTERNAL_ASSERTION(message);
    ^

Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at new NodeError (node:internal/errors:399:5)
    at assert (node:internal/assert:14:11)
    at internalConnectMultiple (node:net:1070:3)
    at afterConnectMultiple (node:net:1532:5) {
  code: 'ERR_INTERNAL_ASSERTION'
}

Node.js v19.6.0

This exception occurs when the mongosh endpoint isn't available through dns.

dns_failure_redacted_log.txt

When DNS is available (through vpn), I get failures with the string MongoServerSelectionError:

dns_resolved_redacted_log.txt

I haven't tried using the compiled version of mongosh, but I was able to gain access to the cluster using mongodb compass.

@Trott
Copy link
Member

Trott commented Feb 15, 2023

Although the stack traces are different, #46670 looks suspiciously similar.

@addaleax
Copy link
Member

Yeah, I think there’s a very high chance of these being duplicates, esp. considering that mongosh is also a REPL environment. #46670 has a nice isolated reproduction, though, maybe it’s nicer to keep that one open.

@tniessen
Copy link
Member

(Funny, I checked for duplicate issues but this was posted just one minute before I submitted #46670.)

@tniessen tniessen changed the title Error [ERR_INTERNAL_ASSERTION] Error [ERR_INTERNAL_ASSERTION] with autoSelectFamily enabled Feb 17, 2023
@tniessen tniessen added net Issues and PRs related to the net subsystem. confirmed-bug Issues with confirmed bugs. labels Feb 17, 2023
@tniessen
Copy link
Member

tniessen commented Feb 17, 2023

Refs: #44731

There is also a simpler repro of this issue in #46670.

cc @ShogunPanda

@ShogunPanda
Copy link
Contributor

Yes, I discovered this as well and I was already taking care of it in #46587.

I hope I'll able to land a fix next week!

@ShogunPanda
Copy link
Contributor

This should have been fixed in #51045. Once it gets in 21.x or 20.x please let me know if you have additional problems.

@naveenjpr
Copy link

MongoDB Compass has encountered an unexpected error
Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
at new NodeError (node:internal/errors:406:5)
at assert (node:internal/assert:14:11)
at internalConnectMultiple (node:net:1118:3)
at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
at listOnTimeout (node:internal/timers:575:11)
at process.processTimers (node:internal/timers:514:7)

my node version v20.13.1

@ShogunPanda
Copy link
Contributor

@naveenjpr lets continue here: #50893 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants