-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Protect against spawn of CLI for wrong architecture #1317
Comments
We only need to do this for UNIX systems, as for windows |
Hi, is there any progress on this issue? I am still getting the error: I tried to uninstall the @sentry/nextjs package and install back as you suggested but it did not help. |
No, not really. As for your issue, can you run |
@samueldusek In your
This works for me as it will make sure that you get the right CLI for the platform your container runs on. |
@danielkhan As I mentioned in my first comment. I did try it and it did not help. |
@samueldusek what happens if you remove |
@kamilogorek This is the output from the
This is how I am trying to install dependencies for my app in the docker file.
|
@danielkhan The image building process fails do to the error mentioned above when running
So I am not even able to build my app due to the sentry-cli error. 😞 Just to mention.. When I am building the app on my local machine I have no issue. |
What happens if you remove Sentry from your local install and then |
@danielkhan Well, I tried to remove Sentry from my local install as you suggested and it started to work. But I do not think that it is a solution as I cannot build the app on my local machine anymore. There should be a solution I can build the app both, localy and in docker as well without any issues. 😞 |
@samueldusek this is more for the purpose of triaging the problem. |
@samueldusek If you use the similar to the one of the nextjs-example (https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile), you have to execute
after
If you do it after the |
That fixed my problem while running |
@vladanpaunovic and @kamilogorek is this issue something we can pull back up and discuss if there is a way forward? |
I don't believe there's an easy way out of this, as this is docker build misconfiguration, and we cannot control the user-land. |
Goals:
Would it be possible to download and store the respective binaries in a directory structure that contains the arch |
Changing
to
fixes the issue and you don't need to remove and install sentry again |
That would definitely be possible, but we have lots of other tools that rely on the fact that |
We aware that there's a typo in the first line. It should be RUN npm uninstall --save @sentry/nextjs |
Oh, nice catch! Update the comment, thanks |
Another option, without swapping copy/install is to add
|
We believe #1836 should likely also resolve this issue. We are closing this issue for now; if anyone continues experiencing this problem, please reopen! |
Problem
The CLI is rarely used standalone. In most cases, it is executed via intermediates like the Sentry Webpack plugin.
When the CLI is installed via npm, it will run an install script that downloads a binary for the current architecture.
There are scenarios, when the architecture where the CLI eventually runs differs from the one
npm install
was executed from.E.g.
node_modules
into the containernode_modules
This can lead to a rather obscure error when the binary is executed/spawned:
#0 26.19 Sentry CLI Plugin: spawn Unknown system error -8
.I could reproduce this problem by running
npm install @sentry/nextjs
on an M1 Mac before running the application in Docker (Alpine).The problem was reported by other users as well and we didn't come up with a solution proposal yet:
Quick fix
The problem can be solved by running
npm uninstall <sentry_module_that_installs_the_CLI_as_dep>
npm install <sentry_module_that_installs_the_CLI_as_dep>
as part of the deployment on the target system.For a
next.js
application running in Docker, this would mean adding the following to the Dockerfile:This ensures that the right binary is downloaded for the target system.
Product improvement
Sentry should detect that the binary doesn't match the current architecture and provide an actionable error message to the user.
E.g.
The text was updated successfully, but these errors were encountered: