hmm, preparing repo usually means that we are having trouble connecting to your git hosting for some reason, which is confusing because it does seem to work for you when you clear the cache and deploy
Seems like you already checked this article, yes?
do you have the situation described in bullet point 6?
Not sure we are doing anything like point 6, its a regular docusaurus build, it seems to work most of the time and has only recently started failing on every merge to master.
I’m experiencing the same problem. Deploys fail with a very similar log as above. If I login and manually clear cache and deploy it works.
10:10:21 AM: build-image version: a6bb34428a07e7de82f4df5dfe1843fbde91f670 (focal)
10:10:21 AM: build-image tag: v4.5.1
10:10:21 AM: buildbot version: 5284b4d1b8b4cf691b29019968d8e4eb3089acdd
10:10:21 AM: Fetching cached dependencies
10:10:21 AM: Failed to fetch cache, continuing with build
10:10:21 AM: Starting to prepare the repo for build
10:10:22 AM: git ref refs/heads/master does not exist or you do not have permission
10:10:22 AM: Did you change the name of your production branch? Don't forget to update your settings: https://docs.netlify.com/site-deploys/overview/#branches-and-deploys
10:10:22 AM: Creating deploy upload records
10:10:22 AM: Failing build: Failed to prepare repo
10:10:22 AM: Failed during stage 'preparing repo': git ref refs/heads/master does not exist
10:10:22 AM: Finished processing build request in 1.148082969s
Are you still waiting to roll out the possible solution? Can you do it for us?
Interesting, we’re not seeing anything additional logs that might be showing the cause of the error. Are you still seeing this issue? Does it occur if you create a new site or re-connect this site to the repo?
Could you try to deploy a different site for testing without the Gatsby cache plugin? I believe there’s some wrong going on with your site’s build cache and removing the cache modifying plugin would be the first way to go.
We’re having the same issue. First build from API fails, with a subsequent manual deploy succeeding.
If we trigger the deploy via the API a few seconds after the initial script finishing, it also works.
This is for a Sanity deployment. We have used the exact same process for a Gatsby site without issue for 2+ years.
First deploy via API (triggered by configuring site): 61fcf5b64b4f808609cd33db
Second deploy via API (triggered by createSiteBuild): 61fcf5d50ba0308212d70e88