Skip to content
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

Crash on init within a docker container - fix: warn about Node ABI version #14015

Open
3 tasks done
stoneburner opened this issue Oct 17, 2024 · 3 comments · May be fixed by #14043
Open
3 tasks done

Crash on init within a docker container - fix: warn about Node ABI version #14015

stoneburner opened this issue Oct 17, 2024 · 3 comments · May be fixed by #14043
Assignees
Labels
Package: profiling-node Issues related to the Sentry Profiling Node SDK

Comments

@stoneburner
Copy link

stoneburner commented Oct 17, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nodejs

SDK Version

8.34.0

Framework Version

Express

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

Run app within docker container

Expected Result

the add does not crash

Actual Result

The app crashes with:

Error: Cannot find module '/home/node/app/node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-x64-musl-131.node'
Require stack:
- Error: Cannot find module '/home/node/app/node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-x64-musl-131.node'
R node:internal/modules/cjs/loader:1262
  throw err;
  ^

Note the version 131 it wants to load indeed does not exists, when i run nodejs locally and test the code that is used by sentry node profiler i get this:

Welcome to Node.js v22.9.0.
Type ".help" for more information.
> const nodeAbi = require('node-abi');
undefined
> const node_process = require('node:process');
undefined
> nodeAbi.getAbi(node_process.versions.node, 'node');
'127'
>

The file with 127 does exist and sentry works normally

The docker file just uses the official docker image and nothing special:

# Use the official Node.js image as the base image
FROM node:current-alpine

# Set the working directory inside the container
WORKDIR /home/node/app

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install dependencies
RUN npm install
RUN npm install -g nodemon

# Start the server
CMD ["nodemon", "-x", "bin/www"]

I was forced to remove sentry from the apps within the company so we can deploy them and i rather would reactivate sentry.

@github-actions github-actions bot added the Package: browser Issues related to the Sentry Browser SDK label Oct 17, 2024
@chargome chargome added Package: profiling-node Issues related to the Sentry Profiling Node SDK and removed Package: browser Issues related to the Sentry Browser SDK labels Oct 18, 2024
@chargome
Copy link
Member

Hey @stoneburner, we currently only ship prebuilt binaries for node versions v16-22 (see https://github.com/getsentry/sentry-javascript/blob/develop/packages/profiling-node/README.md#prebuilt-binaries), and current-alpine resolves to v23. Can you try downgrading to node 22?

@stoneburner
Copy link
Author

stoneburner commented Oct 18, 2024

Thanks, downgrading nodejs to 22 worked!

Maybe a check of the abi version would be a good idea, disabling profiling (and warning about that) would be nicer than just crashing

@s1gr1d s1gr1d changed the title Crash on init within a docker container (but worked before in the container) Crash on init within a docker container - fix: warn about Node ABI version Oct 21, 2024
@s1gr1d s1gr1d self-assigned this Oct 21, 2024
@s1gr1d
Copy link
Member

s1gr1d commented Oct 21, 2024

Great to hear that it worked! And yes, checking for the version makes sense. I'll put that on our list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: profiling-node Issues related to the Sentry Profiling Node SDK
Projects
Status: No status
3 participants