Skip to content

Assertion failed: unknown EAI_* error code in uv_getaddrinfo_translate_error #4223

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

Closed
nailaiftikhar opened this issue Aug 10, 2023 · 6 comments

Comments

@nailaiftikhar
Copy link

nailaiftikhar commented Aug 10, 2023

Details

I'm encountering an error with the following assertion message: Assertion failed: (!"unknown EAI_* error code"), function uv_getaddrinfo_translate_error, file src/unix/getaddrinfo.c, line 90.

  • The error occurs intermittently in a production environment.
  • The error does not seem to be directly related to my application code, as the trace points to internal Node.js code.
  • I have verified that my DNS settings and network configurations are correct.
    I've already taken the following steps:
  • Checked Node.js version and ensured it is up-to-date.
  • Verified operating system compatibility.
  • Reviewed system logs for any additional information.
    When the worker dies due to this error, all other requests on that worker get aborted, I want to prevent this behavior.
    If anyone has encountered a similar issue or has insights into diagnosing and resolving low-level errors like this one, I would greatly appreciate your input. Any suggestions, debugging techniques, or potential workarounds would be invaluable.

Node.js version

v18.15.0

Example code

cluster.on('exit', (worker, code, signal) => {
    console.log((JSON.stringify(worker.process.spawnargs))
    console.trace();
    console.log(`worker ${worker.process.pid} died with code ${code} and signal ${signal}`);
    console.log("Let's fork another worker!");
    cluster.fork();
  });
The trace it gives when the error occurs:

Assertion failed: (!"unknown EAI_* error code"), function uv_getaddrinfo_translate_error, file src/unix/getaddrinfo.c, line 90. ["/usr/local/bin/node", "/usr/home/user1/projects/bk-project/dist/shared/app.js"]
Trace
at EventEmitter.<anonymous> (/usr/home/user1/projects/bk-project/dist/shared/app.js:172:41)
at EventEmitter.emit (node: events: 513:28)
at ChildProcess. (node: internal/cluster/primary:188:13)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node: events: 513:28)
at ChildProcess._handle.onexit (node: internal/child_process: 291:12)
worker 3030 died with code null and signal SIGABRT
Let's fork another worker!

Operating system

Ubuntu Linux

@prettydiff
Copy link

prettydiff commented Aug 14, 2023

What execution steps are you taking to cause this error and what application code causes this error? The Assertion failed leads me to believe this error comes from some use of Node's assert library. The assert library exists to provide comparisons of logic that output to normal human language, such as for test automation. If this occurs in production and is not the result of some form of test automation the use of the assert library is probably not what you want.

I attempted to execute this in the Node shell repl versions 20.2.0 and 18.15.0 and I could not produce an error:

var cluster=require("cluster");cluster.on('exit', function (worker, code, signal) {console.log(JSON.stringify(worker.process.spawnargs));console.log(trace());console.log(`worker ${worker.proces.pid} died with ${code} and signal ${signal}`);cluster.fork();});

@nailaiftikhar
Copy link
Author

@prettydiff The issue is not due to this code snippet, this is just a part of node cluster implementation. There are multiple incoming requests on production, and the error's reason is not known yet. That's why I pasted the console trace output here, I want to know if there is any way I can debug this error, i.e., the root cause of it.
Or at least make it such that the worker never dies, so that other requests handled by that worker do not get aborted.

@prettydiff
Copy link

If the issue is somehow related to clusters I would log the cluster messaging. Clusters coordinate through a messaging scheme.

@preveen-stack
Copy link
Contributor

nodejs/node#49727

Copy link

github-actions bot commented May 7, 2024

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.

@github-actions github-actions bot added the stale label May 7, 2024
Copy link

github-actions bot commented Jun 8, 2024

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants