Unable to update Pihole (error: cannot lock ref 'refs/tags/v4.3.2': unable to resolve reference...)

The issue I am facing:

Running into this error when I tried to ssh into my raspi4 to update Pihole. Pihole coexists with Homebridge on the same raspi4. The error I get is:

pi@homebridge:~ $ pihole -up
  [i] Checking for updates...
error: cannot lock ref 'refs/tags/v4.3.2': unable to resolve reference 'refs/tags/v4.3.2': reference broken
  [i] Pi-hole Core:     update available
  [i] Web Interface:    update available
  [i] FTL:              update available

  [i] Pi-hole core files out of date, updating local repo.
  [✓] Check for existing repository in /etc/.pihole
  [i] Update repo in /etc/.pihole...
  : Could not update local repository. Contact support.
pi@homebridge:~ $

Details about my system:
Raspi4 model B rev 1.1 running Raspbian v1.0.18
Pi-hole [v5.3.1] Web Interface [v5.5.1] FTL [v5.8.1]

What I have changed since installing Pi-hole:
Nothing other than applying the regular updates to Pihole and Homebridge

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

https://tricorder.pi-hole.net/fIFPwbDL/

There are no errors in your log. However, it is likely that your local git repository is damaged.

Please try

git gc --prune=now
git remote prune origin
git fetch origin

in your /etc/.pihole directory

Appreciate your help here. This is what I got after going through those commands.

pi@homebridge:/etc/.pihole $ sudo git gc --prune=now
fatal: bad object refs/tags/v4.3.2
fatal: failed to run repack
pi@homebridge:/etc/.pihole $ sudo git remote prune origin
pi@homebridge:/etc/.pihole $ sudo git fetch origin
error: cannot lock ref 'refs/tags/v4.3.2': unable to resolve reference 'refs/tags/v4.3.2': reference broken
From https://github.com/pi-hole/pi-hole
 ! [new tag]         v4.3.2     -> v4.3.2  (unable to update local ref)
pi@homebridge:/etc/.pihole $

It's really broken. Let's try the hard way:

sudo -s
cd /root

rm -rf /etc/.pihole
git clone -q --depth 1 https://github.com/pi-hole/pi-hole.git /etc/.pihole

pihole -r

Choose repair

Thanks so much! The war has been won!

After the repair, the pi-hole install and FTL were updated, but the web interface still showed an update. So I ran pihole -up again and the web interface was updated.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.