PiHole - Cant Access Admin Page

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?

Can you try a pihole -r > Repair?

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...

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

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

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

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

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

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.

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

-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

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

1 Like

Same issue was fixed by gamin here:

image

Cheers to both of you guys! Thanks so much!

1 Like

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?

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

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

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

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

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! ##########

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