Failing build: Failed to prepare repo, failed during stage 'preparing repo': exit status 1

This has happened to us a few times now. When I “Clear cache and deploy” it works.

There is nothing in the logs that helps diagnose what the problem is. The same commit builds on Github Pages and locally.

Could someone from Netlify take a look at the internal logs and help us figure out what keeps going wrong? I have searched for this and have seen others with this issue from time to time but no common solution.

Build log:

10:01:07 AM: Build ready to start
10:01:09 AM: build-image version: 2dbd444fcdce00cf06325060a8238d5ae3e86774
10:01:09 AM: build-image tag: v3.3.7
10:01:09 AM: buildbot version: 11918e084194721d200458438c92ff8180b3b56c
10:01:09 AM: Fetching cached dependencies
10:01:09 AM: Starting to download cache of 186.6MB
10:01:10 AM: Finished downloading cache in 705.904095ms
10:01:10 AM: Starting to extract cache
10:01:14 AM: Finished extracting cache in 3.821670198s
10:01:14 AM: Finished fetching cache in 4.586540768s
10:01:14 AM: Starting to prepare the repo for build
10:01:14 AM: Preparing Git Reference refs/heads/master
10:01:15 AM: Failing build: Failed to prepare repo
10:01:15 AM: failed during stage 'preparing repo': exit status 1
10:01:15 AM: Finished processing build request in 6.508433806s

Many thanks

Hi there,
this error can have a couple of different origins. Can you give the below a read through and see if that fixes things for you?

Thanks perry. I’ve read through those three posts and I don’t believe any of those situations apply to me.

Builds locally, builds on Github Actions / Pages, works if I reset the cache. We haven’t committed node_modules or yarn.lock or even a package.json.

Example fail:

The next thing I would check is what version of Hugo you’re using locally, and then set the HUGO_VERSION environment variable in the Netlify UI:

For your site, it will be something like this link:

It currently looks like you have a “v” in the string, which will not work. Want to give that a shot and let us know how it goes?

I believe the ‘v’ is ignored as we have picked that specific Hugo version as the default does not build.

Please could you just look at the logs for that specific build and tell us what happened?

Hi, @maxwedwards, for that particular build there was an error during the clone of the repo itself so it wasn’t anything relating to the build itself which caused the issue for that build.

I do see more recent builds cloning the repo successfully so I don’t think that issue is still occurring. (If it is, please correct me of course.)

The most recent build appears to be a successful deploy of the site. Are there still issues deploying? If so, what are those issues?

Thanks for looking into it Luke.

This issue has happened three times now. Subsequent builds will not fix unless you clear the cache so all future updates to the repo do not force out a good build. It just stays broken until I log into netlify and clear cache.

I’ll keep an eye on it and create another thread if it happens again.

1 Like