ilri / OpenRXV

OpenRXV is a repository harvesting and explorer tool utilizing Dublin Core and CG Core metadata schemas
GNU General Public License v3.0
4 stars 6 forks source link

ETIMEDOUT error on npm install #191

Closed alanorth closed 1 year ago

alanorth commented 1 year ago

I'm getting this in the postinstall step while trying to fetch iso_3166-1.json on my host and in container:

npm ERR! code 1
npm ERR! path /home/aorth/src/git/OpenRXV/backend/node_modules/@mohammad231/iso_3166-1
npm ERR! command failed
npm ERR! command sh -c node download_iso_3166-1.js
npm ERR! node:events:492
npm ERR!       throw er; // Unhandled 'error' event
npm ERR!       ^
npm ERR!
npm ERR! AggregateError
npm ERR!     at internalConnectMultiple (node:net:1114:18)
npm ERR!     at internalConnectMultiple (node:net:1177:5)
npm ERR!     at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
npm ERR!     at listOnTimeout (node:internal/timers:575:11)
npm ERR!     at process.processTimers (node:internal/timers:514:7)
npm ERR! Emitted 'error' event on ClientRequest instance at:
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:495:9)
npm ERR!     at TLSSocket.emit (node:events:514:28)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
npm ERR!   code: 'ETIMEDOUT',
npm ERR!   [errors]: [
npm ERR!     Error: connect ETIMEDOUT 209.87.16.44:443
npm ERR!         at createConnectionError (node:net:1634:14)
npm ERR!         at Timeout.internalConnectMultipleTimeout (node:net:1685:38)
npm ERR!         at listOnTimeout (node:internal/timers:575:11)
npm ERR!         at process.processTimers (node:internal/timers:514:7) {
npm ERR!       errno: -110,
npm ERR!       code: 'ETIMEDOUT',
npm ERR!       syscall: 'connect',
npm ERR!       address: '209.87.16.44',
npm ERR!       port: 443
npm ERR!     },
npm ERR!     Error: connect ENETUNREACH 2607:f8f0:614:1::1274:44:443 - Local (:::0)
npm ERR!         at internalConnectMultiple (node:net:1176:40)
npm ERR!         at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
npm ERR!         at listOnTimeout (node:internal/timers:575:11)
npm ERR!         at process.processTimers (node:internal/timers:514:7) {
npm ERR!       errno: -101,
npm ERR!       code: 'ENETUNREACH',
npm ERR!       syscall: 'connect',
npm ERR!       address: '2607:f8f0:614:1::1274:44',
npm ERR!       port: 443
npm ERR!     }
npm ERR!   ]
npm ERR! }
npm ERR!
npm ERR! Node.js v20.9.0

The host has working internet connectivity and can download the file manually via wget or curl.

alanorth commented 1 year ago

Today I realized this was due to node / npm preferring IPv6 for some reason. My host does not have working IPv6 so I've disabled it temporarily via sysctl:

# echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
# echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6

Leaving this here for reference.