We’re seeing consistent build failures across all our deployments for these two sites (which both use the same repository):
The build log tells us something went wrong while ‘preparing’ the repository:
11:27:02 AM: Build ready to start 11:27:04 AM: build-image version: 30f629161c0736b1a3ecd8b418e5eeffab5c0faf 11:27:04 AM: build-image tag: v3.3.14 11:27:04 AM: buildbot version: a383ed3390159974f55f285b04457b44cb49efb0 11:27:04 AM: Fetching cached dependencies 11:27:05 AM: Starting to download cache of 533.9MB 11:27:18 AM: Finished downloading cache in 13.331919866s 11:27:18 AM: Starting to extract cache 11:27:45 AM: Finished extracting cache in 27.281222134s 11:27:45 AM: Finished fetching cache in 40.749238123s 11:27:45 AM: Starting to prepare the repo for build 11:27:46 AM: Preparing Git Reference pull/1143/head 11:27:48 AM: Failing build: Failed to prepare repo 11:27:48 AM: Failed during stage 'preparing repo': exit status 1 11:27:48 AM: Finished processing build request in 43.562272405s
It’s likely a problem with the cache, but we can’t really debug what’s going on. Typically:
- A deploy fails with the log above: 5ee0a766c7c3ff00093452c5
- Then, when retrying this deploy without using the cache, it succeeds: 5ee0a8585cf3efa59d3b7c62
- But the next build which uses the cache fails again: 5ee0aae252f4c4000785d578
It’s a monorepo, so a possibility is that artefacts of our internal dependencies (which are written to the root
node_modules as a symlink) end up in the cache and cause problems when checked out in the next build.
We’ve tried proposed solutions in these posts, without success:
- Failing build: Failed to prepare repo, failed during stage 'preparing repo': exit status 1 - #7 by luke
- [Support Guide] My site deploy fails unless Netlify's build cache is cleared
These are our current build settings:
It’s important to note our setup (using a yarn workspaces managed monorepo) worked perfectly fine with Netlify for a long time and started failing on June 3 with this build: 5ed75ae1bb0bed00070e0791. Since then, the only way for us to get a successful deploy is by retrying without the cache.