[Solved] Error during upgrade: Could not update local repository. Contact support

Actual Behaviour:

Running pihole -up finish with this error:
Could not update local repository. Contact support.
Debugging the command shows this:

+ printf '%b  %b %s\n' '\r' '[✓]' 'Check for existing repository in /etc/.pihole'
  [✓] Check for existing repository in /etc/.pihole
+ update_repo /etc/.pihole
+ local directory=/etc/.pihole
+ local curdir
+ local 'str=Update repo in /etc/.pihole'
+ curdir=/root
+ cd /etc/.pihole
+ printf '  %b %s...' '[i]' 'Update repo in /etc/.pihole'
  [i] Update repo in /etc/.pihole...+ git stash --all --quiet
+ git clean --quiet --force -d
+ git pull --quiet
+ return 1
+ printf '\n  %b: Could not update local repository. Contact support.%b\n' '' ''

  : Could not update local repository. Contact support.
+ exit 1

Debug Token:

nsvrit4h8e

Your local git repository is not clean. Run:

cd /etc/.pihole
sudo git status
root@ct101-pihole:~# pihole -up
  [i] Checking for updates...
  [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.
root@ct101-pihole:~# cd /etc/.pihole/
root@ct101-pihole:/etc/.pihole# git status
Auf Branch master
Ihr Branch ist zu 'origin/master' um 3685 Commits hinterher, und kann vorgespult werden.
  (benutzen Sie "git pull", um Ihren lokalen Branch zu aktualisieren)
nichts zu committen, Arbeitsverzeichnis unverändert
root@ct101-pihole:/etc/.pihole# git pull
Aktualisiere 8d85d46..e967fe2

To translate the output shortly:
My branch is outdated, using "git pull" to update local branch.

Updating local branch manually worked, but what is next step?

pihole -up

That would be too simply and I already tried this of course.
But to document the issue I repeated the steps again:

root@ct101-pihole:~# cd /etc/.pihole/

root@ct101-pihole:/etc/.pihole# git status
Auf Branch master
Ihr Branch ist zu 'origin/master' um 3685 Commits hinterher, und kann vorgespult werden.
  (benutzen Sie "git pull", um Ihren lokalen Branch zu aktualisieren)
nichts zu committen, Arbeitsverzeichnis unverändert

root@ct101-pihole:/etc/.pihole# git pull
Aktualisiere 8d85d46..e967fe2

root@ct101-pihole:/etc/.pihole# pihole -up
  [i] Checking for updates...
  [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.

@devs what about removing this file before?

/etc/.pihole/.git/index.lock
2 Likes

That's the solution!
pihole -up is now running w/o errors.

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