You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error relocating /usr/bin/node: _ZSt28__throw_bad_array_new_lengthv: symbol not found #41058
Linux e395c1ec1266 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 Linux
Subsystem
No response
What steps will reproduce the bug?
I'm installing node on an alpine image. Since the recent release of 16.13.1 I'm facing this issue, it was working fine with 16.13.0 but unfortunately, that version is gone from Alpine's registry.
FROM ruby:3.0.3-alpine
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ nodejs
node -v
Error relocating /usr/bin/node: _ZSt28__throw_bad_array_new_lengthv: symbol not found
How often does it reproduce? Is there a required condition?
Thanks @BethGriggs! I should copy the rest of my Dockerfile. Standard Rails setup, but I guess it's possible that this is due to some interaction with other installs.
FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf_image
FROM ruby:3.0.3-alpine
RUN apk --update add --no-cache \
# Build & runtime tools
build-base imagemagick git \
# Required for Docker port scanning
netcat-openbsd \
# Required by Rails
tzdata \
# Required for PostgreSQL
postgresql-dev postgresql-client
# Fonts for PDF generationRUN apk add --no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/v3.13/main/ \
ttf-ubuntu-font-family
# Required for wicked_pdf: https://github.com/mileszs/wicked_pdf/issues/841#issuecomment-507759176COPY --from=wkhtmltopdf_image /bin/wkhtmltopdf /bin/
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ nodejs
Doing a apk upgrade before installing nodejs fixed this issue for me. It seems like the latest nodejs package depends on some libraries to be updated.
Hey guys, I added apk ugrade to my Dockerfile , but it didnt seem to help .
I still get _ZSt28__throw_bad_array_new_lengthv: symbol not found
This is really strange , I see that alpine haven't updated the repository with a new nodejs package for some reason.
I thought maybe they have a bad nodejs package and would have replaced it, since it was added on Dec 01.
I agree with @BethGriggs - the problem is in ruby alpine images.
It seems nodejs from alpine package requires libstdc++.so with version 6.0.29, but version of libstdc++.so is 6.0.28 in ruby image because of gmp-dev package
$ docker run -it --rm ruby:2.7.5-alpine3.15 sh
/ # ls -al /usr/lib/ | grep libstdc++
lrwxrwxrwx 1 root root 19 Nov 30 09:19 libstdc++.so.6 -> libstdc++.so.6.0.28
-rwxr-xr-x 1 root root 1690200 Oct 27 12:50 libstdc++.so.6.0.28
/ # apk del libstdc++
World updated, but the following packages are not removed due to:
libstdc++: gmp-dev
/ # apk add --update --no-cache --repository http://nl.alpinelinux.org/alpine/edge/main nodejs
fetch http://nl.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
(1/4) Installing nghttp2-libs (1.46.0-r0)
(2/4) Installing brotli-libs (1.0.9-r6)
(3/4) Installing c-ares (1.18.1-r0)
(4/4) Installing nodejs (16.13.1-r1)
Executing busybox-1.34.1-r3.trigger
OK: 59 MiB in 40 packages
/ # node -v
Error relocating /usr/bin/node: _ZSt28__throw_bad_array_new_lengthv: symbol not found
FROM alpine:3.15 as libstdc-donor
RUN apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/main libstdc++
FROM postgres:12.4-alpine
COPY --from=libstdc-donor /usr/lib/libstdc++.so.6.0.29 /usr/lib/libstdc++.so.6.0.29
RUN rm /usr/lib/libstdc++.so.6 && ln -s /usr/lib/libstdc++.so.6.0.29 /usr/lib/libstdc++.so.6
RUN apk -UvX http://dl-4.alpinelinux.org/alpine/edge/main add nodejs
$ docker build -f Dockerfile -t test .
$ docker run -it --rm test sh -c 'node -v'
v16.13.1
Hi igor
Yes I saw your previous post and indeed it works, Thanks :-) question is, this workaround is pretty "hacky", trying to understand if this regression is here to stay or something that should be fixed in the alpine repo.
@ryan65 After reading documentation for apk add I think I found the proper way to upgrade libstdc++ :)
Dockerfile:
FROM postgres:12.4-alpine
RUN apk -UvX http://dl-4.alpinelinux.org/alpine/edge/main add -u nodejs
$ docker run -it --rm postgres:12.4-alpine sh -c 'apk -UvX http://dl-4.alpinelinux.org/alpine/edge/main add -u nodejs && node -v'
fetch http://dl-4.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
The following packages will be REMOVED:
libtls-standalone
The following NEW packages will be installed:
libretls ca-certificates nghttp2-libs brotli-libs c-ares nodejs
The following packages will be upgraded:
musl libgcc libstdc++ libcrypto1.1 libssl1.1 busybox ca-certificates-bundle ssl_client
After this operation, 39 MiB of additional disk space will be used.
(1/15) Upgrading musl (1.1.24-r9 -> 1.2.2-r7)
(2/15) Upgrading libgcc (9.3.0-r2 -> 11.2.1_git20211128-r3)
(3/15) Upgrading libstdc++ (9.3.0-r2 -> 11.2.1_git20211128-r3)
(4/15) Upgrading libcrypto1.1 (1.1.1g-r0 -> 1.1.1m-r1)
(5/15) Upgrading libssl1.1 (1.1.1g-r0 -> 1.1.1m-r1)
(6/15) Upgrading busybox (1.31.1-r19 -> 1.34.1-r5)
Executing busybox-1.34.1-r5.post-upgrade
stat: can't stat 'usr/bin/last': No such file or directory
stat: can't stat 'usr/bin/who': No such file or directory
(7/15) Upgrading ca-certificates-bundle (20191127-r4 -> 20191127-r7)
(8/15) Installing libretls (3.4.2-r0)
(9/15) Upgrading ssl_client (1.31.1-r19 -> 1.34.1-r5)
(10/15) Installing ca-certificates (20191127-r7)
(11/15) Installing nghttp2-libs (1.46.0-r0)
(12/15) Installing brotli-libs (1.0.9-r6)
(13/15) Installing c-ares (1.18.1-r0)
(14/15) Installing nodejs (16.13.1-r1)
(15/15) Purging libtls-standalone (2.9.1-r1)
Executing busybox-1.34.1-r5.trigger
Executing ca-certificates-20191127-r7.trigger
OK: 38 packages, 159 dirs, 1555 files, 148 MiB
v16.13.1
Reacted by Demsong Tsamo Herman, Theo Paris, Ros Khromenkov, fcaro-morrisopazo, alan.omar and eyzoku
@ryan65 After reading documentation for apk add I think I found the proper way to upgrade libstdc++ :)
Dockerfile:
FROM postgres:12.4-alpine
RUN apk -UvX http://dl-4.alpinelinux.org/alpine/edge/main add -u nodejs
$ docker run -it --rm postgres:12.4-alpine sh -c 'apk -UvX http://dl-4.alpinelinux.org/alpine/edge/main add -u nodejs && node -v'
fetch http://dl-4.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
The following packages will be REMOVED:
libtls-standalone
The following NEW packages will be installed:
libretls ca-certificates nghttp2-libs brotli-libs c-ares nodejs
The following packages will be upgraded:
musl libgcc libstdc++ libcrypto1.1 libssl1.1 busybox ca-certificates-bundle ssl_client
After this operation, 39 MiB of additional disk space will be used.
(1/15) Upgrading musl (1.1.24-r9 -> 1.2.2-r7)
(2/15) Upgrading libgcc (9.3.0-r2 -> 11.2.1_git20211128-r3)
(3/15) Upgrading libstdc++ (9.3.0-r2 -> 11.2.1_git20211128-r3)
(4/15) Upgrading libcrypto1.1 (1.1.1g-r0 -> 1.1.1m-r1)
(5/15) Upgrading libssl1.1 (1.1.1g-r0 -> 1.1.1m-r1)
(6/15) Upgrading busybox (1.31.1-r19 -> 1.34.1-r5)
Executing busybox-1.34.1-r5.post-upgrade
stat: can't stat 'usr/bin/last': No such file or directory
stat: can't stat 'usr/bin/who': No such file or directory
(7/15) Upgrading ca-certificates-bundle (20191127-r4 -> 20191127-r7)
(8/15) Installing libretls (3.4.2-r0)
(9/15) Upgrading ssl_client (1.31.1-r19 -> 1.34.1-r5)
(10/15) Installing ca-certificates (20191127-r7)
(11/15) Installing nghttp2-libs (1.46.0-r0)
(12/15) Installing brotli-libs (1.0.9-r6)
(13/15) Installing c-ares (1.18.1-r0)
(14/15) Installing nodejs (16.13.1-r1)
(15/15) Purging libtls-standalone (2.9.1-r1)
Executing busybox-1.34.1-r5.trigger
Executing ca-certificates-20191127-r7.trigger
OK: 38 packages, 159 dirs, 1555 files, 148 MiB
v16.13.1
Activity
BethGriggs commentedon Dec 2, 2021
It seems to be okay in the upstream
alpine:3.15container:So I am (perhaps wrongly) assuming it is being caused by something in the Ruby image build (https://github.com/docker-library/ruby/blob/master/3.0/alpine3.15/Dockerfile).
thisismydesign commentedon Dec 2, 2021
Thanks @BethGriggs! I should copy the rest of my Dockerfile. Standard Rails setup, but I guess it's possible that this is due to some interaction with other installs.
Niek commentedon Dec 3, 2021
Doing a
apk upgradebefore installing nodejs fixed this issue for me. It seems like the latest nodejs package depends on some libraries to be updated.ryan65 commentedon Dec 5, 2021
Hey guys, I added apk ugrade to my Dockerfile , but it didnt seem to help .
I still get _ZSt28__throw_bad_array_new_lengthv: symbol not found
This is really strange , I see that alpine haven't updated the repository with a new nodejs package for some reason.
I thought maybe they have a bad nodejs package and would have replaced it, since it was added on Dec 01.
http://dl-4.alpinelinux.org/alpine/edge/main/x86_64/
this is what I did in my Dockerfile but it didnt seem to help.
RUN apk upgrade
RUN apk -UvX http://dl-4.alpinelinux.org/alpine/edge/main add nodejs
hrfmartins commentedon Dec 6, 2021
I have this exact same issue, tried adding the apk upgrade and it didn't work as well.
I'm using the alpine image of nginx
igvasilyev commentedon Dec 19, 2021
I agree with @BethGriggs - the problem is in ruby alpine images.
It seems nodejs from alpine package requires
libstdc++.sowith version 6.0.29, but version oflibstdc++.sois 6.0.28 in ruby image because ofgmp-devpackageMy workaround:
In Dockerfile:
ryan65 commentedon Dec 21, 2021
Strange thing.
I just checked alpine repo
http://dl-4.alpinelinux.org/alpine/edge/main/x86_64/
and saw that the nodejs version was updated
nodejs-16.13.1-r1.apk on 18th Dec
I built a new image from scratch to make sure it uses the new version .
And still get the same error. I doubled checked and saw in /usr/bin that the its the node from 18th Dec.
Error relocating /usr/bin/node: _ZSt28__throw_bad_array_new_lengthv: symbol not found
So even though they are using a new node version the problem persists.
Niek commentedon Dec 21, 2021
@ryan65 in that case it's probably best to open an issue at https://gitlab.alpinelinux.org/alpine/aports/-/issues
igvasilyev commentedon Dec 21, 2021
@ryan65 Can you show your Dockerfile please?
ryan65 commentedon Dec 21, 2021
Nothing special , the relevant part is just
FROM postgres:12.4-alpine
RUN apk -UvX http://dl-4.alpinelinux.org/alpine/edge/main add nodejs
igvasilyev commentedon Dec 21, 2021
@ryan65 Try this approach:
Dockerfile:
ryan65 commentedon Dec 21, 2021
Hi igor
Yes I saw your previous post and indeed it works, Thanks :-) question is, this workaround is pretty "hacky", trying to understand if this regression is here to stay or something that should be fixed in the alpine repo.
igvasilyev commentedon Dec 21, 2021
@ryan65 After reading documentation for
apk addI think I found the proper way to upgrade libstdc++ :)Dockerfile:
ryan65 commentedon Dec 22, 2021
Sure does work :-). Nice !! , And Thanks.
Custom container compatible with Jekyll & GitHub pages (#80)
INF-2546 Bug fix for nodejs/node#41058
INF-2546 Bug fix for nodejs/node#41058
INF-2546 Bug fix for nodejs/node#41058
INF-2546 Bug fix for nodejs/node#41058
INF-2546 Bug fix for nodejs/node#41058
INF-2546 Bug fix for nodejs/node#41058
INF-2546 Bug fix for nodejs/node#41058
INF-2546 Bug fix for nodejs/node#41058
INF-2546 Bug fix for nodejs/node#41058
INF-2546 Node.js upgrade; add yarn/jest (#1)
lcw0622 commentedon Nov 17, 2023
worked for me,thanks a lot
zffocussss commentedon Nov 4, 2024
you save my life.
FlyingKumquat commentedon Feb 10, 2025
many blessing upon you, fine person
fguendling commentedon Jun 9, 2025
This error popped up for me when I used this image in a CI/CD pipeline: hub.docker.com/docker:28.1.1
I upgraded to hub.docker.com/docker:28.2.2 and the error went away