-
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] EINTEGRITY errors for some github repos with commit hash #2971
Comments
We fixed the compression level for packing in |
Hi @wraithgar, thanks for the info. I don't think it's due to that, I'm not sure if Obviously, if this is only happens in a rare number of Git repos, it's probably not a priority. I thought I'd submit it in case anyone else has the same issue. If I have time, I'll try to debug it. My gut feeling is that the issue is in npm/pacote, and that the |
Is there a way to do this that doesn't involve nuking and re-creating the package-lock.json file? |
Some findings for us:
Take Take |
We're getting this error on Heroku with version 7.20.3 Local: Intel Core i7, Big Sur 11.4, npm 7.20.3 Package:
I also tried pointing it at a tag which points to the same commit:
It works if we use a version published to npm:
The error when using the github repo:
|
Is it possible this is simply a duplicate of #2846? |
If not a duplicate it's the same family of issues. I'll add this issue to the body of npm/rfcs#525 |
I was having this problem on a intel Mac |
It looks like my example/problem was fixed in NPM v7.11.0
I was having this issue on x86_64 Intel & AMD Ubuntu devices. (I've run these in a Docker container to ensure that you can reproduce these results) 7.10.0 Fails$ docker run --rm -it node:14 sh -c 'npm install -g npm@7.10.0 && npm pack github:geotiffjs/geotiff.js#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2'
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
+ npm@7.10.0
added 58 packages from 23 contributors, removed 243 packages and updated 194 packages in 9.591s
updated npm
npm WARN tarball tarball data for git+ssh://git@github.com/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2 (sha512-enKD3uDXFcNXKLLAnl2dpc2Ps0BXC6DcHmdoCoL9kKBd34E8bZBRHKU++sctp8Cz5qho1Ii7j8GdCVTno7G6jw==) seems to be corrupted. Trying again.
npm WARN tarball tarball data for git+ssh://git@github.com/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2 (sha512-enKD3uDXFcNXKLLAnl2dpc2Ps0BXC6DcHmdoCoL9kKBd34E8bZBRHKU++sctp8Cz5qho1Ii7j8GdCVTno7G6jw==) seems to be corrupted. Trying again.
npm notice
npm notice New major version of npm available! 7.10.0 -> 8.4.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.4.1
npm notice Run npm install -g npm@8.4.1 to update!
npm notice
npm ERR! code EINTEGRITY
npm ERR! sha512-enKD3uDXFcNXKLLAnl2dpc2Ps0BXC6DcHmdoCoL9kKBd34E8bZBRHKU++sctp8Cz5qho1Ii7j8GdCVTno7G6jw== integrity checksum failed when using sha512: wanted sha512-enKD3uDXFcNXKLLAnl2dpc2Ps0BXC6DcHmdoCoL9kKBd34E8bZBRHKU++sctp8Cz5qho1Ii7j8GdCVTno7G6jw== but got sha512-rBh+f8B8N273VbPmeggM3CmvCKdgNLjEvGJh/4RvBIfV18Bn9Xrq8i7W5RjkwUbmMdmvldojOUiCJbW4GWktkg==. (708773 bytes) 7.11.0 Success$ docker run --rm -it node:14 sh -c 'npm install -g npm@7.11.0 && npm pack github:geotiffjs/geotiff.js#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
+ npm@7.11.0
added 60 packages from 23 contributors, removed 243 packages and updated 194 packages in 8.856s
npm notice
npm notice package: geotiff@1.0.0
npm notice === Tarball Contents ===
npm notice 1.1kB LICENSE
npm notice 16.2kB README.md
npm notice 64.0kB dist-browser/decoder.worker.1936c0d9.js
[...Removed to save space] |
this is fixed in npm@8.5.2 where we have stopped evaluating integrity strings for git dependencies |
@nlf I am on a mono-repo where in the cicd pipeline some dependencies are built and packed and then installed into the service. I am facing a similar error where after some retires and warning of tarball integrity it throws an The commit hashes were committed to lock file by building and installing the dependencies into the service on my local setup (mac). The cicd pipeline runs on (linux). The command i am using to install the dependencies in the service in |
Integrity checks are done on tarballs, yes. The creation of tarballs is not guaranteed to always have the same integrity, this is a known limitation of node itself due to the subtly different ways it implements things like compression across architectures. |
Update: This issue explained in my comment seems to have been fixed in v7.11.0 (see my update comment), however, another user has described a similar error in v7.20.3, so I'm unsure whether I should close this issue or leave it open.
Using a git URL in the format
github:geotiffjs/geotiff.js#commit-hash
on NPM v7 fails with sha-512 integrity errors. However, using a branch-name/tag pointing to the same commit works fine.I can't seem to find another Git repo where this is failing (except for forks of geotiff.js), so I think the issue might either with Github repos with periods in their name and/or with
package.json
prepare
scripts.This might be related to #2919 which has a similar title, but their logs and behaviour are different.
I'm fairly certain this is an issue with the CDN, since it doesn't happen in Node v6, and if I use a
get+ssh
URL on a new VM, the code fails before I get a pop-up with aThe authenticity of host 'github.com (140.82.121.3)' can't be established.
Current Behavior:
For the geotiff/geotiff.js repo, using a
git+https://...#commit-hash
URL fails with aEINTEGRITY
error, due to the sha512 error, e.g.Attached logfile: 2021-03-26T14_59_04_649Z-debug.log
The same error occurs if you try to do
npm install
on the URL, or if you use agit+ssh
url, or a shortgithub:
url:github:geotiffjs/geotiff.js#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2
Expected Behavior:
Using NPM v6.14.11, the exact same command works fine.
Additionally, even on NPM v7.7.5, using a branch/tag name works fine: e.g.
npm pack "github:github.com/geotiffjs/geotiff.js.git#v1.0.0"
works on NPMv7, even though tagv1.0.0
points to the same commit.Steps To Reproduce:
On NPM v7.7.5, run the following command:
npm pack "git+https://github.com/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2"
You can also try spinning up an Ubuntu VM using
minipool
:multipass launch --name npm-git-test && multipass shell npm-git-test
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
npm pack github:geotiffjs/geotiff.js#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2
npm install -g npm && npm pack github:geotiffjs/geotiff.js#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2
Environment:
I've tested this on a VM running:
and a desktop running:
The text was updated successfully, but these errors were encountered: