getsentry / profiling-node

The code for this repo now lives in https://github.com/getsentry/sentry-javascript/tree/develop/packages/profiling-node
MIT License
29 stars 10 forks source link

Unable to install inside AppWrite #119

Open troykelly opened 1 year ago

troykelly commented 1 year ago

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

SDK Version

0.3.0

Link to Sentry event

No response

What environment is your node script running in?

Running inside AppWrite

How is your code deployed and bundled?

Daployed using AppWrite's deploy

Steps to Reproduce

  1. Add @sentry/profiling-node to package.json
  2. Deploy

Expected Result

Deployment completes, code runs, profiling happiness ensues

Actual Result

Unable to deploy:

Docker Error: npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm notice 
npm notice New major version of npm available! 7.10.0 -> 9.6.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.2>
npm notice Run `npm install -g npm@9.6.2` to update!
npm notice 
npm ERR! code 1
npm ERR! path /usr/builds/node_modules/@sentry/profiling-node
npm ERR! command failed
npm ERR! command sh -c node scripts/check-build.js
npm ERR! @sentry/profiling-node: Precompiled binary found, attempting to load...
npm ERR! /usr/builds/node_modules/@sentry/profiling-node/scripts/check-build.js:51
npm ERR!   throw e;
npm ERR!   ^
npm ERR! 
npm ERR! Error: Error relocating /usr/builds/node_modules/@sentry/profiling-node/binaries/sentry_cpu_profiler-v93-linux-x64-musl.node: _ZSt28__throw_bad_array_new_lengthv: symbol not found
npm ERR!     at Object.Module._extensions..node (node:internal/modules/cjs/loader:1167:18)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:988:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:828:14)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1012:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:93:18)
npm ERR!     at Object.<anonymous> (/usr/builds/node_modules/@sentry/profiling-node/scripts/check-build.js:24:3)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1108:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:988:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:828:14) {
npm ERR!   code: 'ERR_DLOPEN_FAILED'
npm ERR! }
JonasBa commented 1 year ago

@troykelly this smells like a libstd issue, any chance you can try upgrading that? I am not familiar with AppWrite, but I suspect it runs your application in some sort of container env.

I cant tell from the issue you linked, but what version of node are you running?

troykelly commented 1 year ago

It's Node-16. I might have to raise this with the AppWrite team instead?

JonasBa commented 1 year ago

@troykelly do you know how AppWrite runs your code? If we can create a reproducible env, I'd be happy to investigate this

troykelly commented 1 year ago

AppWrite isn't super difficult to set up, it's just time/resourcing consuming (it's easiest on a clean VM, running their online installer) If you have an AppWrite environment, just trying to publish a function that has the library in the package.json will cause the failure.

JonasBa commented 1 year ago

@troykelly any chance you could send us the output of running npm install --verbose --foreground-scripts @sentry/profiling-node inside appwrite?

JonasBa commented 1 year ago

@troykelly seems like appwrite is in private beta so we cant actually deploy functions without access. Let me know if you are able to provide us with the logs of npm install --verbose --foreground-scripts

troykelly commented 1 year ago

@JonasBa AppWrite cloud is a private beta. I'm running AppWrite locally - I can't see a way to capture the npm install during build.