PiHole - Cant Access Admin Page


#1

Fresh install of PiHole on the latest version of Kunbuntu.
Your debug token is: oti3m32wwj

Issue: Install passes without errors, but am unable to access web interface on [ip]/admin

Steps taken to resolve:
-Checked dnsmaq
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-05-12 09:17:04 EDT; 4min 23s ago
Process: 3940 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
Process: 3939 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

May 12 09:17:04 nstat systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server…
May 12 09:17:04 nstat dnsmasq[3939]: dnsmasq: syntax check OK.
May 12 09:17:04 nstat dnsmasq[3940]: dnsmasq: failed to create listening socket for port 53: Address already in useMay 12 09:17:04 nstat dnsmasq[3940]: failed to create listening socket for port 53: Address already in use
May 12 09:17:04 nstat dnsmasq[3940]: FAILED to start up
May 12 09:17:04 nstat systemd[1]: dnsmasq.service: Control process exited, code=exited status=2
May 12 09:17:04 nstat systemd[1]: dnsmasq.service: Failed with result ‘exit-code’.
May 12 09:17:04 nstat systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.

Ran pihole -d the errors are:
*** [ DIAGNOSING ]: Dashboard and block page
[✗] X-Header does not match or could not be retrieved.
[✗] X-Header does not match or could not be retrieved.

*** [ DIAGNOSING ]: Gravity list
ls: cannot access '/etc/pihole/gravity.list': No such file or directory
head: cannot open '/etc/pihole/gravity.list' for reading: No such file or directory
   -----head of gravity.list------
tail: cannot open '/etc/pihole/gravity.list' for reading: No such file or directory
   -----tail of gravity.list------

Any ideas?


#2

Can you try a pihole -r > Repair?


#3

Attempted a repair:
The repair ends on line “[i] Starting dnsmasq service…”
http://192.168.0.32 still gives me “Access Denied”

See below for the whole log.


 [i] Repair option selected                                                            
 [✓] 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 dnsmasq                                                              
 [✓] Checking for dnsutils                                                             
 [✓] Checking for iputils-ping                                                         
 [✓] Checking for lsof                                                                 
 [✓] Checking for netcat                                                               
 [✓] Checking for sudo                                                                 
 [✓] Checking for unzip                                                                
 [✓] Checking for wget                                                                 
 [✓] Checking for idn2                                                                 
 [✓] Checking for sqlite3                                                              
 [✓] Checking for lighttpd                                                             
 [✓] Checking for php-common                                                           
 [✓] Checking for php-cgi                                                              
 [✓] Checking for php-sqlite3                                                          
                                                                                       
 [✓] 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] Creating log and changing owner to dnsmasq... log already exists!                 
                                                                                       
 [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 x86_64 architecture                                                      
 [i] Checking for existing FTL binary...                                               
 [i] Latest FTL Binary already installed (v3.0). Confirming Checksum...                
 [i] Checksum correct. No need to download!                                            
 [i] Restarting services...          
[i] Starting dnsmasq service...

#4

Stop whatever is running on port 53 and then run the repair command again.


#5

You can check whats running/listening now on port 53 TCP and UDP with below one:

sudo netstat -nltup | grep "Proto\|:53 "

A working example:

pi@noads:~ $ sudo netstat -nltup | grep "Proto\|:53 "
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      27880/dnsmasq
tcp6       0      0 :::53                   :::*                    LISTEN      27880/dnsmasq
udp        0      0 0.0.0.0:53              0.0.0.0:*                           27880/dnsmasq
udp6       0      0 :::53                   :::*                                27880/dnsmasq

#6

Here is what appears to be running on 53, just local DNS resolution?

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      476/systemd-resolve
udp    19968      0 127.0.0.53:53           0.0.0.0:*                           476/systemd-resolve

#7

Ok, I see that I had systemd-resolve using port 53 not dnsmasq.
I have followed the instructions to change to to dnsmasq and now when I run

sudo netstat -nltup | grep "Proto|:53 "
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1230/dnsmasq
tcp6 0 0 :::53 :::* LISTEN 1230/dnsmasq
udp 15360 0 0.0.0.0:53 0.0.0.0:* 1230/dnsmasq
udp6 0 0 :::53 :::* 1230/dnsmasq

Gave it a reboot and still cant access the we admin page.
[✓] Your debug token is: lcqnfo18cn

The only items that still stand out in the logs are:
[ DIAGNOSING ]: Ports in use
[] is in use by
[1716] is in use by kdeconnec
[22] is in use by sshd
[53] is in use by dnsmasq
[631] is in use by cupsd

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

#8

What is the output of these commands?

sudo service lighttpd restart
sudo service pihole-FTL restart
sudo service lighttpd status -l
sudo service pihole-FTL status -l

#9

sudo service lighttpd restart
See “systemctl status lighttpd.service” and “journalctl -xe” for details.

sudo service pihole-FTL restart
[nothing]

sudo service lighttpd status -l
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2018-05-16 11:54:10 EDT; 28s ago
Process: 3682 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=127)

May 16 11:54:10 nstat systemd[1]: lighttpd.service: Failed with result ‘exit-code’.
May 16 11:54:10 nstat systemd[1]: Failed to start Lighttpd Daemon.
May 16 11:54:10 nstat systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
May 16 11:54:10 nstat systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
May 16 11:54:10 nstat systemd[1]: Stopped Lighttpd Daemon.
May 16 11:54:10 nstat systemd[1]: lighttpd.service: Start request repeated too quickly.
May 16 11:54:10 nstat systemd[1]: lighttpd.service: Failed with result ‘exit-code’.
May 16 11:54:10 nstat systemd[1]: Failed to start Lighttpd Daemon.

sudo service pihole-FTL status -l
● pihole-FTL.service - LSB: pihole-FTL daemon
Loaded: loaded (/etc/init.d/pihole-FTL; generated)
Active: active (exited) since Wed 2018-05-16 11:54:27 EDT; 29s ago
Docs: man:systemd-sysv-generator(8)
Process: 3689 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)

May 16 11:54:27 nstat systemd[1]: Starting LSB: pihole-FTL daemon…
May 16 11:54:27 nstat pihole-FTL[3689]: Not running
May 16 11:54:27 nstat pihole-FTL[3689]: rm: cannot remove ‘/var/run/pihole/FTL.sock’: No such file or directory
May 16 11:54:27 nstat su[3703]: Successful su for pihole by root
May 16 11:54:27 nstat su[3703]: + ??? root:pihole
May 16 11:54:27 nstat su[3703]: pam_unix(su:session): session opened for user pihole by (uid=0)
May 16 11:54:27 nstat pihole-FTL[3689]: FTL started!
May 16 11:54:27 nstat su[3703]: pam_unix(su:session): session closed for user pihole
May 16 11:54:27 nstat systemd[1]: Started LSB: pihole-FTL daemon.


#10

What is the output of lighttpd -v and lighttpd -t?


#11

-v
lighttpd: Symbol `FamErrlist’ has different size in shared object, consider re-linking
lighttpd: symbol lookup error: lighttpd: undefined symbol: FAMNoExists

-t
lighttpd: Symbol `FamErrlist’ has different size in shared object, consider re-linking
lighttpd: symbol lookup error: lighttpd: undefined symbol: FAMNoExists


#12

You might be missing a dependency for lighttpd (the package might not have specified all of them). Try installing gamin


#13

Same issue was fixed by gamin here:


#14

image

Cheers to both of you guys! Thanks so much!


#15

Ah, one last issue. When I reboot the machine running pihole the web admin page says “Failed to connect to API” running sudo service pihole-FTL restart solves the issue, what would case pihole to not start the pihole-FTL service on boot?


#16

When it fails what’s the output of sudo systemctl status pihole-FTL.service


#17

● pihole-FTL.service - LSB: pihole-FTL daemon
Loaded: loaded (/etc/init.d/pihole-FTL; generated)
Active: inactive (dead)
Docs: man:systemd-sysv-generator(8)


#18

What are the contents of these log files when it has failed?

/var/log/pihole.log
/var/log/pihole-FTL.log

#19

Looks like Pihole is running fine still see my PC actively being blocked.
sa@nstat:~/bridge$ tail -n 10 /var/log/pihole.log
May 16 17:13:33 dnsmasq[678]: 192 192.168.0.101/52513 query[A] notifications.google.com from 192.168.0.101
May 16 17:13:33 dnsmasq[678]: 192 192.168.0.101/52513 forwarded notifications.google.com to 208.67.220.220
May 16 17:13:33 dnsmasq[678]: 192 192.168.0.101/52513 forwarded notifications.google.com to 208.67.222.222
May 16 17:13:33 dnsmasq[678]: 192 192.168.0.101/52513 reply notifications.google.com is
May 16 17:13:33 dnsmasq[678]: 192 192.168.0.101/52513 reply plus.l.google.com is 172.217.0.110
May 16 17:13:33 dnsmasq[678]: 193 192.168.0.101/52513 query[A] notifications.google.com from 192.168.0.101
May 16 17:13:33 dnsmasq[678]: 193 192.168.0.101/52513 cached notifications.google.com is
May 16 17:13:33 dnsmasq[678]: 193 192.168.0.101/52513 cached plus.l.google.com is 172.217.0.110
May 16 17:14:03 dnsmasq[678]: 294 192.168.0.101/62888 query[A] v10.vortex-win.data.microsoft.com from 192.168.0.101

May 16 17:14:03 dnsmasq[678]: 294 192.168.0.101/62888 /etc/pihole/gravity.list v10.vortex-win.data.microsoft.com is 192.168.0.32

sa@nstat:~/bridge$ tail -n 20 /var/log/pihole-FTL.log
[2018-05-16 17:00:30.814] Reading from /var/log/pihole.log (rw-r–r--)
[2018-05-16 17:00:30.885] Finished initial log file parsing
[2018-05-16 17:00:30.886] -> Total DNS queries: 797
[2018-05-16 17:00:30.886] -> Cached DNS queries: 122
[2018-05-16 17:00:30.886] -> Forwarded DNS queries: 503
[2018-05-16 17:00:30.886] -> Exactly blocked DNS queries: 172
[2018-05-16 17:00:30.886] -> Wildcard blocked DNS queries: 0
[2018-05-16 17:00:30.886] -> Unknown DNS queries: 0
[2018-05-16 17:00:30.886] -> Unique domains: 327
[2018-05-16 17:00:30.886] -> Unique clients: 4
[2018-05-16 17:00:30.886] -> Known forward destinations: 2
[2018-05-16 17:00:30.886] Successfully accessed setupVars.conf
[2018-05-16 17:00:30.886] Listening on port 4711 for incoming IPv4 telnet connections
[2018-05-16 17:00:30.887] Listening on port 4711 for incoming IPv6 telnet connections
[2018-05-16 17:00:30.887] Listening on Unix socket
[2018-05-16 17:09:58.771] FATAL: FTL received SIGTERM from PID/UID 1/0, exiting gracefully
[2018-05-16 17:09:58.771] Shutting down…
[2018-05-16 17:09:58.803] NOTICE: Received signal SIGHUP - re-reading gravity files
[2018-05-16 17:09:58.816] Finished final database update
[2018-05-16 17:09:58.817] ########## FTL terminated after 45.2 ms! ##########


#20

From the FTL log, something told it to shut down. So somehow it is getting told to shut down about 10 seconds after starting.