Yarn/NPM install hangs in Bitbucket Cloud Pipelines
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
The purpose of this article is to detail why this issue may have started occurring when executing your builds and provide suggestions for troubleshooting this.
Environment
Executing yarn/npm install commands in a build within the Bitbucket Cloud Pipelines platform.
Diagnosis
Yarn/NPM install commands are suddenly taking longer to execute builds, which may even cause build timeouts.
Cause
The most common cause behind this issue is related to dependencies, if there is an issue with installing a particular dependency as part of the Yarn/NPM install process - this can cause the install process to hang or even loop indefinitely.
This can be caused by an update to a build image/dependency that makes your current dependency version no longer compatible with your build environment.
UPDATE: As of July 24, 2024 - we have received a number of reports from users encountering this issue when using Node as the build image:
This is not a Pipelines platform-specific problem. The same slowness symptoms have been reported by other users outside of Atlassian.
The likely issue, as described in this GitHub thread, is related to older versions of the Puppeteer dependency (<22.1.0).
The Puppeteer development team has recently changed download endpoints in PR #11923, which means versions of Puppeteer prior to 22.1.0 are using the old URL.
The reason for this slowness is that the server does not close the connection for the old Puppeteer download URL after the download is complete, causing the install process to hang as a result.
Potential solutions for this are detailed in the solution section below.
Solution
It is recommended that you check your currently installed list of dependencies, and identify which dependency is causing the process to hang by enabling debug logging during the install process:
ℹ️ NOTE: The commands below include both Yarn and NPM, please select the appropriate command based on the utility you are using:
1 2 3 4 5 6
# Check your installed dependencies yarn list npm list # Enable verbose logging during the install process npm install --loglevel verbose yarn install --verbose
Once you have identified the dependency that is causing the issue, consult with the relevant support forum for the respective developer of that dependency/platform for further assistance.
ℹ️ UPDATE: As of July 24, 2024 - we have received a number of reports from users encountering this issue when using Node as the build image (see Cause section above) - this can be resolved as follows:
You will need to update your Puppeteer version to at least 22.1.0 by modifying your package.json accordingly:
1
"puppeteer": "^22"
If this is not possible due to the usage of an older version of Node, a workaround for this would be to instead set the base URL to the new download endpoint by using an environment variable:
1
export PUPPETEER_DOWNLOAD_BASE_URL="https://storage.googleapis.com/chrome-for-testing-public"
If the issue you are encountering relates specifically to troubleshooting a third-party build dependency/platform, this falls outside of our support scope - you will need to locate the support forum for the respective developer of that dependency/platform for further assistance.
If you are encountering issues following this documentation - or if the issue appears to be Pipelines platform-specific, please raise a support ticket or a community support ticket for further assistance.
Was this helpful?