-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] npm silently fails when unable to write cache directory #4996
Comments
The issue seems to be related to the creation of the "cache-directory".
Above is from I traced it down to the following code,
Unfortunately my nodejs skills stops here and I'm not really sure what the comment is referring to, nor why we don't see any output from any log.XX code. Adding a catch to above, makes the code work, however I'm not sure if that is the right approach, I'll leave that to someone else.
With the above patch you'll get something like,
At least that would have pointed us in the right direction from the start. Sorry for the long post, here's a 🥔😄 ¯\(ツ)/¯ |
We use k8s with |
Wow! This just broke all of our applications on k8s and it took me half a day to figure out what's going on because there was no output whatsoever (Note to future self: Check npm issues first). Will this be treated as a bug which will be fixed or are we going to have to patch each and every one of our applications? 🙈 |
see npm/cli#4996 clue from Volker Schlecht
This made us lose two days of dev time. Took over a day to narrow the issue down to npm. Changing the alpine image back to 3.15 fixed it for us. |
Could this be related/the same as #4838? |
I just realized we had |
Fix image not running in K8s (ROSA) Trying to solve the container exiting with error code `243`. `npm` throws `243` for any command you try to run with it. Here is how to get into the container while the entrypoint normally errors. ``` $ oc run -i --tty --image=ghcr.io/matrix-org/matrix-public-archive/matrix-public-archive:sha-65edaea1a9713bb2cc93fa98638327fdeff765cd mpa-test2 --port=3050 --restart=Never --env="DOMAIN=cluster" --command /bin/bash $ npm start $ echo $? 243 ``` Why does the same image work in Docker? ``` $ docker run -it --entrypoint /bin/bash ghcr.io/matrix-org/matrix-public-archive/matrix-public-archive:sha-65edaea1a9713bb2cc93fa98638327fdeff765cd $ npm start # it starts ✅ ``` ## Root cause Seems like it could be either of these issues. Both are `8.6.0`+ problems as well which lines up with the `npm` version available in each base image. - npm/cli#4769 - npm/cli#4996 - Specific comment about breaking stuff in k8s for other people, npm/cli#4996 (comment)
It looks like the exit-handler is not properly reporting |
This also changes all the log messages about not being able to create initial directories and files to `log.verbose` since we know run those commands on init. There are a lot of valid reasons why those might fail, and we don't want to show a warning for them every time. Fixes: #4769 Fixes: #4838 Fixes: #4996
This also changes all the log messages about not being able to create initial directories and files to `log.verbose` since we know run those commands on init. There are a lot of valid reasons why those might fail, and we don't want to show a warning for them every time. Fixes: #4769 Fixes: #4838 Fixes: #4996
This also changes all the log messages about not being able to create initial directories and files to `log.verbose` since we know run those commands on init. There are a lot of valid reasons why those might fail, and we don't want to show a warning for them every time. Fixes: #4769 Fixes: #4838 Fixes: #4996
This also changes all the log messages about not being able to create initial directories and files to `log.verbose` since we know run those commands on init. There are a lot of valid reasons why those might fail, and we don't want to show a warning for them every time. Fixes: #4769 Fixes: #4838 Fixes: #4996
This also changes all the log messages about not being able to create initial directories and files to `log.verbose` since we know run those commands on init. There are a lot of valid reasons why those might fail, and we don't want to show a warning for them every time. Fixes: #4769 Fixes: #4838 Fixes: #4996
This also changes all the log messages about not being able to create initial directories and files to `log.verbose` since we know run those commands on init. There are a lot of valid reasons why those might fail, and we don't want to show a warning for them every time. Fixes: #4769 Fixes: #4838 Fixes: #4996
This also changes all the log messages about not being able to create initial directories and files to `log.verbose` since we know run those commands on init. There are a lot of valid reasons why those might fail, and we don't want to show a warning for them every time. Fixes: #4769 Fixes: #4838 Fixes: #4996
This also changes all the log messages about not being able to create initial directories and files to `log.verbose` since we know run those commands on init. There are a lot of valid reasons why those might fail, and we don't want to show a warning for them every time. Fixes: #4769 Fixes: #4838 Fixes: #4996
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When running older official node image, npm works fine:
With latest one, npm just silently exits:
Custom image that updates NPM:
Expected Behavior
Steps To Reproduce
With docker behavior steps can be used to reproduce. For newer version image creation is needed, as user can't be changed in shell to nobody.
Custom image created with Dockerfile:
Environment
No response
The text was updated successfully, but these errors were encountered: