-
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] Integrity check fails for azure artifacts (and apparently other private registries) NPM packages #1800
Comments
I'm also getting this with Gemfury's private registry, but the signature is a SHA512 in my case. Both NPM |
Also getting such error with private registry and |
Also getting this with a custom package installed from the github npm registry https://npm.pkg.github.com. Hopefully this is helpful correlation that it seems to be non-npm official registry related. Downgrading from 7.0.0-beta.12 to v6 worked.
Since this is a private package, I'm happy to do a Zoom with any team member and give them access if they are unable to reproduce independently. |
@jayphelps
|
@PaulVrugt sorry, I meant v6.x.x, the current stable release, not a beta for v7 |
We've potentially got a fix for this based on some work @nlf is about to land in a point release. I'll let him follow up though to confirm once we've got that out to have you try to reproduce. |
We released v7.0.0-rc.2 last Friday and it includes some fixes that may relate to this, can you try updating to that version with |
Installed |
@nlf rc.2 solved the issue for me, or at least the problem "went away". Thank you! Unclear why it fixed my issue but not for @leandro-manifesto. That's unfortunate. |
Just to be sure I ran Here is the log: https://gist.github.com/leandro-manifesto/50bffbfb2af4d433630d388310923af3 |
I'll take a look in the morning to see if it is solved for us |
@nlf I've updated to RC2 and I'm afraid the issue remains, just as with @leandro-manifesto |
Hello, @jayphelps. I'd like to pair with you on diagnosing this problem. Is there a convenient time for you tomorrow (Wed, Oct 7) ? (Please include time zone.) |
@bonkydog jayphelps stated that his problem went away with rc2 |
@PaulVrugt Would it be possible to share the tarball and and package.json files downloaded for the packages being reported as corrupt? This might help us figure out what is going on. |
Cool! I'll give it a go and let you know the results |
Hey, tested with I'm just not sure if Gemfury is rejecting the authorization or if it really is a bad url. |
If you |
@nlf It seems indeed to be an authentication issue. We get a 401 response while trying to download packages from our private registry. We use the the documentation in Azure devops states:
Then, run vsts-npm-auth to get an Azure Artifacts token added to your user-level .npmrc file
|
I'm not familiar with that package at all, and I'm unable to find any code that I could review, so I'm not sure. Do you know if there are implementation details documented anywhere? How does it modify the |
I can't find any information about it either. I'll post a topic in the microsoft github about it and link it here. The |
It doesn't add a line like If not, and it's not doing something like replacing the registry url with a proxy that performs the authentication for you, then it's likely the auth is failing because we're not able to figure out how to actually do the authentication because it's not configured anywhere. I think following up with that team is the right way to go. Please do get back to us and we'll see what we can do to help make this work correctly. |
Microsoft issue: |
No it doesn't add anything to the Edit: |
@nlf
and when installing packages, I see that is recognizes the auth, since it lists the same as the above in the log. But the authentication still fails. With the same configuration, npm 6 works like a charm.
So even without the Update:
So I think this means the authentication is set correctly in the |
i think i see a bug in the code.. try removing the path segment of your registry url for the configuration values, but keep it in place for the so
becomes
|
I've tried it, but it seems to make no difference at all. The error remain exactly the same :( |
Thanks for giving it a try, I'll keep looking and see if I can figure out what's going on |
Just to rule out a problem with auth, can I have you try one more thing.. The value after You can decode the base64 with something like:
which will give you a plain text password, after which something like
should print out all the response headers and the status code. If that is also returning a 401 then the issue is outside of the scope of npm, however if that works then it would seem we're mishandling the auth somewhere. |
I have a few days off work right now, but I'll try to give this a go today or tomorrow if my wife and children let me 😉 |
So, I found the time. And following your instructions, see the result of the Curl command below. It returns a 303 with a redirect. When I change the password in the curl command it returns a 401. So the credentials seem to be fine. Edit: When adding the --location flag, it actually follows the redirect and downloads the package
|
ok @PaulVrugt I think we've finally got it. we released 7.0.1 last night, which you can install with the usual please let me know how it goes! |
@nlf you rock! It works now. |
@nlf I'm facing the same issue with npm v7.0.3 here's an output of what I get |
I think Artifactory and friends occasionally suffer from connection reset issues when talking to clients. Given that the requests in question usually have a Content-Length header, my suspicion is that pacote does not verify Content-Length before attempting to validate the file it was given. We see this same problem both with NPM install operations and with a piece of code that uses pacote directly. If the wrong number of bytes are sent there is no way the hash is going to validate, but premature end of stream should be the correct error message, not sha errors. Also parts of npm seem to cache these incomplete files, causing the same problem to happen when running a second time. |
Current Behavior:
We are trying to upgrate to NPM 7, but we run into problems with getting packages from azure artifacts. The following log is shown, when running
npm i --verbose
:Expected Behavior:
I expect the packages to be downloaded correctly, just as they did using npm 6
Steps To Reproduce:
Reference packages to azure artifacts in your package.json. Try to run
npm install
expected:
packages install
actual:
error as shown above
Environment:
The text was updated successfully, but these errors were encountered: