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:
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.
Thanks for very precise debugging details - this is the best report I’ve seen all day, Kudos!
I can see from our internal logs that we are failing to correctly handle your cached repo. Clearing the cache at build time as you have discovered is the only workaround I’m aware of that works reliably, though sometimes it will enable future builds to work as well.
I have linked this thread to the bug report so I can follow up with you when we find a fix!
Sorry but no timeline at present. I can tell you the team is actively investigating, but we haven’t quite tracked down the root cause yet so it would be presumptuous to say there will be a fix or what the timeline might be.
I promise that I have communicated that this is a problem affecting a growing number of customers to the team.
As of yestrerday, we put additional logging in place to try to track down root cause, so I don’t think we need specific reproduction cases or research, since we now see every time it happens in our internal logs.
There are many reasons for that error; only one is covered in this thread and we have fixed the primary cause for this bug as it affected most customer, (sorry @hongaar I forgot to follow up!)
Could you tell us your deploy ID so we can confirm it is this, and not some other, bug?
Not trying to hijack this older thread but we are running into this issue consistently now.
Our current repo set-up was working fine with the netlify CI/CD, and then on what seems to be october 30th we, started getting this behaviour.
This behaviour is consistent: the build always fails. And then if we clear cache and re-deploy it always succeeds (assuming no other unrelated errors)
We’ve tried setting up new deployer, on new account with different keys, and the issue persists. I’ve read a few different community threads about this issue, but not clear to me exactly how twe can troubleshoot further from our end.
Can you give us some pointers? what information from our end would help you look at this internally?
we are using gitmodules, which seem to be one of the common issue in other related threads, but the behaviour is the same whether the git submodule has changed or not in a given deployment.
build ID: 5fe0a877165aa4000744d08az
8:51:51 AM: Build ready to start
8:51:54 AM: build-image version: 53b83b6bede2920f236b25b6f5a95334320dc849
8:51:54 AM: build-image tag: v3.6.0
8:51:54 AM: buildbot version: 8ae026ef4905d9174e416775c6b64aa19950569b
8:51:54 AM: Fetching cached dependencies
8:51:54 AM: Starting to download cache of 177.6MB
8:51:56 AM: Finished downloading cache in 1.577144966s
8:51:56 AM: Starting to extract cache
8:52:03 AM: Finished extracting cache in 6.887758431s
8:52:03 AM: Finished fetching cache in 8.508896795s
8:52:03 AM: Starting to prepare the repo for build
8:52:03 AM: Preparing Git Reference refs/heads/staging
8:52:06 AM: Error fetching branch: https://github.com/[company name]/[repo] refs/heads/staging
8:52:06 AM: Failing build: Failed to prepare repo
8:52:06 AM: Failed during stage ‘preparing repo’: exit status 1
8:52:06 AM: Finished processing build request in 11.840423003s