Deploy is not building from GitHub Push

I have a site that was building fine up until my most recent updates – I rarely update. The updates build find locally. I can push the updates to GitHub. Netlify is not deploying the updates from GitHub. The site builds cleanly locally via blogdown to build a hugo static site.

The log from Netlify deploy reads:

  • failed to extract cache
  • and
  • git ref refs/heads/master does not exist or you do not have permissions.

I am confused.

I read Netlifly documentation: [ build hooks, site deploys, troubleshooting tips, Manage build dependencies, etc. ]. I re-red “Blogdown + Netlify” documentation, and compared this non-deploying instance to a currently building (working/updating) instance.

I’m drawing blanks. Can you please help.?

The Error message at Netlfy > Deploy is…

1:08:28 PM: Build ready to start
1:08:30 PM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12
1:08:30 PM: build-image tag: v2.8.2
1:08:30 PM: buildbot version: 45cd00068410d70db72c9672cdd014995488e12a
1:08:30 PM: Fetching cached dependencies
1:08:30 PM: Starting to download cache of 254.9KB
1:08:30 PM: Finished downloading cache in 99.11849ms
1:08:30 PM: Starting to extract cache
1:08:30 PM: Failed to fetch cache, continuing with build
1:08:30 PM: Starting to prepare the repo for build
1:08:30 PM: git ref refs/heads/master does not exist or you do not have permission
1:08:30 PM: Failing build: Failed to prepare repo
1:08:30 PM: failed during stage 'preparing repo': git ref refs/heads/master does not exist

My non-deploying site exists in a previously deployed state and was recently being automatically deployed from git push to the associated GitHub repository

The GitHub Webhooks page looks like this:

More Problems ???

At one point I was comparing this deploy to yet another different Netlify build that does not use Hugo. At that point I tried to institute build hooks – this may have been a mistake. I have since removed the build hooks. There is still a deploy key that I cannot seem to delete:

Can you please help me reset my github hugo site to build and deploy at Netlify when I trigger with a git push from my LFS?

Thanks for reading this far.

The GitHub Webhooks page looks like this:

Did you set up these webhooks & the netlify deploy process manually or did you use app.netlify.com to connect your repo & setup the build process?

If this was setup manually, you will need to have a deploy key https://github.com/owner/reponame/settings/keys setup as well. Netlify API documentation

1 Like

Hi @DavidWells. I set this up using app.netlify.com

Hmmm interesting.

Have you tried disconnecting the website & trying again?

It seems like something is wrong with the repo setup & webhook connection.

Connect with the GitHub Apps - Netlify · GitHub

1 Like

I would be happy to try that. I may have done it once but I would love to do it in a very official way.

I hate to ask but can you point me to documentation on disconnecting the website? Maybe I didn’t do everything correctly when I did try?

Similarly, I’m looking at this documentation for connecting, but I assume I can skip step 1. And I’m not sure how to get to step 2.

Sorry to be so thick. I’m finding this difficult.

Well, scratch that. I managed to accomplish it. The steps are a little fuzzy – not sure I can remember exactly what I did but I’ll try to document what I did.

  1. at Github.com > pick repo > Settings > Integrations > Netlify > Configure > scroll down to Repository access, then x (delete) the offending repository

This disconnects GitHub repo from Netlify

  1. at appl.netlify.com > pick repo > Settings > Build & Deploy > Build settings > Edit settings > Link to different repository > choose the repo needed

Hopefully I got all the steps. There’s a lot of menu maze so I may have missed something. But, I think I got it – and it’s definitely working now.

THANKS Netlify Support!!!

2 Likes

thank YOU for posting your solution, @libjohn! There are only ~8 of us for ALL of Netlify customers worldwide (hundreds of thousands of deploys…) and we need people like you to share their solutions as much as possible to keep our free tier free :smiley:

1 Like