Can't update: Error: Local revision could not be obtained

Expected Behaviour:

Update with command pihole -up
-operating system DietPi 8.1.2
-hardware]_ RPi 3B

Actual Behaviour:

When running pihole -up the process aborts with following error message:

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

  [i] Checking for updates...
error: refs/tags/2.0 does not point to a valid object!
error: refs/tags/2.8 does not point to a valid object!
error: refs/tags/V2.5.1 does not point to a valid object!
error: refs/tags/V2.9.1 does not point to a valid object!
error: refs/tags/V2.9.2 does not point to a valid object!
error: refs/tags/v2.1 does not point to a valid object!
error: refs/tags/v2.10 does not point to a valid object!
error: refs/tags/v2.10.1 does not point to a valid object!
error: refs/tags/v2.10.2 does not point to a valid object!
error: refs/tags/v2.11 does not point to a valid object!
error: refs/tags/v2.11.1 does not point to a valid object!
fatal: offset beyond end of pack index for .git/objects/pack/pack-c2a7e85c6e0c9b04f9fb70c5d4eef9002fc80229.pack (truncated index?)
fatal: offset beyond end of pack index for .git/objects/pack/pack-c2a7e85c6e0c9b04f9fb70c5d4eef9002fc80229.pack (truncated index?)
fatal: offset beyond end of pack index for .git/objects/pack/pack-c2a7e85c6e0c9b04f9fb70c5d4eef9002fc80229.pack (truncated index?)

  Error: Local revision could not be obtained, please contact Pi-hole Support
  Additional debugging output:
On branch master
Your branch is behind 'origin/master' by 4 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean

Tried pihole checkout master and it fails too with following error message:

[i] Shortcut "master" detected - checking out master branches...
  [i] Pi-hole core
error: refs/tags/2.0 does not point to a valid object!
error: refs/tags/2.8 does not point to a valid object!
error: refs/tags/V2.5.1 does not point to a valid object!
error: refs/tags/V2.9.1 does not point to a valid object!
error: refs/tags/V2.9.2 does not point to a valid object!
error: refs/tags/v2.1 does not point to a valid object!
error: refs/tags/v2.10 does not point to a valid object!
error: refs/tags/v2.10.1 does not point to a valid object!
error: refs/tags/v2.10.2 does not point to a valid object!
error: refs/tags/v2.11 does not point to a valid object!
error: refs/tags/v2.11.1 does not point to a valid object!
fatal: offset beyond end of pack index for .git/objects/pack/pack-c2a7e85c6e0c9b04f9fb70c5d4eef9002fc80229.pack (truncated index?)
  [✗] Unable to pull Core master branch

Debug Token:

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

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

Thanks a lot, that helped. I guess I have an updated version now apart from the web interface that is stuck on 5.10.1, but I am still getting an error when running pihole -up:

[i] Checking for updates...
[i] Pi-hole Core:     up to date
error: bad object header
error: unknown object type -1 at offset 904104 in .git/objects/pack/pack-209af37de6a0166e23d13ee81f04e16984d2ee7f.pack
fatal: packed object f5e01e2d15b295e3a7ddbf248df97239f715ade9 (stored in .git/objects/pack/pack-209af37de6a0166e23d13ee81f04e16984d2ee7f.pack) is corrupt
[i] Web Interface:    up to date
[i] FTL:              up to date

pihole -v :

Pi-hole version is v5.9-1-g9be5199f (Latest: v5.9)  
AdminLTE version is v5.10.1 (Latest: v5.11)  
FTL version is v5.14 (Latest: v5.14)

Try

sudo rm -rf /var/www/html/admin
sudo git clone https://github.com/pi-hole/AdminLTE.git /var/www/html/admin

Thanks a lot for your help! No more errors with pihole -up or pihole -v

  Pi-hole version is v5.9-1-g9be5199f (Latest: v5.9)
  AdminLTE version is v5.11-1-gb57ff6ae (Latest: v5.11)
  FTL version is v5.14 (Latest: v5.14)

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