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
Recent bump to NPM 8 has broken publishing to private registries #61
Comments
Used |
The image tag |
I had the same problem here. |
This appears to be a problem only with standard HTTP ports based on how Node parses the registry URL and does authToken matching. A registry using standard HTTPS port 443 I've updated the fix to just strip standard HTTP ports 80 and 443 when writing the authToken. |
As a temporary solution, I replaced the plugin with a pure node container:
To get a token: |
@rodrigo-brito the fix from @rhiaxion was merged in #62 but the build was 🔴 . Its being addressed in #63 so if anyone watching this issue is comfortable building the plugin and testing it on their setup it would help us resolve this issue. 🙏 |
Hi @donny-dont, I compiled the binary to the release folder, and create the docker image, but I'm receiving the error: I'm using Linux amd64. The binary is generated with: |
I built the
|
I tested with the master version and the problem persists here. |
@rodrigo-brito I pushed a new official version. Please make sure you have @rhiaxion thanks for all the help with the PRs. Let me know if there are any issues with your setup as well. |
I'm trying to understand my issue. I think it is related to another problem, I will try to debug better and fix it. Thank you @donny-dont |
@rodrigo-brito happy to try and help whenever you have more information. I'll probably close this issue once @rhiaxion confirms but please feel free to open another if there's an issue you find. |
Ok, thank you! |
Switched back to the Docker Hub |
Though ours is a public repo but we recently started to face this problem on our GitLab CI, where we are using
We are writing the access token to |
I have the same problem. I use the original repository code and make a new image based on the tarampampam/node image. FROM tarampampam/node:12.22-alpine
ADD release/linux/amd64/drone-npm /bin/
CMD ["/bin/drone-npm"]
The npm version under this implementation can be controlled at version 6. |
I seem to experience the issue in the original post, I tried (temporarily) downgrading but 1.0.0 doesn't work for me either (auth works but publish results in a timeout). Docker Hub says the latest version is:
Publishing works when running locally, the image digests i'm getting from I don't understand why I'm not getting the image that's on dockerhub? Full output from server1 | latest: Pulling from plugins/npm 2 | Digest: sha256:4f0ad309dd7438248ff3323439cc79f259b6bf7064d847766d769e0b440aec7a 3 | Status: Image is up to date for plugins/npm:latest 4 | time="2022-11-15T14:28:27Z" level=info msg="Specified credentials" email=npm@mydomain.com username=myusername 5 | time="2022-11-15T14:28:27Z" level=info msg="Found package.json" name=@mynamespace/mypackage path=package.json version=2.0.0 6 | time="2022-11-15T14:28:27Z" level=info msg="Specified credentials" email=npm@mydomain.com username=myusername 7 | time="2022-11-15T14:28:27Z" level=info msg="Writing npmrc" path=/root/.npmrc 8 | + npm --version 9 | 8.1.3 10 | + npm config set registry https://npm.mydomain.com 11 | + npm config set always-auth true 12 | + npm whoami 13 | npm ERR! code ENEEDAUTH 14 | npm ERR! need auth This command requires you to be logged in. 15 | npm ERR! need auth You need to authorize this machine using `npm adduser` 16 | 17 | npm ERR! A complete log of this run can be found in: 18 | npm ERR! /root/.npm/_logs/2022-11-15T14_28_31_617Z-debug.log 19 | time="2022-11-15T14:28:31Z" level=error msg="execution failed: could not authenticate: exit status 1" Any hints on how to debug this further would be greatly appreciated. |
The recent changes in this plugin caused an update from NPM 6 to NPM 8.
From NPM 7 the auth to private registries was changed (npm client issue reported here)
We are prevented from any form of rollback in our CI system as this plugin does not have any recent release version tags for the docker image.
The following error was encountered after no configuration changes were made to the release and the token used has been confirmed as valid. Using the
skip_whoami
setting only led to the same error during thenpm publish
step.EDIT: The auth issue is caused when the
<registry>:_authToken=
line in the.npmrc
includes a standard http port 80 or 443 in the registry URL. When performing annpm login
using the npm client with a registry URL containing a port the port is stripped from the generated<registry>:_authToken=
line. This plugin writes the registry URL into the.npmrc
without edit and so registry URLs containing ports are not supported during authentication using the client.Valid config:
Invalid config:
The text was updated successfully, but these errors were encountered: