Skip to content

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

Description

@aklyachkin
  • 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.

Activity

  1. sam-github commented on Nov 16, 2019

    @sam-github
    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?

  2. added
    aixIssues and PRs related to the AIX platform.
    osIssues and PRs related to the os subsystem.
    on Nov 16, 2019
  3. sam-github commented on Nov 16, 2019

    @sam-github
    Contributor

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

    @nodejs/platform-aix

  4. aklyachkin commented on Nov 16, 2019

    @aklyachkin
    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
    
  5. aklyachkin commented on Nov 16, 2019

    @aklyachkin
    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]
    }
    
  6. sam-github commented on Nov 16, 2019

    @sam-github
    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!

  7. sam-github commented on Nov 16, 2019

    @sam-github
    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
    
  8. aklyachkin commented on Nov 16, 2019

    @aklyachkin
    Author

    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
    
  9. richardlau commented on Nov 19, 2019

    @richardlau
    Member

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

  10. added
    libuvIssues and PRs related to the libuv dependency or the uv binding.
    on Nov 19, 2019
  11. aklyachkin commented on Nov 19, 2019

    @aklyachkin
    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?

  12. sam-github commented on Nov 19, 2019

    @sam-github
    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

  13. richardlau commented on Nov 19, 2019

    @richardlau
    Member

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

  14. aklyachkin commented on Nov 19, 2019

    @aklyachkin
    Author

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

  15. aklyachkin commented on Nov 20, 2019

    @aklyachkin
    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!

  16. added a commit that references this issue on Dec 9, 2019
  17. added a commit that references this issue on Jan 14, 2020
  18. added a commit that references this issue on Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    aixIssues and PRs related to the AIX platform.libuvIssues and PRs related to the libuv dependency or the uv binding.osIssues and PRs related to the os subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions