Cannot install Pi-Hole

@jfb

pi@raspberrypi:~ $ curl -sSL https://install.pi-hole.net | bash -x

+ set -e
++ cat
+ DNS_SERVERS='Google (ECS);8.8.8.8;8.8.4.4;2001:4860:4860:0:0:0:0:8888;2001:486                       0:4860:0:0:0:0:8844
OpenDNS (ECS);208.67.222.222;208.67.220.220;2620:119:35::35;2620:119:53::53
Level3;4.2.2.1;4.2.2.2;;
Comodo;8.26.56.26;8.20.247.20;;
DNS.WATCH;84.200.69.80;84.200.70.40;2001:1608:10:25:0:0:1c04:b12f;2001:1608:10:25:0:0:9249:d69b
Quad9 (filtered, DNSSEC);9.9.9.9;149.112.112.112;2620:fe::fe;2620:fe::9
Quad9 (unfiltered, no DNSSEC);9.9.9.10;149.112.112.10;2620:fe::10;2620:fe::fe:10
Quad9 (filtered + ECS);9.9.9.11;149.112.112.11;2620:fe::11;
Cloudflare;1.1.1.1;1.0.0.1;2606:4700:4700::1111;2606:4700:4700::1001'
+ installLogLoc=/etc/pihole/install.log
+ setupVars=/etc/pihole/setupVars.conf
+ lighttpdConfig=/etc/lighttpd/lighttpd.conf
+ coltable=/opt/pihole/COL_TABLE
+ webroot=/var/www/html
+ webInterfaceGitUrl=https://github.com/pi-hole/AdminLTE.git
+ webInterfaceDir=/var/www/html/admin
+ piholeGitUrl=https://github.com/pi-hole/pi-hole.git
+ PI_HOLE_LOCAL_REPO=/etc/.pihole
+ PI_HOLE_FILES=(chronometer list piholeDebug piholeLogFlush setupLCD update version gravity uninstall webpage)
+ PI_HOLE_INSTALL_DIR=/opt/pihole
+ PI_HOLE_CONFIG_DIR=/etc/pihole
+ PI_HOLE_BIN_DIR=/usr/local/bin
+ PI_HOLE_BLOCKPAGE_DIR=/var/www/html/pihole
+ useUpdateVars=false
+ adlistFile=/etc/pihole/adlists.list
+ regexFile=/etc/pihole/regex.list
+ IPV4_ADDRESS=
+ IPV6_ADDRESS=
+ QUERY_LOGGING=true
+ INSTALL_WEB_INTERFACE=true
+ PRIVACY_LEVEL=0
+ '[' -z pi ']'
+ '[' -t 0 ']'
+ screen_size='24 80'
+ printf -v rows %d 24
+ printf -v columns %d 80
+ r=12
+ c=40
+ r=20
+ c=70
+ skipSpaceCheck=false
+ reconfigure=false
+ runUnattended=false
+ INSTALL_WEB_SERVER=true
+ [[ -f /opt/pihole/COL_TABLE ]]
+ COL_NC='\e[0m'
+ COL_LIGHT_GREEN='\e[1;32m'
+ COL_LIGHT_RED='\e[1;31m'
+ TICK='[\e[1;32m✓\e[0m]'
+ CROSS='[\e[1;31m✗\e[0m]'
+ INFO='[i]'
+ DONE='\e[1;32m done!\e[0m'
+ OVER='\r\033[K'
+ binary=tbd
+ counter=0
+ [[ '' != true ]]
+ main
+ local 'str=Root user check'
+ printf '\n'

+ [[ 1000 -eq 0 ]]
+ printf '  %b %s\n' '[\e[1;31m✗\e[0m]' 'Root user check'
  [✗] Root user check
+ printf '  %b %bScript called with non-root privileges%b\n' '[i]' '\e[1;31m' '\                       e[0m'
  [i] Script called with non-root privileges
+ printf '      The Pi-hole requires elevated privileges to install and run\n'
      The Pi-hole requires elevated privileges to install and run
+ printf '      Please check the installer for any concerns regarding this requi                       rement\n'
      Please check the installer for any concerns regarding this requirement
+ printf '      Make sure to download this script from a trusted source\n\n'
      Make sure to download this script from a trusted source

+ printf '  %b Sudo utility check' '[i]'
  [i] Sudo utility check+ is_command sudo
+ local check_command=sudo
+ command -v sudo
+ printf '%b  %b Sudo utility check\n' '\r\033[K' '[\e[1;32m✓\e[0m]'
  [✓] Sudo utility check
+ exec curl -sSL https://raw.githubusercontent.com/pi-hole/pi-hole/master/automa                       ted%20install/basic-install.sh
+ sudo bash

  [✓] Root user check

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

  [✓] 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
  [i] Checking for dialog (will be installed)
  [✓] Checking for debconf
  [✓] Checking for dhcpcd5
  [i] Checking for git (will be installed)
  [✓] Checking for iproute2
  [✓] Checking for whiptail
  [i] Using Cloudflare
  [✓] Set IP address to 192.168.2.42
  You may need to restart after the install is complete
  [i] Unable to find IPv6 ULA/GUA address, IPv6 adblocking will not be enabled
  [i] IPv4 address: 192.168.2.42/24
  [i] IPv6 address:
  [i] Web Interface On
  [i] Web Server On
  [i] Logging On.
  [✗] Check for existing repository in /etc/.pihole
  [✓] Clone https://github.com/pi-hole/pi-hole.git into /etc/.pihole

  [✗] Check for existing repository in /var/www/html/admin
  [✓] Clone https://github.com/pi-hole/AdminLTE.git into /var/www/html/admin

  [i] Main Dependency checks...
  [✓] Checking for cron
  [✓] Checking for curl
  [i] Checking for dnsutils (will be installed)
  [✓] Checking for iputils-ping
  [i] Checking for lsof (will be installed)
  [i] Checking for netcat (will be installed)
  [✓] Checking for psmisc
  [✓] Checking for sudo
  [✓] Checking for unzip
  [✓] Checking for wget
  [i] Checking for idn2 (will be installed)
  [i] Checking for sqlite3 (will be installed)
  [✓] Checking for libcap2-bin
  [i] Checking for dns-root-data (will be installed)
  [i] Checking for resolvconf (will be installed)
  [✓] Checking for libcap2
  [i] Checking for lighttpd (will be installed)
  [i] Checking for php-common (will be installed)
  [i] Checking for php-cgi (will be installed)
  [i] Checking for php-sqlite3 (will be installed)
  [✓] Enabling lighttpd service to start on reboot...

  [i] FTL Checks...

  [✓] Detected ARM-hf architecture (armv6 or lower) Using ARM binary
  [i] Checking for existing FTL binary...
  [✗] Downloading and Installing FTL
  Error: Unable to get latest release location from GitHub
  [✗] FTL Engine not installed

that's the whole log of the install. same trouble

All the packages marked for installation, are they actually installed now ?

apt policy lsof netcat idn2 sqlite3 dns-root-data resolvconf lighttpd php-common php-cgi php-sqlite3

EDIT:

And some more:

apt policy dialog git

all installed. i scanned through all of them to make sure they were all listed. i can post the log if you like.

Whats you resolver at the moment ?

cat /etc/resolv.conf

And does it resolve github ?

host github.com

Back in the 127.0.0.1 loop i've been stuck in

pi@raspberrypi:~ $ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#  DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
pi@raspberrypi:~ $ host github.com
;; connection timed out; no servers could be reached
pi@raspberrypi:~ $

Upload a debug log first and post token here for the devs/mods to have a look:

sudo tee /etc/resolv.conf <<< $'nameserver 8.8.8.8'

pihole -d

Probably running repair will fix but maybe the devs/mods have some questions first before you try below:

the pihole command still not working even if we installed with verbose -x

i cant pihole -r or -d still

pi@raspberrypi:~ $ sudo tee /etc/resolv.conf <<< $'nameserver 8.8.8.8'
nameserver 8.8.8.8
pi@raspberrypi:~ $ pihole -d
-bash: pihole: command not found

Sh.t creek :wink:

And dirty:

sudo tee /etc/resolv.conf <<< $'nameserver 8.8.8.8'

sudo wget https://github.com/pi-hole/FTL/releases/download/v4.3.1/pihole-FTL-arm-linux-gnueabi -O /usr/bin/pihole-FTL

sudo chmod +x /usr/bin/pihole-FTL

And run installer again with nameserver hack.

EDIT: sorry, needed nameserver hack before wget too

i think we made progress :slight_smile: although the page for the admin and password etc didn't came up liek i got told. but i will leave that in your hand, next step is pihole -d?

[i] Main Dependency checks...
 [✓] 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 libcap2
 [✓] Checking for lighttpd
 [✓] Checking for php7.3-common
 [✓] Checking for php7.3-cgi
 [✓] Checking for php7.3-sqlite3
 [✓] Enabling lighttpd service to start on reboot...

 [i] FTL Checks...

 [✓] Detected ARM-hf architecture (armv6 or lower) Using ARM binary
 [i] Checking for existing FTL binary...
 [✗] Failed to retrieve latest FTL release metadata  [i] Checking for user 'pih 
 [✓] Creating user 'pihole'
 [✓] Installing scripts from /etc/.pihole

 [i] Installing configs from /etc/.pihole...
 [✓] No dnsmasq.conf found... restoring default dnsmasq.conf...
 [✓] 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] Backing up /etc/dnsmasq.conf to /etc/dnsmasq.conf.old

 [i] Skipping firewall configuration
 [✓] man pages installed and database updated
 [i] Testing if systemd-resolved is enabled
 [i] Systemd-resolved is not enabled
 [✓] Restarting lighttpd service...
 [✓] Enabling lighttpd service to start on reboot...
 [i] Restarting services...
pi@raspberrypi:~ $

Yes do that first so the devs have a reference if need too.
Isnt she running now ?

pihole status

command working now,

pihole -d is debugging but cant put up a token. i tryed to "hack" the nameserver first and it still fail ( return to normal before the question )

[?] Would you like to upload the log? [y/N] y
    * Using curl for transmission.
[✗]  There was an error uploading your debug log.
   * Please try again or contact the Pi-hole team for assistance.
   * A local copy of the debug log can be found at: /var/log/pihole_debug.log

for pihole status i got this

pi@raspberrypi:~ $ pihole status
  [✗] DNS service is NOT running

PM this log to me.

edit in nano and copy paste? or there is a better method ?

Use the command cat /var/log/pihole_debug.log and copy that entire output into a message to me.

EDIT: below is wrong, previous posting with binary was the correct one for Pi Zero.

I noticed my mistake, I supplied you with the wrong binary.
Below one is the correct one:

sudo tee /etc/resolv.conf <<< $'nameserver 8.8.8.8'

sudo wget https://github.com/pi-hole/FTL/releases/download/v4.3.1/pihole-FTL-arm-linux-gnueabihf -O /usr/bin/pihole-FTL

sudo chmod +x /usr/bin/pihole-FTL

sudo service pihole-FTL restart

pihole status

i guess i will need a -r or a install again?

pi@raspberrypi:~ $ sudo chmod +x /usr/bin/pihole-FTL
pi@raspberrypi:~ $ sudo service pihole-FTL restart
Failed to restart pihole-FTL.service: Unit pihole-FTL.service not found.
pi@raspberrypi:~ $ pihole status
  [✗] DNS service is NOT running
pi@raspberrypi:~ $

Yes try repair pihole -r with nameserver hack.

Debug log after failed install


*** [ INITIALIZING ]
[i] 2019-12-03:00:30:09 debug log has been initialized.

*** [ INITIALIZING ] Sourcing setup variables
[i] Sourcing /etc/pihole/setupVars.conf...

*** [ DIAGNOSING ]: Core version
[i] Core: v4.3.2 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)
[i] Branch: master
[i] Commit: v4.3.2-0-ge41c4b5

*** [ DIAGNOSING ]: Web version
[i] Web: v4.3.2 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)
[i] Branch: master
[i] Commit: v4.3.2-0-g38d8e77

*** [ DIAGNOSING ]: FTL version
[✓] FTL: v4.3.1

*** [ DIAGNOSING ]: lighttpd version
[i] 1.4.53

*** [ DIAGNOSING ]: php version
[i] 7.3.11

*** [ DIAGNOSING ]: Operating system
[✓] Raspbian GNU/Linux 10 (buster)

*** [ DIAGNOSING ]: SELinux
[i] SELinux not detected

*** [ DIAGNOSING ]: Processor
[✓] armv6l

*** [ DIAGNOSING ]: Networking
[✓] IPv4 address(es) bound to the eth0 interface:
   192.168.2.42/24 matches the IP found in /etc/pihole/setupVars.conf

[✓] IPv6 address(es) bound to the eth0 interface:
   fe80::7500:18d:a8dc:b0f8 does not match the IP found in /etc/pihole/setupVars                                                                                                                                                             .conf (https://discourse.pi-hole.net/t/use-ipv6-ula-addresses-for-pi-hole/2127)

   ^ Please note that you may have more than one IP address listed.
   As long as one of them is green, and it matches what is in /etc/pihole/setupV                                                                                                                                                             ars.conf, there is no need for concern.

   The link to the FAQ is for an issue that sometimes occurs when the IPv6 addre                                                                                                                                                             ss changes, which is why we check for it.

[i] Default IPv4 gateway: 192.168.2.1
   * Pinging 192.168.2.1...
[✓] Gateway responded.

*** [ DIAGNOSING ]: Ports in use
*:22 sshd (IPv4)
*:22 sshd (IPv6)
[*:80] is in use by lighttpd
[*:80] is in use by lighttpd

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

*** [ DIAGNOSING ]: Pi-hole processes
[✓] lighttpd daemon is active
[✗] pihole-FTL daemon is inactive

*** [ DIAGNOSING ]: Setup variables
    PIHOLE_INTERFACE=eth0
    IPV4_ADDRESS=192.168.2.42/24
    IPV6_ADDRESS=
    PIHOLE_DNS_1=1.1.1.1
    PIHOLE_DNS_2=1.0.0.1
    QUERY_LOGGING=true
    INSTALL_WEB_SERVER=true
    INSTALL_WEB_INTERFACE=true
    LIGHTTPD_ENABLED=true

*** [ DIAGNOSING ]: Dashboard and block page
[✗] Block page X-Header: X-Header does not match or could not be retrieved.
HTTP/1.1 200 OK
Content-type: text/html; charset=UTF-8
Date: Mon, 02 Dec 2019 19:30:19 GMT
Server: lighttpd/1.4.53

[✓] Web interface X-Header: X-Pi-hole: The Pi-hole Web interface is working!

*** [ DIAGNOSING ]: Gravity list

   -----head of gravity.list------

   -----tail of gravity.list------

*** [ DIAGNOSING ]: contents of /etc/pihole

-rw-r--r-- 1 root root 313 Dec  3 00:23 /etc/pihole/adlists.list
   https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
   https://mirror1.malwaredomains.com/files/justdomains
   http://sysctl.org/cameleon/hosts
   https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
   https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
   https://hosts-file.net/ad_servers.txt

-rw-r--r-- 1 root root 234 Dec  3 00:23 /etc/pihole/logrotate
   /var/log/pihole.log {
        su root root
        daily
        copytruncate
        rotate 5
        compress
        delaycompress
        notifempty
        nomail
   }
   /var/log/pihole-FTL.log {
        su root root
        weekly
        copytruncate
        rotate 3
        compress
        delaycompress
        notifempty
        nomail
   }

*** [ DIAGNOSING ]: contents of /etc/dnsmasq.d

-rw-r--r-- 1 root root 1387 Dec  3 00:23 /etc/dnsmasq.d/01-pihole.conf
   addn-hosts=/etc/pihole/gravity.list
   addn-hosts=/etc/pihole/black.list
   addn-hosts=/etc/pihole/local.list
   localise-queries
   no-resolv
   cache-size=10000
   log-queries
   log-facility=/var/log/pihole.log
   local-ttl=2
   log-async
   server=1.1.1.1
   server=1.0.0.1
   interface=eth0

*** [ DIAGNOSING ]: contents of /etc/lighttpd

-rw-r--r-- 1 root root 3499 Dec  3 00:23 /etc/lighttpd/lighttpd.conf
   server.modules = (
        "mod_access",
        "mod_accesslog",
        "mod_auth",
        "mod_expire",
        "mod_compress",
        "mod_redirect",
        "mod_setenv",
        "mod_rewrite"
   )
   server.document-root        = "/var/www/html"
   server.error-handler-404    = "/pihole/index.php"
   server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
   server.errorlog             = "/var/log/lighttpd/error.log"
   server.pid-file             = "/var/run/lighttpd.pid"
   server.username             = "www-data"
   server.groupname            = "www-data"
   server.port                 = 80
   accesslog.filename          = "/var/log/lighttpd/access.log"
   accesslog.format            = "%{%s}t|%V|%r|%s|%b"
   index-file.names            = ( "index.php", "index.html", "index.lighttpd.ht                                                                                                                                                             ml" )
   url.access-deny             = ( "~", ".inc", ".md", ".yml", ".ini" )
   static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
   compress.cache-dir          = "/var/cache/lighttpd/compress/"
   compress.filetype           = ( "application/javascript", "text/css", "text/h                                                                                                                                                             tml", "text/plain" )
   mimetype.assign   = ( ".png"  => "image/png",
                         ".jpg"  => "image/jpeg",
                         ".jpeg" => "image/jpeg",
                         ".html" => "text/html",
                         ".css" => "text/css; charset=utf-8",
                         ".js" => "application/javascript",
                         ".json" => "application/json",
                         ".txt"  => "text/plain",
                         ".svg"  => "image/svg+xml" )
   include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
   include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'let                                                                                                                                                             sencrypt.conf' -printf 'include \"%p\"
' 2>/dev/null"
   $HTTP["url"] =~ "^/admin/" {

       setenv.add-response-header = (
           "X-Pi-hole" => "The Pi-hole Web interface is working!",
           "X-Frame-Options" => "DENY"
       )
       $HTTP["url"] =~ ".ttf$" {

           setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
       }
   }
   $HTTP["url"] =~ "^/admin/\.(.*)" {
        url.access-deny = ("")
   }
   include_shell "cat external.conf 2>/dev/null"

*** [ DIAGNOSING ]: contents of /etc/cron.d

-rw-r--r-- 1 root root 1704 Dec  3 00:23 /etc/cron.d/pihole
   23 4   * * 7   root    PATH="$PATH:/usr/local/bin/" pihole updateGravity >/va                                                                                                                                                             r/log/pihole_updateGravity.log || cat /var/log/pihole_updateGravity.log
   00 00   * * *   root    PATH="$PATH:/usr/local/bin/" pihole flush once quiet
   @reboot root /usr/sbin/logrotate /etc/pihole/logrotate
   */10 *  * * *   root    PATH="$PATH:/usr/local/bin/" pihole updatechecker loc                                                                                                                                                             al
   40 14  * * *   root    PATH="$PATH:/usr/local/bin/" pihole updatechecker remo                                                                                                                                                             te
   @reboot root    PATH="$PATH:/usr/local/bin/" pihole updatechecker remote rebo                                                                                                                                                             ot

*** [ DIAGNOSING ]: contents of /var/log/lighttpd

-rw-r--r-- 1 www-data www-data 301 Dec  3 00:23 /var/log/lighttpd/error.log
   2019-12-02 23:28:55: (server.c.1464) server started (lighttpd/1.4.53)
   2019-12-03 00:23:56: (server.c.2059) server stopped by UID = 0 PID = 1
   2019-12-03 00:23:58: (server.c.1464) server started (lighttpd/1.4.53)
   2019-12-03 00:23:58: (server.c.1493) WARNING: unknown config-key: alias.url (                                                                                                                                                             ignored)

*** [ DIAGNOSING ]: contents of /var/log

*** [ DIAGNOSING ]: contents of /dev/shm

*** [ DIAGNOSING ]: Locale
    LANG=en_CA.UTF-8

*** [ DIAGNOSING ]: Pi-hole log

   -----head of pihole.log------

It looks like you don't have your timezone set correctly. If you are in Canada, then no part of Canada should have a time earlier than 2019-12-02 16:30.

sudo dpkg-reconfigure tzdata