Unable to Update

Expected Behaviour:

Trying to upgrade with failure. On Raspberry PI b+ running latest raspian.

Actual Behaviour:

pi@pihole:~$ pihole -up
/etc/.pihole/automated install/basic-install.sh: line 904: syntax error near unexpected token `then'
pi@pihole:~$

Debug Token:

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

Looks like your installer script is somehow broken as an official release file of course does not contain a syntax error. Team members with access to your debug token can derive it, but until then: Which version of Pi-hole are you running? pihole -v

Since pihole -r will not work for the same reason, you need to download the intact file manually, but at best it should fit your version, hence I'm asking :slightly_smiling_face:.

pi@pihole:~$ pihole -v
Pi-hole version is v4.4 (Latest: v5.0)
AdminLTE version is v4.3.3 (Latest: v5.0)
FTL version is v4.3.1 (Latest: v5.0)
pi@pihole:~$ pihole -r
/etc/.pihole/automated install/basic-install.sh: line 904: syntax error near unexpected token `then'
pi@pihole:~$

Okay, the following should fix it, as long as the installer is the only broken file:

mv '/etc/.pihole/automated install/basic-install.sh'{,_bak} # Backup just in case someone wants to have a closer look
wget https://raw.githubusercontent.com/pi-hole/pi-hole/release/v4.4/automated%20install/basic-install.sh -O '/etc/.pihole/automated install/basic-install.sh'
pihole -up

Better option would be to clone the repo completely. Moving the file inside the git repo will cause the update process to have errors in the future.

Edit: A basic rule of thumb would be to not touch any files in /etc/.pihole, it's a local git repository.

1 Like

pi@pihole:~$ pihole -up
[i] Checking for updates...
[i] Pi-hole Core: update available
error: inflate: data stream error (invalid literal/lengths set)
error: unable to unpack 4f824bec7845c75c60b957f8b44d598d2e2efcc7 header
error: inflate: data stream error (invalid literal/lengths set)
error: unable to unpack 4f824bec7845c75c60b957f8b44d598d2e2efcc7 header
fatal: loose object 4f824bec7845c75c60b957f8b44d598d2e2efcc7 (stored in .git/objects/4f/824bec7845c75c60b957f8b44d598d2e2efcc7) is corrupt
fatal: the remote end hung up unexpectedly
warning: ignoring broken ref refs/remotes/origin/master
warning: ignoring broken ref refs/remotes/origin/master
fatal: ambiguous argument '@{upstream}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
[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.

And indeed the updater seems to fall because of this extra file, probably.

rm '/etc/.pihole/automated install/basic-install.sh_bak'

@DanSchaper
Jep your right, cleaner also since other file could be broken as well. Still git noob here, how do you repair a local repository, at best by pulling the exact same commit state that it is based on?

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

It's fine to pull the master with version 5 as that's what a pihole -r would do and the end goal of this user is to be on version 5.

pi@pihole:~$ pihole -v
Pi-hole version is v5.0 (Latest: v5.0)
AdminLTE version is v4.3.3 (Latest: v5.0)
FTL version is v5.0 (Latest: v5.0)

pihole -up

pi@pihole:~$ pihole -up
[i] Checking for updates...
[i] Pi-hole Core: up to date
error: inflate: data stream error (invalid literal/lengths set)
error: unable to unpack 4f824bec7845c75c60b957f8b44d598d2e2efcc7 header
error: inflate: data stream error (invalid literal/lengths set)
error: unable to unpack 4f824bec7845c75c60b957f8b44d598d2e2efcc7 header
fatal: loose object 4f824bec7845c75c60b957f8b44d598d2e2efcc7 (stored in .git/objects/4f/824bec7845c75c60b957f8b44d598d2e2efcc7) is corrupt
fatal: the remote end hung up unexpectedly
warning: ignoring broken ref refs/remotes/origin/master
warning: ignoring broken ref refs/remotes/origin/master
fatal: ambiguous argument '@{upstream}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
[i] Web Interface: update available
[i] FTL: up to date

[i] Pi-hole Web Admin files out of date, updating local repo.
[✓] Check for existing repository in /var/www/html/admin
[i] Update repo in /var/www/html/admin...
: Could not update local repository. Contact support.
pi@pihole:~$

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

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