Urgent: can not start Pi-hole

Expected Behaviour:

Sudo service pihole-ftl start
Should not return an error and Pi-hole should resolve dns queries

Actual Behaviour:

Sudo service pihole-ftl returns an error
Failed with result ‘exit-code’
Failed to start LSB: pihole-ftl daemon

Debug Token:

unable to get a debug token as the IP address for Pi-hole won’t work

This will temporarily reset the nameserver on the Pi to bypass Pi-Hole DNS.

sudo nano /etc/resolv.conf

Edit the nameserver line to nameserver 9.9.9.9 or your preferred third party DNS service, save and exit

Run

pihole -d

and upload the debug log.

The name server is already set to 1.1.1.1 by pihole

And I can’t upload a debug log as nothing has internet access

Unless you want a picture from my phone

It give you a url, I forgot

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

You have dnsmasq running on port 53. This is preventing pihole-FTL from binding to that port.

[✗] tcp:192.168.1.1:53 is in use by dnsmasq (https://docs.pi-hole.net/main/prerequisites/#ports)
    tcp:0.0.0.0:21 is in use by pure-ftpd

*** [ DIAGNOSING ]: Pi-hole diagnosis messages
   count   last timestamp       type                  message                                                       blob1                 blob2                 blob3                 blob4                 blob5               
   ------  -------------------  --------------------  ------------------------------------------------------------  --------------------  --------------------  --------------------  --------------------  --------------------
   1       2022-09-21 17:04:14  DNSMASQ_CONFIG        failed to bind DHCP server socket: Address already in use    

   [2022-09-21 17:04:14.651 1539M] FATAL ERROR in dnsmasq core: failed to bind DHCP server socket: Address already in use                                                                                                             

Stop/remove dnsmasq, then restart Pi-hole.

Aside noted from review of your debug log - regex entries like this won't reliably block YT ads, and will most likely end up interfering with content:

 r1---sn-4g5e6n7k.a1.googlevideo.com           

dnsmasq is the one build into pi-hole, I did notice that and uninstall dnsmasq

also the googlevideo links are old and block nothing

192.168.1.1:53 now thats an issue
IP 192.168.1.1 isn't used

Sep 21 17:56:14 SERVER systemd[1]: pihole-FTL.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
maybe that is the issue, an invalid argument in a config

It is not.

The dnsmasq process shown in base dnsmasq running on your Pi.

Pi-hole, which has dnsmasq embedded, shows on port 53 as pihole-FTL (a different process).

Please upload a fresh debug log and post the new token URL here.

dnsmasq is removed and stopped and it still say its using port 53

New debug token please.

I was in the process of doing it
https://tricorder.pi-hole.net/SMrT8Jv6/

I suspect some aspects of dnsmasq are still active:

   udp:0.0.0.0:67 is in use by dnsmasq

What is the output of the following from the Pi terminal:

sudo netstat -tulpen

You would be best to remove them.

Edit - this SQL command will do it:

sudo sqlite3 /etc/pihole/gravity.db "delete from domainlist where type=1 AND domain like '%googlevideo%'"

That’s what I’m going to do when it’s working again

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name    
tcp        0      0 127.0.0.1:5053          0.0.0.0:*               LISTEN      998        19263      1298/cloudflared    
tcp        0      0 127.0.0.1:41611         0.0.0.0:*               LISTEN      998        19257      1298/cloudflared    
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      0          17991      737/cupsd           
tcp        0      0 127.0.0.1:43453         0.0.0.0:*               LISTEN      997        24028      1643/Plex Plug-in [ 
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      0          22553      1493/smbd           
tcp        0      0 127.0.0.1:33077         0.0.0.0:*               LISTEN      997        24080      2244/Plex Plug-in [ 
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      0          22554      1493/smbd           
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          20829      1371/lighttpd       
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      0          14234      800/pure-ftpd (SERV 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          14210      779/sshd: /usr/sbin 
tcp        0      0 127.0.0.1:32600         0.0.0.0:*               LISTEN      997        24685      2197/Plex Tuner Ser 
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      0          18487      751/vncserver-x11-c 
tcp        0      0 127.0.0.1:32401         0.0.0.0:*               LISTEN      997        20270      1346/Plex Media Ser 
tcp        0      0 192.168.1.1:53          0.0.0.0:*               LISTEN      0          18166      949/dnsmasq         
tcp6       0      0 :::631                  :::*                    LISTEN      0          17992      737/cupsd           
tcp6       0      0 :::445                  :::*                    LISTEN      0          22551      1493/smbd           
tcp6       0      0 :::139                  :::*                    LISTEN      0          22552      1493/smbd           
tcp6       0      0 :::80                   :::*                    LISTEN      0          20830      1371/lighttpd       
tcp6       0      0 :::21                   :::*                    LISTEN      0          14235      800/pure-ftpd (SERV 
tcp6       0      0 :::22                   :::*                    LISTEN      0          14212      779/sshd: /usr/sbin 
tcp6       0      0 :::5900                 :::*                    LISTEN      0          18486      751/vncserver-x11-c 
tcp6       0      0 :::32400                :::*                    LISTEN      997        20268      1346/Plex Media Ser 
udp        0      0 192.168.1.201:38820     0.0.0.0:*                           997        24039      1346/Plex Media Ser 
udp        0      0 192.168.1.201:53177     0.0.0.0:*                           997        24041      1346/Plex Media Ser 
udp        0      0 192.168.1.1:53          0.0.0.0:*                           0          18165      949/dnsmasq         
udp        0      0 0.0.0.0:67              0.0.0.0:*                           0          18162      949/dnsmasq         
udp        0      0 0.0.0.0:68              0.0.0.0:*                           0          20586      617/dhcpcd          
udp        0      0 192.168.1.255:137       0.0.0.0:*                           0          32319      1302/nmbd           
udp        0      0 192.168.1.201:137       0.0.0.0:*                           0          32318      1302/nmbd           
udp        0      0 172.17.255.255:137      0.0.0.0:*                           0          32315      1302/nmbd           
udp        0      0 172.17.0.1:137          0.0.0.0:*                           0          32314      1302/nmbd           
udp        0      0 192.168.1.255:137       0.0.0.0:*                           0          19954      1302/nmbd           
udp        0      0 192.168.1.1:137         0.0.0.0:*                           0          19953      1302/nmbd           
udp        0      0 0.0.0.0:137             0.0.0.0:*                           0          19940      1302/nmbd           
udp        0      0 192.168.1.255:138       0.0.0.0:*                           0          32321      1302/nmbd           
udp        0      0 192.168.1.201:138       0.0.0.0:*                           0          32320      1302/nmbd           
udp        0      0 172.17.255.255:138      0.0.0.0:*                           0          32317      1302/nmbd           
udp        0      0 172.17.0.1:138          0.0.0.0:*                           0          32316      1302/nmbd           
udp        0      0 192.168.1.255:138       0.0.0.0:*                           0          19956      1302/nmbd           
udp        0      0 192.168.1.1:138         0.0.0.0:*                           0          19955      1302/nmbd           
udp        0      0 0.0.0.0:138             0.0.0.0:*                           0          19941      1302/nmbd           
udp        0      0 0.0.0.0:631             0.0.0.0:*                           0          15996      921/cups-browsed    
udp        0      0 0.0.0.0:54066           0.0.0.0:*                           997        24660      2197/Plex Tuner Ser 
udp        0      0 192.168.1.201:60303     0.0.0.0:*                           997        24043      1346/Plex Media Ser 
udp        0      0 127.0.0.1:5053          0.0.0.0:*                           998        19260      1298/cloudflared    
udp        0      0 127.0.0.1:58497         0.0.0.0:*                           997        24038      1346/Plex Media Ser 
udp        0      0 192.168.1.201:1194      0.0.0.0:*                           0          24620      2131/openvpn        
udp        0      0 127.0.0.1:56546         0.0.0.0:*                           997        24040      1346/Plex Media Ser 
udp        0      0 224.0.0.251:5353        0.0.0.0:*                           1000       42181      4442/chromium-brows 
udp        0      0 224.0.0.251:5353        0.0.0.0:*                           1000       42179      4442/chromium-brows 
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           108        14689      557/avahi-daemon: r 
udp        0      0 0.0.0.0:36259           0.0.0.0:*                           108        14691      557/avahi-daemon: r 
udp        0      0 0.0.0.0:32410           0.0.0.0:*                           997        24035      1346/Plex Media Ser 
udp        0      0 0.0.0.0:32412           0.0.0.0:*                           997        24036      1346/Plex Media Ser 
udp        0      0 0.0.0.0:32413           0.0.0.0:*                           997        24037      1346/Plex Media Ser 
udp        0      0 0.0.0.0:32414           0.0.0.0:*                           997        24034      1346/Plex Media Ser 
udp        0      0 0.0.0.0:1901            0.0.0.0:*                           997        24042      1346/Plex Media Ser 
udp6       0      0 :::5353                 :::*                                108        14690      557/avahi-daemon: r 
udp6       0      0 :::46385                :::*                                108        14692      557/avahi-daemon: r

Package 'dnsmasq' is not installed, so not removed

Could you post output for below three?

pstree -ps $(pidof -s dnsmasq)

apt policy dnsmasq dnsmasq-base

systemctl status dnsmasq.service

Copy paste the text output to here, highlight the output with your mouse and click on the </> button to format the code before posting pls?

pstree -ps $(pidof -s dnsmasq)

systemd(1)───dnsmasq(949)───dnsmasq(950)

apt policy dnsmasq dnsmasq-base

dnsmasq:
  Installed: (none)
  Candidate: 2.85-1
  Version table:
     2.85-1 500
        500 http://deb.debian.org/debian bullseye/main arm64 Packages
        500 http://deb.debian.org/debian bullseye/main armhf Packages
        500 http://ftp.us.debian.org/debian bullseye/main arm64 Packages
        500 http://ftp.us.debian.org/debian bullseye/main armhf Packages
        100 /var/lib/dpkg/status
dnsmasq-base:
  Installed: 2.85-1
  Candidate: 2.85-1
  Version table:
 *** 2.85-1 500
        500 http://deb.debian.org/debian bullseye/main arm64 Packages
        500 http://ftp.us.debian.org/debian bullseye/main arm64 Packages
        100 /var/lib/dpkg/status

systemctl status dnsmasq.service

● dnsmasq.service
     Loaded: masked (Reason: Unit dnsmasq.service is masked.)
     Active: inactive (dead)

systemctl list-units '*dnsmasq*'

???

systemctl list-units 'dnsmasq'

0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

Ok, I've no idea why dnsmasq gets started.
But its most likely the one from below:

pi@ph5b:~ $ apt-file list dnsmasq-base
[..]
dnsmasq-base: /usr/sbin/dnsmasq
[..]

As a last resort you could purge/uninstall that package with below:

sudo apt purge dnsmasq-base

And reboot to see if it returns.
If some other software is responsible for booting up that dnsmasq instance, most likley dnsmasq will return when updating that other software.

Or wait for someone with a smarter solution.

1 Like

maybe that was it but why doesn't dnsmasq remove dnsmasq-base

And how did a restart install them both