sam build error - npm ERR! code Z_DATA_ERROR npm ERR! errno -3 npm ERR! zlib: invalid distance too far back #6530
Labels
blocked/more-info-needed
More info is needed from the requester. If no response in 14 days, it will become stale.
Hello,
We're moving to a new Jenkins and our sam builds are failing with the following error -
npm ERR! code Z_DATA_ERROR npm ERR! errno -3 npm ERR! zlib: invalid distance too far back
I can get past this error with sam build -u from the command prompt, but when I use sam build -u in the jenkins pipeline build step "-u" is ignored and I still get the error.
It looks like using sam build -u in a jenkins pipeline is a known issue (#3965).
Could you point toward some ideas for getting past the npm error?
During one attempt, I used the old instance's nodejs version on a new instance, but there were openssl and libuv conflicts. Instead I continue to use the nodejs version available for Alma.
Details on new instance -
ec2
Alma 9.3
SAM CLI, version 1.105.0
Python 3.9.18
npm: '8.19.4',
node: '16.20.2',
uv: '1.43.0',
zlib: '1.2.11',
openssl: '3.0.7'
The instance being replaced details (where we don't encounter the npm error)
ec2
centOS7
default python - Python 2.7.5
additional python versions in PATH - 3.7.16, 3.8.6_2, 3.9.16
sam version 1.67.0
npm: '8.19.2',
node: '16.18.1',
uv: '1.44.1',
zlib: '1.2.11',
openssl: '1.1.1k',
from the job's log -
Building codeuri: ...../workspace/..../src runtime: nodejs16.x metadata: {'BuildMethod': 'esbuild', 'BuildProperties': {'Minify': True, 'Target': 'es2020', 'Sourcemap': False, 'EntryPoints': ['app.ts']}} architecture: x86_64 functions: TimeDataFunction
Running NodejsNpmEsbuildBuilder:CopySource
Running NodejsNpmEsbuildBuilder:NpmInstall
Build Failed
Error: NodejsNpmEsbuildBuilder:NpmInstall - NPM Failed: npm WARN config production Use
--omit=dev
instead.npm WARN tar zlib: invalid distance too far back
npm WARN tarball cached data for uuid@https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz (sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==) seems to be corrupted. Refreshing cache.
npm WARN tar zlib: invalid distance too far back
npm WARN tarball cached data for strnum@https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz (sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==) seems to be corrupted. Refreshing cache.
.....
npm WARN tarball cached data for tslib@https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz (sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==) seems to be corrupted. Refreshing cache.
npm WARN tarball tarball data for strnum@https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz (sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==) seems to be corrupted. Trying again.
npm WARN tar zlib: invalid distance too far back
npm WARN tarball tarball data for @aws-sdk/eventstream-serde-universal@https://registry.npmjs.org/@aws-sdk/eventstream-serde-universal/-/eventstream-serde-universal-3.226.0.tgz (sha512-Q8viYM1Sv90/yIUqyWNeG1GEvyVlAI3GIrInQcCMC+xT59jS+IKGy2y7ojCvSWXnhf5/HMXKcmG092QsqeKy0Q==) seems to be corrupted. Trying again.
npm ERR! code Z_DATA_ERROR
npm ERR! errno -3
npm ERR! zlib: invalid distance too far back
......
npm ERR! A complete log of this run can be found in:
npm ERR! ...../.npm/_logs2024-01-05T13_56_33_505Z-debug-0.log
added the log -
keep_2024-01-05T13_56_33_505Z-debug-0.log
Thank you!
The text was updated successfully, but these errors were encountered: