Skip to content
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 pack (via publish via lerna version) returns Bash exited with code '1' #4157

Open
2 tasks done
phun-ky opened this issue Dec 10, 2021 · 0 comments
Open
2 tasks done
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@phun-ky
Copy link

phun-ky commented Dec 10, 2021

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

After upgrading to node@16.13.1 and npm@8.2.0 I keep getting errors when publishing packages:

(npm pack is called initially from lerna)

lerna success published 73 packages
lerna ERR! ZlibError: zlib: invalid block type
lerna ERR!     at Unzip.write (/home/alexander/Workspace/if/ids-core/node_modules/minizlib/index.js:154:22)
lerna ERR!     at Object.write (/home/alexander/Workspace/if/ids-core/node_modules/tar/lib/parse.js:354:57)
lerna ERR!     at Yallist.<anonymous> (/home/alexander/Workspace/if/ids-core/node_modules/minipass/index.js:384:18)
lerna ERR!     at Yallist.forEach (/home/alexander/Workspace/if/ids-core/node_modules/minipass/node_modules/yallist/yallist.js:156:8)
lerna ERR!     at ReadStream.emit (/home/alexander/Workspace/if/ids-core/node_modules/minipass/index.js:383:20)
lerna ERR!     at ReadStream.emit (/home/alexander/Workspace/if/ids-core/node_modules/fs-minipass/index.js:175:22)
lerna ERR!     at ReadStream.write (/home/alexander/Workspace/if/ids-core/node_modules/minipass/index.js:168:12)
lerna ERR!     at ReadStream.[_handleChunk] (/home/alexander/Workspace/if/ids-core/node_modules/fs-minipass/index.js:146:19)
lerna ERR!     at ReadStream.[_onread] (/home/alexander/Workspace/if/ids-core/node_modules/fs-minipass/index.js:123:32)
lerna ERR! lerna zlib: invalid block type
##[error]Bash exited with code '1'.
Finishing: Publish packages to Azure Artifacts

All of the packages are published, but this error stops the build pipeline.

It's tracked down to zlib which is used by npm pack: isaacs/minizlib#8 (comment)

I also experienced a different ZlibError before: lerna/lerna#2278, and that solved it by upgrading to node@14.

This issue was introduced when Azure upgraded the Ubuntu 20.04 image to use node@16: actions/runner-images#4446

We cannot downgrade the image our selves, or use the suggested yarn solution mentioned here: lerna/lerna#2278 (comment)

Expected Behavior

With this setup, no errors are returned

Steps To Reproduce

Only reproducable with lerna publish, could it be because the publish package process (pack and publish) is too fast, or not enough time between tasks?

Environment

  • npm: 8.2.0
  • Node: 16.13.1
  • OS: Ubuntu 18.04 and Ubuntu 20.04
  • platform: Lenovo Thinkpad P1 and Azure Devops Ubuntu 20.04 image
  • Lerna 4.0.0
  • npm config:
; "user" config from /home/alexander/.npmrc

; @guybrush:registry = "https://waypoint.myget.org/F/relax/auth/(protected)/npm/" ; overridden by project
; @ids-core:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" ; overridden by project
; @ids-js:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" ; overridden by project
; @ids-react:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" ; overridden by project
; @ids-wc:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" ; overridden by project
; @if-design-components-react:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" ; overridden by project
; @if-design-system:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" ; overridden by project
@relax:registry = "https://waypoint.myget.org/F/relax/auth/(protected)/npm/" 
//pkgs.dev.azure.com/if-it/_packaging/common-external-packages/npm/:_password = (protected) 
//pkgs.dev.azure.com/if-it/_packaging/common-external-packages/npm/:email = (protected) 
//pkgs.dev.azure.com/if-it/_packaging/common-external-packages/npm/:username = "if-it" 
//pkgs.dev.azure.com/if-it/_packaging/common-external-packages/npm/registry/:_password = (protected) 
//pkgs.dev.azure.com/if-it/_packaging/common-external-packages/npm/registry/:username = "if-it" 
//pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/:_password = (protected) 
//pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/:email = (protected) 
//pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/:username = "if-it" 
//pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/:_password = (protected) 
//pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/:email = (protected) 
//pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/:username = "if-it" 
//registry.npmjs.org/:_authToken = (protected) 
email = (protected) 

; "project" config from /home/alexander/Workspace/if/ids-core/.npmrc

@guybrush:registry = "https://waypoint.myget.org/F/relax/auth/(protected)/npm/" 
@ids-core:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" 
@ids-js:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" 
@ids-react:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" 
@ids-wc:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" 
@if-design-components-react:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" 
@if-design-system:registry = "https://pkgs.dev.azure.com/if-it/40e35854-e791-490e-bec8-da33c65c3187/_packaging/if-design-system/npm/registry/" 
always-auth = true 
registry = "https://pkgs.dev.azure.com/if-it/_packaging/common-external-packages/npm/registry/" 

; node bin location = /home/alexander/.nvm/versions/node/v16.13.1/bin/node
; cwd = /home/alexander/Workspace/if/ids-core
; HOME = /home/alexander
; Run `npm config ls -l` to show all defaults.
@phun-ky phun-ky added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

1 participant