-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unable to install profiling-node on alpine #12169
Comments
@JonasBa could you help take a look? Thanks! |
@satdeveloping I'm going to take a look at this, but I'm at a conference all day tomorrow so I will only be able to check this on Friday. Meanwhile, would you mind testing if other nodejs versions work or if this is isolated to the node20 runtime? Ideally, it would be great if you can share a dockerfile that we can use to reproduce the crash so that I can try to reproduce the issue and attempt to extract more information from the crash |
I have the same problem but with
But it works just fine with |
I mean, from the docker command I gave, a Dockerfile would look like FROM node:20-alpine
WORKDIR /app
RUN npm init -y
RUN npm install @sentry/profiling-node
[+] Building 13.8s (8/8) FINISHED docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 128B 0.0s
=> [internal] load metadata for docker.io/library/node:20-alpine 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/4] FROM docker.io/library/node:20-alpine@sha256:291e84d956f1aff38454bbd3da38941461ad569a185c20aa289f71f37ea08e23 0.9s
=> => resolve docker.io/library/node:20-alpine@sha256:291e84d956f1aff38454bbd3da38941461ad569a185c20aa289f71f37ea08e23 0.9s
=> [auth] library/node:pull token for registry-1.docker.io 0.0s
=> [2/4] WORKDIR /app 0.0s
=> [3/4] RUN npm init -y 0.8s
=> ERROR [4/4] RUN npm install @sentry/profiling-node 11.9s
------
> [4/4] RUN npm install @sentry/profiling-node:
11.80 npm ERR! path /app/node_modules/@sentry/profiling-node
11.81 npm ERR! command failed
11.81 npm ERR! signal SIGSEGV
11.81 npm ERR! command sh -c node scripts/check-build.js
11.81 npm ERR! @sentry/profiling-node: Precompiled binary found, attempting to load /app/node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-arm64-musl-115.node
11.81 npm ERR! @sentry/profiling-node: Precompiled binary found, skipping build from source.
11.81
11.81 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-05-24T18_46_01_725Z-debug-0.log
------
Dockerfile:7
--------------------
5 | RUN npm init -y
6 |
7 | >>> RUN npm install @sentry/profiling-node
8 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install @sentry/profiling-node" did not complete successfully: exit code: 1 |
I tested node:(18|20|22)-alpine and the issue was only present on node:20-alpine |
We've temporarily downgraded to 7.110.1 which is the most recent 7.X version that works for us with node:20-alpine. Unfortunately we also receive the same error as listed above. |
I'm going to investigate this today, sorry everyone. For now, it would help if anyone experiencing this could post the exact image they are using as well as a reproducible dockerfile. |
@satdeveloping Just wanted to confirm if in your case, this also happens sporadically. I am attempting to reproduce this and it seems that it sometimes succeeds. I will try and extract a coredump and see what is going on here. |
I've attempted downgrading alpine to 3.18 and can no longer reproduce the crash (on any of the node versions) @satdeveloping @maxkramer @mat813 Unless you require 3.18+, you should be able to downgrade to 3.18 and mitigate this temporarily while I figure out the root cause of the issue. |
I just tried with node:22.2.0-alpine3.18 (and, to be complete, 3.19 and 3.20) and it SIGSEGV the same as the node:22.2.0-alpine image. Well, to be fair, it SIGSEGV most of the time, about once every 20-50 times, yarn install works. |
Tentative fix for #12169 I did not generate a core dump, but by looking at the crash, it seemed like it the segfault was happening after the bindings were required and the code after the require statement had already ran, which hints at an issue with the measurement collection loop. This is a small change, but it ensures that the reference to the timer is not maintained and can be properly collected, as well as adds a missing nullptr check.
I hit this problem trying to updating to sentry 8, then I saw the recent commit so I went ahead and installed profiling-node from github and it fixed my issue. |
We'll get a release out within the next 1-2 days - thanks for your patience everyone (shoutout @JonasBa for the fix!) |
I would recommend you to upgrade to LTS or downgrade alpine. It seems that whatever the issue was, it has gotten fixed upstream somewhere in nodejs. cc @anonrig if you know of any recent fixes in nodejs that might have caused this? |
I'm confused - isn't Node 20 LTS? And Node removed alpine 3.18 from its published tags. So neither of these seem actionable unless I've misunderstood. |
Sorry, I misspoke. I meant either upgrade to 22 or try downgrading alpine. I'm tempted to upgrade alpine from 3.17 for our build images, but I'm hesitating because it will likely break existing apps unless we make it a major bump (which is something I would not want to do right now) |
Any progress here? Having the same issue |
Hey @clemente-xyz, from our point of view no updates so far. Gonna tag @JonasBa (who's off today) to confirm. |
It seems the problem is only with Node 20 and Alpine 3.19/3.20. Node 20 with Alpine 3.18 works as well as Node 22. |
Hey everyone, first of all, I'm sorry about the wait, I haven't given this proper care and figure out the root cause. I'm going to see if I can figure out what exactly is going on here. In the meantime, if anyone managed to extract a coredump and share it, I would be very happy. As a possible workaround, if some changes in alpine are indeed the issue, you should be able to temporarily build from source
I'm going to try and extract a coredump to see whats going on |
This is happening in node:22.8-alpine conditionally. I've created a reproducible repository with error occuring github actions over here. In case this could be helpful I've also added valgrind log too. This is a coredump from arm64 node:22.8-alpine docker image v8-compile-cache-0.zip. |
Thank you @asomethings, that helps a lot. There seems to be something suspicious here, or maybe I'm going crazy but if I rebuild the package on alpine3.19 or alpine3.20 without changing the source, the error no longer appears and everything works as expected. |
@JonasBa This seems more crazy but it seems like |
Yes, @asomethings, something is definitely weird here. Right now what I've done is updated the close to check for |
I assume it was fixed in #13661. Tested working in |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.2.1
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
docker run --rm -it -w /app node:20-alpine sh -c 'npm init -y && npm install @sentry/profiling-node
Expected Result
The package installs
Actual Result
There is a segfault.
npm debug log
The text was updated successfully, but these errors were encountered: