Update error: unable to resolve reference refs/tags/v4.0: Invalid argument

I am unable to update my pihole.
pihole -up
[i] Checking for updates...
error: unable to resolve reference refs/tags/v4.0: Invalid argument
[i] Pi-hole Core: update available
[i] FTL: update available
[i] Web Interface: up to date

[i] Pi-hole core files out of date
[â] Check for existing repository in /etc/.pihole
[i] Update repo in /etc/.pihole...
Error: Could not update local repository. Contact support.

pihole V brings
pihole -v
Pi-hole version is v3.3.1 (Latest: v4.0)
AdminLTE version is v4.0 (Latest: v4.0)
FTL version is v3.0 (Latest: v4.0)

Please generate and upload a debug log and post the token here. Thanks.

HOW do I generate the debug log and post the token I am new to this whole discord thingy.

You can do this from the command line:

pihole -d

or do it through the Web interface:

Your debug token is: tveqdz1sbh

A few questions:

  1. What platform are you hosting this on? The processor does not show in your debug log.

  2. From the debug log, it doesn't look like blocking is working properly. The first two queries shown should not return the actual IP, since it should be blocked. And, the third query should return the actual IP but does not. Does your Pi-Hole appear to block ads?

    ***[DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
    [✓] th.ad4portal.com is via localhost (
    [✓] th.ad4portal.com is via Pi-hole (
    [✗] Failed to resolve doubleclick.com via a remote, public DNS server (

  3. How much free disk space do you have on the Pi host platform. Paste the output of this command:
    df -h

  4. Please paste the output of this command: dig github.com

  1. Raspberry Pi

  2. Will redo the token since y eah I think I had it off at the time in order to get windows update.
    New Token:Your debug token is: 90eyhitlm8

  3. Filesystem Size Used Avail Use% Mounted on
    /dev/root 30G 4.7G 24G 17% /
    devtmpfs 242M 0 242M 0% /dev
    tmpfs 246M 0 246M 0% /dev/shm
    tmpfs 246M 4.6M 242M 2% /run
    tmpfs 5.0M 4.0K 5.0M 1% /run/lock
    tmpfs 246M 0 246M 0% /sys/fs/cgroup
    /dev/mmcblk0p1 63M 22M 42M 35% /boot
    tmpfs 50M 0 50M 0% /run/user/999
    tmpfs 50M 0 50M 0% /run/user/1000

dig github.com

; <<>> DiG 9.9.5-9+deb8u15-Raspbian <<>> github.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51552
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 8, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 4096
;github.com. IN A

github.com. 25 IN A
github.com. 25 IN A

github.com. 770 IN NS ns-1707.awsdns-21.co.uk.
github.com. 770 IN NS ns3.p16.dynect.net.
github.com. 770 IN NS ns-1283.awsdns-32.org.
github.com. 770 IN NS ns1.p16.dynect.net.
github.com. 770 IN NS ns-520.awsdns-01.net.
github.com. 770 IN NS ns2.p16.dynect.net.
github.com. 770 IN NS ns4.p16.dynect.net.
github.com. 770 IN NS ns-421.awsdns-52.com.

;; Query time: 11 msec
;; WHEN: Tue Aug 14 17:45:21 EDT 2018
;; MSG SIZE rcvd: 291

Please run the following commands for me

  1. sudo rm /etc/pihole/ftlbranch
  2. pihole checkout master

pihole checkout 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] Shortcut "master" detected - checking out master branches...
[i] Pi-hole core
error: unable to resolve reference refs/tags/v4.0: Invalid argument
[â] Unable to pull Core master branch

how do I uninstall and reinstall pihole?

pihole uninstall to remove it (don't remove dependencies if you plan on re-installing)
curl -sSL https://install.pi-hole.net | bash to install/reinstall.

And, if you want to keep your blacklist, whitelist and block lists, export those using teleporter (admin GUI > settings > teleporter). You can directly import all but the block lists into your new install. The block lists will have to be done manually. I would not do any of the importation until you have Pi-Hole up and running in the new install.

[i] Existing PHP installation detected : PHP version 5.6.36-0+deb8u1
[i] Performing unattended setup, no whiptail dialogs will be displayed
[â] Disk space check

[â] Update local cache of available packages

[â] Checking apt-get for upgraded packages... up to date!

[i] Installer Dependency checks...
[â] Checking for apt-utils
[â] Checking for dialog
[â] Checking for debconf
[â] Checking for dhcpcd5
[â] Checking for git
[â] Checking for iproute2
[â] Checking for whiptail

[i] Performing reconfiguration, skipping download of local repos
[â] Resetting repository within /etc/.pihole...
[â] Resetting repository within /var/www/html/admin...
[i] Main Dependency checks...
[â] Checking for bc
[â] Checking for cron
[â] Checking for curl
[â] Checking for dnsutils
[â] Checking for iputils-ping
[â] Checking for lsof
[â] Checking for netcat
[â] Checking for psmisc
[â] Checking for sudo
[â] Checking for unzip
[â] Checking for wget
[â] Checking for idn2
[â] Checking for sqlite3
[â] Checking for libcap2-bin
[â] Checking for dns-root-data
[â] Checking for resolvconf
[â] Checking for lighttpd
[â] Checking for php5-common
[â] Checking for php5-cgi
[â] Checking for php5-sqlite

[â] Enabling lighttpd service to start on reboot
[â] Installing scripts from /etc/.pihole

[i] Installing configs from /etc/.pihole...
[i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
[â] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf

[i] Installing blocking page...
[â] Creating directory for blocking page, and copying files
[â] Backing up index.lighttpd.html
No default index.lighttpd.html file found... not backing up

[â] Installing sudoer file

[â] Installing latest Cron script

[â] Installing latest logrotate script

[i] FTL Checks...
[â] Detected ARM-hf architecture (armv7+)
[i] Checking for existing FTL binary...
[â] Downloading and Installing FTL
Error: Unable to get latest release location from GitHub
[â] FTL Engine not installed
[â] man pages installed and database updated
[i] Systemd-resolved is not enabled
[â] Starting lighttpd service
[â] Enabling lighttpd service to start on reboot
[i] Restarting services...
[i] Starting pihole-FTL service...
Unable to complete update, please contact Pi-hole Support

Edit /etc/resolv.conf to use an external DNS server, then try pihole -r. If it isn't fixed, run pihole -d for a new debug token.

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