FTL fails to update: .git/objects/pack/pack- object corrupt

Thank you for providing and continuously updating Pi-hole. Things have been great until the below issue updating FTL via pihole -up command. Any help with this is appreciated, but I understand it is not a priority.

Expected Behaviour:

Expect pihole -up to complete update of FTL to latest version

Actual Behaviour:

pi@raspberrypi:~ $ pihole -v
Pi-hole version is v5.2.4 (Latest: v5.2.4)
AdminLTE version is v5.3 (Latest: v5.3.1)
FTL version is v5.3.4 (Latest: v5.5.1)

pi@raspberrypi:~ $ pihole -up
[i] Checking for updates...
[i] Pi-hole Core: up to date
error: unknown object type 0 at offset 507018 in .git/objects/pack/pack-e6b628bd60042e4ab0c8964479202d09117f98e3.pack
fatal: packed object ee7edb5fabb207beaa77b4bc86ba1c79aaa55afd (stored in .git/objects/pack/pack-e6b628bd60042e4ab0c8964479202d09117f98e3.pack) is corrupt
fatal: the remote end hung up unexpectedly
[i] Web Interface: up to date
[i] FTL: update available
[i] FTL out of date, it will be updated by the installer.
[✓] Root user check
[✗] Update local cache of available packages
Error: Unable to update package cache. Please try "apt-get update"
Unable to complete update, please contact Pi-hole Support

Debug Token:

pihole -d
/opt/pihole/piholeDebug.sh: line 1: syntax error near unexpected token (' /opt/pihole/piholeDebug.sh: line 1: c!?uSr▒bXleN6 bps('

Try this to check and potentially fix your local Git version:

cd /etc/.pihole
sudo git status

If the local repository is corrupt, these commands will remove it and replace it with fresh (the nuclear option). Back up your Pi-hole settings with the teleporter (admin GUI > Settings) just in case you end up having to do a more extensive repair (like a reinstall).

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

Status looks okay. I've created a backup (good call), should I run the commands to rebuild (the nuclear option)?

pi@raspberrypi:/etc/.pihole $ sudo git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

    modified:   .stickler.yml
    modified:   CONTRIBUTING.md
    modified:   LICENSE
    modified:   advanced/Scripts/chronometer.sh
    modified:   advanced/Scripts/database_migration/gravity-db.sh
    modified:   advanced/Scripts/list.sh
    modified:   advanced/Scripts/piholeDebug.sh
    modified:   advanced/Scripts/version.sh
    modified:   advanced/Templates/pihole-FTL.service
    modified:   advanced/Templates/pihole.cron
    modified:   advanced/Templates/pihole.sudo
    modified:   advanced/bash-completion/pihole
    modified:   advanced/blockingpage.css
    modified:   advanced/dnsmasq.conf.original
    modified:   advanced/index.php
    modified:   advanced/lighttpd.conf.fedora
    modified:   gravity.sh
    modified:   manpages/pihole-FTL.8
    modified:   test/_debian_9.Dockerfile
    modified:   test/_fedora_31.Dockerfile
    modified:   test/_fedora_32.Dockerfile
    modified:   test/_ubuntu_18.Dockerfile
    modified:   test/_ubuntu_20.Dockerfile
    modified:   test/conftest.py
    modified:   test/test_centos_8_support.py
    modified:   test/test_centos_common_support.py
    modified:   test/test_fedora_support.py
    modified:   test/tox.centos_7.ini
    modified:   test/tox.centos_8.ini
    modified:   test/tox.debian_10.ini

no changes added to commit (use "git add" and/or "git commit -a")

I'll defer a reply to a developer given this output. The installer and Git are not my specific areas of expertise.

Ok, no worries - really appreciate the speedy reply! This was a vanilla install just a few weeks ago, would like to fix it but can always reinstall if needed. Thanks again!

Honestly, looks like you're suffering some file system issues, given the object corrupt message from the .git directory, and the garbage output from running the debug script.

What hardware is this running on? If it is a Raspberry Pi, make sure the power supply you are using is rated for the device, as not having enough power/amperage can cause corruptions like this.

Edit, the output of git status suggests modified files - assuming you've not made any local changes?

It’s running on a raspberry pi zero w. Initial install was done using a micro usb cable for power, I’ve since purchased a dedicated raspberry pi power source.

Given all the corruption issues and errors would it be best to make a new install with new micro sd card? Sounds like best path.

None other than pihole -up

Yeah, I think this is probably the sanest option at this stage - if there are corruptions there - there could be corruptions in any number of places on the SD card. A re-flash will sort it out.

Will do. Many thanks. No point wasting more of your time troubleshooting here. Much appreciated.

Had a new RaspberryPi ZeroW and 16gb micro SD card. Rebuilt pihole using the dedicated power supply, back up and running. Appreciate all the help and it was quick to rebuild.

2 Likes

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