I can‘t update my Pi-hole

Hello, I wanted to update my Pi-Hole, but after entering "pihole -up" I got an error message. „Could not update local repository. Contact support.„
Can someone help me?

The only "peculiarity" is that my Raspberry Pi 4B (4GB) does not run with an SD card but with an SSD. I'm not quite sure, but I don't think I've done an update since then. In this configuration, the Pi-Hole has been running for a few weeks without any problems that I would have noticed.

Debug Token:

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

Try Running

sudo rm /etc/.pihole/.git/index.lock

Thanks.
When I try this I get the following message

rm: removing '/etc/.pihole/.git/index.lock' is not possible: file or directory not found

As it says contact support it might be best to wait for a Dev to reply but one more thing you could try is a repair-

sudo pihole -r

That helped at least a little bit, after the repair FTL could be updated, otherwise I still get the same error message. Thanks anyway

Are you still seeing the same error message after repairing?

If you are, please generate a new debug log.

unfortunately yes
https://tricorder.pi-hole.net/5teLU5fT/

On the command line:

Run

cd /etc/.pihole

Now, execute these 3 commands below:

git describe --tags --abbrev=0
git rev-parse --abbrev-ref HEAD
git describe --long --dirty --tags --always

Post the output for each one (including error messages, if any).

In case it is useful as a reference, I get an error when running those commands here on a Pi-hole which does update without any problems.

fatal: detected dubious ownership in repository at '/etc/.pihole'
To add an exception for this directory, call:

	git config --global --add safe.directory /etc/.pihole

This error occurs with newer versions of git. We haven't decided how to work around this.

Okay, i get the following output

pi@raspberrypi:~ $ cd /etc/.pihole
pi@raspberrypi:/etc/.pihole $ git describe --tags --abbrev=0
fatal: detected dubious ownership in repository at '/etc/.pihole'
To add an exception for this directory, call:

    git config --global --add safe.directory /etc/.pihole

pi@raspberrypi:/etc/.pihole $ git rev-parse --abbrev-ref HEAD
fatal: detected dubious ownership in repository at '/etc/.pihole'
To add an exception for this directory, call:

    git config --global --add safe.directory /etc/.pihole

pi@raspberrypi:/etc/.pihole $ git describe --long --dirty --tags --always
fatal: detected dubious ownership in repository at '/etc/.pihole'
To add an exception for this directory, call:

    git config --global --add safe.directory /etc/.pihole

pi@raspberrypi:/etc/.pihole $

If I understand correctly, the following command should help:

sudo git config --global --add safe.directory /var/www/html/admin

I have entered the command and tried again to perform an update, here now the entire output of the error message during the update.

[✓] Update local cache of available packages
[i] Existing PHP installation detected : PHP version 7.4.33
[✓] Checking for git
[✓] Checking for iproute2
[✓] Checking for dialog
[✓] Checking for ca-certificates

[i] Checking for updates...
error: refs/tags/v5.14.2 zeigt auf kein gültiges Objekt!
error: refs/tags/v5.14.2 zeigt auf kein gültiges Objekt!
error: refs/tags/v5.14.2 zeigt auf kein gültiges Objekt!
error: refs/tags/v5.14.2 zeigt auf kein gültiges Objekt!
[i] Pi-hole Core: update available
[i] Web Interface: update available
[i] FTL: up to date

[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.

Still unchanged, only the repair has led to the FTL could be updated.

After all this now again a current debug log
https://tricorder.pi-hole.net/vkQFig5q/

Try to nuke and re-clone the repo. Afterwards run pihole -r

sudo rm -rf /etc/.pihole
sudo git clone https://github.com/pi-hole/pi-hole /etc/.pihole

Okay, but before I do that, do I see correctly that this will also delete all settings? If so, will they be restored if I make a backup via the webinterface before and restore it afterwards?

This won't touch you settings, as they reside in /etc/pihole and not /etc/.pihole/

But sure, taking a backup first is always a good idea.

Thank you very much.
This has helped.

After deleting and restoring the repos, with then repairing it, I was able to update.
However, I have twice entered the pihole -up command. The first time the web interface was not updated, there were changes found. After the second update everything seems to run and there were no more hints after the update.

So thanks again for the fast and great help.

1 Like

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