Error: Local revision could not be obtained, please contact Pi-hole Support

Expected Behaviour:

sudo pihole -up command failed with error data stream error (incorrect header check)
I followed the w/a mentioned at Update Error - #23 by DanSchaper but still blocked to update pihole:

I ran sudo Pihole -r and then tried to update with sudo pihole -r but still the same error.

_  ~ sudo PIHOLE_SKIP_OS_CHECK=true pihole -r

  [_] Root user check

        .;;,.
        .ccccc:,.
         :cccclll:.      ..,,
          :ccccclll.   ;ooodc
           'ccll:;ll .oooodc
             .;cll.;;looo:.
                 .. ','.
                .',,,,,,'.
              .',,,,,,,,,,.
            .',,,,,,,,,,,,....
          ....''',,,,,,,'.......
        .........  ....  .........
        ..........      ..........
        ..........      ..........
        .........  ....  .........
          ........,,,,,,,'......
            ....',,,,,,,,,,,,.
               .',,,,,,,,,'.
                .',,,,,,'.
                  ..'''.

  [i] SELinux not detected
  [_] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 8.2.24

  [_] Checking apt-get for upgraded packages... 11 updates available
  [i] It is recommended to update your OS after installing the Pi-hole!

  [i] Checking for / installing Required dependencies for OS Check...
  [_] Checking for grep
  [_] Checking for dnsutils

  [i] PIHOLE_SKIP_OS_CHECK env variable set to true - installer will continue
  [i] Checking for / installing Required dependencies for this install script...
  [_] Checking for git
  [_] Checking for iproute2
  [_] Checking for dialog
  [_] Checking for ca-certificates

  [i] Repair option selected
  [i] Performing reconfiguration, skipping download of local repos
  [_] Resetting repository within /etc/.pihole...
  [_] Resetting repository within /var/www/html/admin...
  [i] Checking for / installing Required dependencies for Pi-hole software...
  [_] Checking for cron
  [_] Checking for curl
  [_] Checking for iputils-ping
  [_] Checking for psmisc
  [_] Checking for sudo
  [_] Checking for unzip
  [_] Checking for idn2
  [_] Checking for libcap2-bin
  [_] Checking for dns-root-data
  [_] Checking for libcap2
  [_] Checking for netcat-openbsd
  [_] Checking for procps
  [_] Checking for jq
  [_] Checking for lighttpd
  [_] Checking for php8.2-common
  [_] Checking for php8.2-cgi
  [_] Checking for php8.2-sqlite3
  [_] Checking for php8.2-xml
  [_] Checking for php8.2-intl

  [i] Enabling lighttpd service to start on reboot...
_  ~ uname -a
Linux raspberrypi 6.6.51+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux
_  ~ cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
_  ~ pihole -v
  Pi-hole version is v5.18.3 (Latest: v5.18.3)
  web version is v5.21 (Latest: v5.21)
  FTL version is v5.25.2 (Latest: v5.25.2)
_  ~

Actual Behaviour:

_  ~ sudo pihole -up
  [_] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 8.2.24
  [_] Checking for git
  [_] Checking for iproute2
  [_] Checking for dialog
  [_] Checking for ca-certificates

  [i] Checking for updates...
error: inflate: data stream error (incorrect header check)
error: failed to read delta base object 11679a5188c1e29fcaa13fa5c29204443349a794 at offset 52865 from .git/objects/pack/pack-619d6a15dbad035a2e61aff74f41d11c07ecf04c.pack
fatal: packed object 80091232a767efd28277e90e008c643266e06577 (stored in .git/objects/pack/pack-619d6a15dbad035a2e61aff74f41d11c07ecf04c.pack) is corrupt
error: inflate: data stream error (incorrect header check)
error: failed to read delta base object 11679a5188c1e29fcaa13fa5c29204443349a794 at offset 52865 from .git/objects/pack/pack-619d6a15dbad035a2e61aff74f41d11c07ecf04c.pack
fatal: packed object 80091232a767efd28277e90e008c643266e06577 (stored in .git/objects/pack/pack-619d6a15dbad035a2e61aff74f41d11c07ecf04c.pack) is corrupt

  Error: Local revision could not be obtained, please contact Pi-hole Support
  Additional debugging output:
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Debug Token:

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

I found the steps to solve the problem, it looks like my SD card was having some problems due to some data inconsistencies.

  1. First I tried to use pihole cli to do the git check out, unfortunately core and pihole were not updated since the git tree was compromised.
~ sudo pihole checkout core master
  Please note that changing branches severely alters your Pi-hole subsystems
  Features that work on the master branch, may not on a development branch
  This feature is NOT supported unless a Pi-hole developer explicitly asks!
  Have you read and understood this? [y/N] y

  [i] Fetching branches from https://github.com/pi-hole/pi-hole.giterror: inflate: data stream error (incorrect header check)
fatal: packed object de5e6e41639e45fae25876d00ce2e26bae299cad (stored in .git/objects/pack/pack-619d6a15dbad035a2e61aff74f41d11c07ecf04c.pack) is corrupt
  [_] Fetching branches from https://github.com/pi-hole/pi-hole.git

~ sudo pihole checkout web master
  Please note that changing branches severely alters your Pi-hole subsystems
  Features that work on the master branch, may not on a development branch
  This feature is NOT supported unless a Pi-hole developer explicitly asks!
  Have you read and understood this? [y/N] y

  [_] Fetching branches from https://github.com/pi-hole/web.git
  [i] 17 branches available for Web Admin

  [_] Switching to branch: 'master' from 'refs/heads/master'
  [i] Already up to date.

~ sudo pihole checkout ftl master
  Please note that changing branches severely alters your Pi-hole subsystems
  Features that work on the master branch, may not on a development branch
  This feature is NOT supported unless a Pi-hole developer explicitly asks!
  Have you read and understood this? [y/N] y

  [_] Requested branch "master" is not available
  [i] Available branches for FTL are:
      - codeql
      - development
      - fix/debugging
      - fix/ede_neterr
      - fix/fork_building_1
      - help_indent
      - http2
      - master
      - new/GRAVITY_RESTORED_MESSAGE
      - new/GeoIP
      - new/basic_auth
      - new/editorconfig
      - new/libbacktrace2
      - new/libexecinfo
      - new/lsqlite3
      - new/unwinding
      - new/warn_open_resolver
      - special/CI_development
      - test/self-host
      - tweak/adam42
      - tweak/shm_anywhere
      - update/dnsmasq
  1. I searched again in this forum and found this conversation:
    Can't update: Error: Local revision could not be obtained.
    So, I cloned again the repos used by pihole.
sudo rm -rf /var/www/html/admin/
sudo git clone https://github.com/pi-hole/web.git /var/www/html/admin/
sudo rm -rf /etc/.pihole 
sudo git clone https://github.com/pi-hole/pi-hole /etc/.pihole 
  1. I successfully ran the pihole -up command, I did this as sanity check so future updates will not be blocked.
_  ~ sudo pihole -up
  [_] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 8.2.26
  [_] Checking for git
  [_] Checking for iproute2
  [_] Checking for dialog
  [_] Checking for ca-certificates

  [i] Checking for updates...
  [i] Pi-hole Core:     up to date
  [i] Web Interface:    up to date
  [i] FTL:              up to date

  [_] Everything is up to date!

I hoper the steps are useful to others in this community.