-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Bug]: Nodejs uv_interface_addresses returned Unknown system error 13 #10868
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
More info:
|
This comment was marked as outdated.
This comment was marked as outdated.
Thanks @thunder-coding ! I applied the patch building nodejs:
but then the build fails:
My use case is reuse a nodejs application in a mobile app. the os.networkInterfaces() call if not used directly - BUT there are some parts the use that code. the problem today is the error case which could lead to weird situations |
@neophob The following updated patch should work:- --- ./deps/uv/src/unix/linux-core.c.orig 2022-06-03 12:37:01.127102137 +0530
+++ ./deps/uv/src/unix/linux-core.c 2022-06-03 14:36:13.308341930 +0530
@@ -43,14 +43,6 @@
#include <fcntl.h>
#include <time.h>
-#define HAVE_IFADDRS_H 1
-
-#ifdef __UCLIBC__
-# if __UCLIBC_MAJOR__ < 0 && __UCLIBC_MINOR__ < 9 && __UCLIBC_SUBLEVEL__ < 32
-# undef HAVE_IFADDRS_H
-# endif
-#endif
-
#ifdef HAVE_IFADDRS_H
# if defined(__ANDROID__)
# include "uv/android-ifaddrs.h"
@@ -640,7 +632,7 @@
return val;
}
-
+#ifdef HAVE_IFADDRS_H
static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) {
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
return 1;
@@ -654,6 +646,7 @@
return exclude_type;
return !exclude_type;
}
+#endif
int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
#ifndef HAVE_IFADDRS_H And yeah, it's an upstream bug that Also, the bug is fixed in libuv 1.44.1. Link to exact commit: libuv/libuv@c40f8cb. So no need to send it upstream, since they've already fixed it on their end :) |
Nice, that patch worked. Now i get a different error:
|
Well that's because your code (or most probably one of your dependencies) hasn't been designed to work in situations where |
Not sure if I fully agree, as Nodejs docs say, that
that IS the whole usable stacktrace of the code, my function call looks like
|
is there anything I can do help diagnose this issue? I'm pretty clueless tbh at the moment, any hints are appreciated! |
It seems like you're using a bundler to bundle your application. If you can give me access to the source code of your app, I can certainly look into the place where |
Yeah that is from the bundled version. Here's a copy of the code that crash
as you can see, the code is pretty basic and it crashes when the |
Thanks @thunder-coding for your feedback, is my example above enough or is there anything I can do to help you reproducing the problem? |
Termux targets sdk level 28 for a reason, so I guess we won't be able to reproduce the issue in termux-app (and therefore @thunder-coding asked for access to the code of your app I guess). IMHO this issue isn't really termux related. Maybe other nodejs developers can help if you open an issue in their repo |
Instead of opening the issue in the nodejs GitHub repo, it'll make more sense to open it in the package's repo which depends on |
Yeah, I wanted to bring that issue up for the future (and my use case). Maybe it's my fault thinking that the termux packages support also post SDK 28 devices.
This does not make sense as |
This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I also meet the same problem, after some investigation, it was because the node had some problem, and I change a node for my pod then it solved, just share the info for others who may meet the same problem with me.
|
Facing the same problem. |
@noonesimg The workaround is to use targets sdk level 28 - let me know if you found another solution |
@neophob thanks! |
For those comming here after trying to use the C++ extension for code-server, I found a workaround:
So the whole function becomes:
I found this out after reading the documentation for os.networkInterfaces() and noticing that this function just returns the first mac address of the first interface in the system. Seems to work for me for now. |
Problem description
When I use the Termux app, install Node.js (latest and lts) and run Node.js - the call to os.networkInterfaces() works.
However when I build Node.js myself using the Termux Docker images (./build-package.sh openssl nodejs), each call to os.networkInterfaces() fails with A system error occurred: uv_interface_addresses returned Unknown system error 13 (Unknown system error 13) on my Android 11 system. (Permission denied).
it looks like this is because Android 11 forbids apps to query MAC addresses. Links:
What steps will reproduce the bug?
start self compiled nodejs binary on your Android 11 phone, enter
os.networkInterfaces()
in the repl.Tested with the latest nodejs and nodejs-lts version
What is the expected behavior?
call does not fail
System information
termux-info:
The text was updated successfully, but these errors were encountered: