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

nodejs on AIX 7.2 os.networkInterfaces throws system error #30504

Closed
aklyachkin opened this issue Nov 16, 2019 · 13 comments · Fixed by #30783
Closed

nodejs on AIX 7.2 os.networkInterfaces throws system error #30504

aklyachkin opened this issue Nov 16, 2019 · 13 comments · Fixed by #30783
Labels
aix Issues and PRs related to the AIX platform. libuv Issues and PRs related to the libuv dependency or the uv binding. os Issues and PRs related to the os subsystem.

Comments

@aklyachkin
Copy link

  • Version: 11.15.0, 12.13.0, 13.1.0
  • Platform: AIX 7.2
  • Subsystem: os?

The simple check:

./node -e 'const os = require("os"); const interfaces = os.networkInterfaces(); for (const interface in interfaces) {console.log(interface); const addrs = interfaces[interface]; for (const addr of addrs) {console.log(addr.address)}}'

NodeJS 10.17.0 returns nothing.

NodesJS 11.15.0, 12.13.0, 13.10 return:

      throw new ERR_SYSTEM_ERROR(ctx);
      ^

SystemError [ERR_SYSTEM_ERROR]: A system error occurred: undefined returned undefined (undefined)
    at Object.networkInterfaces (os.js:195:16)
    at [eval]:1:49
    at Script.runInThisContext (vm.js:116:20)
    at Object.runInThisContext (vm.js:306:38)
    at Object.<anonymous> ([eval]-wrapper:9:26)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at evalScript (internal/process/execution.js:80:25)
    at internal/main/eval_string.js:23:3 {
  code: 'ERR_SYSTEM_ERROR',
  info: {},
  errno: [Getter/Setter: undefined],
  syscall: [Getter/Setter: undefined]
}

As a consequence - yarn doesn't work.

@sam-github
Copy link
Contributor

Works for me, and works in our CI. Which doesn't mean it works everywhere, obviously, but I'll need more information. ifconfig -a would help. Do you have interfaces?

@sam-github sam-github added aix Issues and PRs related to the AIX platform. os Issues and PRs related to the os subsystem. labels Nov 16, 2019
@sam-github
Copy link
Contributor

libuv/libuv@810377f is the only sinilar bug I can recall, but it doesn't seem directly related.

@nodejs/platform-aix

@aklyachkin
Copy link
Author

Thanks for the answer. It is AIX 7.2 TL3 SP3 LPAR in IBM cloud. It has interfaces:

# lsdev -Cc if
en0 Available  Standard Ethernet Network Interface
en1 Available  Standard Ethernet Network Interface
en2 Available  Standard Ethernet Network Interface
et0 Defined    IEEE 802.3 Ethernet Network Interface
et1 Defined    IEEE 802.3 Ethernet Network Interface
et2 Defined    IEEE 802.3 Ethernet Network Interface
lo0 Available  Loopback Network Interface
# ifconfig -a
en0: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 192.168.2.246 netmask 0xfffffff0 broadcast 192.168.2.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
en1: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 10.0.0.26 netmask 0xfffffff0 broadcast 10.0.0.31
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
en2: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet6 fe80::24b7:8dff:fecd:4142/64
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
sit0: flags=8100041<UP,RUNNING,LINK0>
        inet6 ::/96
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/128
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1

It looks like the problem is in sit0. I removed sit0 and it works (v13.1.0):

# ./node -e 'const os = require("os"); const interfaces = os.networkInterfaces(); for (const interface in interfaces) {console.>
en0
192.168.2.246
en1
10.0.0.26
lo0
127.0.0.1
::1

@aklyachkin
Copy link
Author

Not only on sit0, but on any interface without IP address:

# ifconfig -a
en0: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 192.168.2.246 netmask 0xfffffff0 broadcast 192.168.2.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
en1: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 10.0.0.26 netmask 0xfffffff0 broadcast 10.0.0.31
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
en2: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet6 fe80::24b7:8dff:fecd:4142/64
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/128
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1

# ./node -e 'const os = require("os"); const interfaces = os.networkInterfaces(); for (const interface in interfaces) {console.>
os.js:61
      throw new ERR_SYSTEM_ERROR(ctx);
      ^

SystemError [ERR_SYSTEM_ERROR]: A system error occurred: undefined returned undefined (undefined)
    at Object.networkInterfaces (os.js:195:16)
    at [eval]:1:49
    at Script.runInThisContext (vm.js:116:20)
    at Object.runInThisContext (vm.js:306:38)
    at Object.<anonymous> ([eval]-wrapper:9:26)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at evalScript (internal/process/execution.js:80:25)
    at internal/main/eval_string.js:23:3 {
  code: 'ERR_SYSTEM_ERROR',
  info: {},
  errno: [Getter/Setter: undefined],
  syscall: [Getter/Setter: undefined]
}

@sam-github
Copy link
Contributor

I'll see if I can repro, its probably an assumption far-down that interfaces have IPv4 addresses if they are up.

Do you have any suggestions on how to create an ifx without an address? If there's a non-destructive way, it would save some time. All the AIX I have access to are remote, so I can't take the addresses off the regular interfaces!

@sam-github
Copy link
Contributor

I could try to take the addr off of my lo0, but I'm a bit worried about bricking the LPAR:

$ ifconfig -a
en0: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 129.33.196.193 netmask 0xfffffff0 broadcast 129.33.196.207
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/64
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1

@aklyachkin
Copy link
Author

aklyachkin commented Nov 16, 2019

The problem is with interfaces which have IPv6 address, but no IPv4 address.

The way to create a virtual interface on AIX without any IP (no problems with nodejs):

mkdev -c if -s VI -t vi -a state='up'

with IPv6 address but without IPv4 (the error above):

mkdev -c if -s VI -t vi -a state='up' -a netaddr6='fe80::58b1:b0ff:fee4:5583' -a prefixlen=64

with IPv6 and IPv4 addresses (no problems):

mkdev -c if -s VI -t vi -a state='up' -a netaddr6='fe80::58b1:b0ff:fee4:5583' -a prefixlen=64 -a netaddr=172.16.1.1 -a netmask=255.255.255.0

@richardlau
Copy link
Member

I think libuv/libuv#2545 should fix this. Would it be possible for you to test it?

@richardlau richardlau added the libuv Issues and PRs related to the libuv dependency or the uv binding. label Nov 19, 2019
@aklyachkin
Copy link
Author

I'm not so deep in details of node.js functionality. How can I test it? Should I first compile libuv and then nodejs? or run some test with libuv?

@sam-github
Copy link
Contributor

roughly:

git clone node, checkout the branch you want to use, cd ./deps; rm -rf uv; then git clone richards' branch of libuv into deps/uv.

Follow the standard node.js build instructions after that: https://github.com/nodejs/node/blob/master/BUILDING.md

@richardlau
Copy link
Member

@aklyachkin Patch deps/libuv with the changes in that PR and then rebuild Node.js.

@aklyachkin
Copy link
Author

@sam-github @richardlau thank you for the explanation! I will try to compile it.

@aklyachkin
Copy link
Author

I compiled v13.1.0 and it works:

en0
192.168.3.6
en1
10.0.0.4
en2
0.0.0.0
fe80::fcb1:beff:fe92:636e
sit0
::
lo0
127.0.0.1
::1

ifconfig output to compare:

en0: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 192.168.3.6 netmask 0xfffffff0 broadcast 192.168.3.15
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
en1: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 10.0.0.4 netmask 0xffffff00 broadcast 10.0.0.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
en2: flags=1e084863,814c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet6 fe80::fcb1:beff:fe92:636e/64
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
sit0: flags=8100041<UP,RUNNING,LINK0>
        inet6 ::/96
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/128
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1

If you see, it shows all IPv6 addresses correct, but I'm not sure if it is correct to show IPv4 address 0.0.0.0 for en2. It has no IPv4 address. Anyway it works! Thank you @richardlau!

cjihrig added a commit to cjihrig/node that referenced this issue Dec 4, 2019
Notable changes:

- Fix handling of large files in `uv_fs_copyfile()`.
  Fixes: nodejs#30085
- Fix Android build errors.
- uv_sleep() has been added.
- uv_interface_addresses() IPv6 netmask support has been fixed.
  Fixes: nodejs#30504
- uv_fs_mkstemp() has been added.
cjihrig added a commit to cjihrig/node that referenced this issue Dec 6, 2019
Notable changes:

- Fix handling of large files in uv_fs_copyfile().
  Fixes: nodejs#30085
- Fix Android build errors.
- uv_sleep() has been added.
- uv_interface_addresses() IPv6 netmask support has been fixed.
  Fixes: nodejs#30504
- uv_fs_mkstemp() has been added.

PR-URL: nodejs#30783
Fixes: nodejs#30085
Fixes: nodejs#30504
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
targos pushed a commit that referenced this issue Dec 9, 2019
Notable changes:

- Fix handling of large files in uv_fs_copyfile().
  Fixes: #30085
- Fix Android build errors.
- uv_sleep() has been added.
- uv_interface_addresses() IPv6 netmask support has been fixed.
  Fixes: #30504
- uv_fs_mkstemp() has been added.

PR-URL: #30783
Fixes: #30085
Fixes: #30504
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
targos pushed a commit that referenced this issue Jan 14, 2020
Notable changes:

- Fix handling of large files in uv_fs_copyfile().
  Fixes: #30085
- Fix Android build errors.
- uv_sleep() has been added.
- uv_interface_addresses() IPv6 netmask support has been fixed.
  Fixes: #30504
- uv_fs_mkstemp() has been added.

PR-URL: #30783
Fixes: #30085
Fixes: #30504
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
BethGriggs pushed a commit that referenced this issue Feb 6, 2020
Notable changes:

- Fix handling of large files in uv_fs_copyfile().
  Fixes: #30085
- Fix Android build errors.
- uv_sleep() has been added.
- uv_interface_addresses() IPv6 netmask support has been fixed.
  Fixes: #30504
- uv_fs_mkstemp() has been added.

PR-URL: #30783
Fixes: #30085
Fixes: #30504
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
BethGriggs pushed a commit to BethGriggs/node that referenced this issue Feb 26, 2020
Notable changes:

- Fix handling of large files in uv_fs_copyfile().
  Fixes: nodejs#30085
- Fix Android build errors.
- uv_sleep() has been added.
- uv_interface_addresses() IPv6 netmask support has been fixed.
  Fixes: nodejs#30504
- uv_fs_mkstemp() has been added.

PR-URL: nodejs#30783
Fixes: nodejs#30085
Fixes: nodejs#30504
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
BethGriggs pushed a commit that referenced this issue Mar 2, 2020
Notable changes:

- Fix handling of large files in uv_fs_copyfile().
  Fixes: #30085
- Fix Android build errors.
- uv_sleep() has been added.
- uv_interface_addresses() IPv6 netmask support has been fixed.
  Fixes: #30504
- uv_fs_mkstemp() has been added.

PR-URL: #30783
Backport-PR-URL: #31969
Fixes: #30085
Fixes: #30504
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aix Issues and PRs related to the AIX platform. libuv Issues and PRs related to the libuv dependency or the uv binding. os Issues and PRs related to the os subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants