docker-node: Error with Node:8-alpine docker image on AWS using an M5 instance type
Problem: Node 8 alpine image does not appear to work on AWS m5 instances.
Command:
docker container run -it node:8-alpine /bin/sh -c 'npm -g'
Terminal logs:
Error: could not get uid/gid
[ 'nobody', 0 ]
at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:37:16
at ChildProcess.exithandler (child_process.js:282:5)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)
TypeError: Cannot read property 'get' of undefined
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:83:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:224:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:262:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:178:20)
at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:236:22)
at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:39:14
at ChildProcess.exithandler (child_process.js:282:5)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205
if (npm.config.get('json')) {
^
TypeError: Cannot read property 'get' of undefined
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at emitOne (events.js:116:13)
at process.emit (events.js:211:7)
at process._fatalException (bootstrap_node.js:378:26)
Strace logs:
read(8, "\1\0\0\0\0\0\0\0", 1024) = 8
stat("/usr/local/lib/node_modules/npm/node_modules/uid-number", {st_mode=S_IFDIR|0755, st_size=101, ...}) = 0
stat("/usr/local/lib/node_modules/npm/node_modules/uid-number/get-uid-gid.js", {st_mode=S_IFREG|0755, st_size=644, ...}) = 0
lstat("/usr/local/lib/node_modules/npm/node_modules/uid-number/get-uid-gid.js", {st_mode=S_IFREG|0755, st_size=644, ...}) = 0
socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, [12, 13]) = 0
socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, [14, 15]) = 0
socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, [16, 17]) = 0
pipe2([18, 19], O_CLOEXEC) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1 RT_2], [], 8) = 0
read(4, "*", 1) = 1
rt_sigaction(SIGCHLD, {sa_handler=0x557d5d900ad0, sa_mask=~[RTMIN RT_1 RT_2], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fda9929f722}, NULL, 8) = 0
write(5, "*", 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
fork() = 21
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
close(19) = 0
read(18, "", 4) = 0
close(18) = 0
close(13) = 0
ioctl(12, FIONBIO, [1]) = 0
close(15) = 0
ioctl(14, FIONBIO, [1]) = 0
close(17) = 0
ioctl(16, FIONBIO, [1]) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 12, {EPOLLIN, {u32=12, u64=12}}) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 14, {EPOLLIN, {u32=14, u64=14}}) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 16, {EPOLLIN, {u32=16, u64=16}}) = 0
epoll_wait(3, [{EPOLLIN, {u32=16, u64=16}}], 1024, -1) = 1
read(16, "[ 'nobody', 0 ]\n", 65536) = 16
epoll_wait(3, [{EPOLLIN|EPOLLHUP, {u32=12, u64=12}}], 1024, -1) = 1
read(12, "", 65536) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=21, si_uid=0, si_status=SIGSEGV, si_utime=4, si_stime=1} ---
read(4, "*", 1) = 1
write(7, "\250\210a^}U\0\0\21\0\0\0\0\0\0\0", 16) = 16
write(5, "*", 1) = 1
rt_sigreturn({mask=[]}) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 12, 0x7ffef7ad1bec) = 0
close(12) = 0
epoll_wait(3, [{EPOLLIN|EPOLLHUP, {u32=16, u64=16}}, {EPOLLIN|EPOLLHUP, {u32=14, u64=14}}, {EPOLLIN, {u32=6, u64=6}}], 1024, -1) = 3
read(16, "", 65536) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 16, 0x7ffef7ad21ac) = 0
close(16) = 0
read(14, "", 65536) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 14, 0x7ffef7ad21ac) = 0
close(14) = 0
read(6, "\250\210a^}U\0\0\21\0\0\0\0\0\0\0", 512) = 16
wait4(21, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV && WCOREDUMP(s)}], WNOHANG, NULL) = 21
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1 RT_2], [], 8) = 0
read(4, "*", 1) = 1
rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fda9929f722}, NULL, 8) = 0
write(5, "*", 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
write(11, "Error: could not get uid/gid\n[ '"..., 509Error: could not get uid/gid
[ 'nobody', 0 ]
at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:37:16
at ChildProcess.exithandler (child_process.js:282:5)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)
) = 509
uname({sysname="Linux", nodename="dba91fdc3e5d", ...}) = 0
uname({sysname="Linux", nodename="dba91fdc3e5d", ...}) = 0
write(11, "TypeError: Cannot read property "..., 1054TypeError: Cannot read property 'get' of undefined
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:83:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:224:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:262:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:178:20)
at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:236:22)
at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:39:14
at ChildProcess.exithandler (child_process.js:282:5)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
) = 1054
uname({sysname="Linux", nodename="dba91fdc3e5d", ...}) = 0
uname({sysname="Linux", nodename="dba91fdc3e5d", ...}) = 0
writev(2, [{iov_base="", iov_len=0}, {iov_base="/usr/local/lib/node_modules/npm/"..., iov_len=114}], 2/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205
if (npm.config.get('json')) {
^
) = 114
writev(2, [{iov_base="\n", iov_len=1}, {iov_base="TypeError: Cannot read property "..., iov_len=276}], 2
TypeError: Cannot read property 'get' of undefined
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at emitOne (events.js:116:13)
at process.emit (events.js:211:7)
at process._fatalException (bootstrap_node.js:378:26)) = 277
writev(2, [{iov_base="\n", iov_len=1}, {iov_base=NULL, iov_len=0}], 2
) = 1
futex(0x7fda964e59e4, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x557d5e6185a4, FUTEX_WAKE_PRIVATE, 1) = 1
munmap(0x7fda964e6000, 8400896) = 0
munmap(0x7fda95ce3000, 8400896) = 0
munmap(0x7fda954e0000, 8400896) = 0
munmap(0x7fda94cdd000, 8400896) = 0
exit_group(7) = ?
+++ exited with 7 +++
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 7
- Comments: 26 (7 by maintainers)
Commits related to this issue
- chore: add temporary fix for https://github.com/nodejs/docker-node/issues/813 — committed to nemolize/nuxt-todo by deleted user 5 years ago
- Attempt fix for npm install from this issue https://github.com/nodejs/docker-node/issues/813 — committed to SecureTrading/js-payments by deleted user 5 years ago
- add unsafe-perm https://github.com/nodejs/docker-node/issues/813#issuecomment-407339011 — committed to fadeltd/lint-review by fadeltd 5 years ago
- Fix frontend build See https://github.com/nodejs/docker-node/issues/813 — committed to seqeralabs/nf-tower by pditommaso 4 years ago
- upgraded node-alpine docker image to fix uid/gid issue: https://github.com/nodejs/docker-node/issues/813 — committed to ebox86/cdk-ecs-fargate-ghost by ebox86 4 years ago
- Update container (#6) * Cleanup and restructure Dockerfile Use build and app stage * Add container build CI * Use normal node image The alpine image has a bug which causes an error 'Error... — committed to mpepping/docker-cyberchef by tabic 3 years ago
- Work around https://github.com/nodejs/docker-node/issues/813. — committed to LBNL-ETA/BEDES-Manager by wizonesolutions 3 years ago
Root cause seems to be: https://wiki.musl-libc.org/functional-differences-from-glibc.html#Thread_stack_size
There three possible solutions:
It still fails in
node:10-alpine
(alpine 3.8)Details:
I am also having this issue on 10.16.0-alpine. This error started yesterday for me
Closing since Node 8 support ended 4 months ago
Fixed in
nodejs@12.4.0
?