FTL not running, lost connection to API

Expected Behavior:

I would just like the API and FTL to actually work

Actual Behavior:

correct me if I am wrong but I thing the FTL should be running. In my case it isn't and it also says lost connection to API

Debug Token:

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

Your debug log shows a dnsmasq process running on port 53. This will prevent pihole-FTL (which has embedded dnsmasq) from binding to that port.

Confirm with this command from the Pi terminal:

sudo netstat -nltup | grep 'Proto\|:53 \|:471'

If you see dnsmasq running, then stop that process and disable it, then start FTL.

How do I disable it?

I did sudo service pihole-FTL start after stopping Dnsmasq then I did sudo netstat -nltup | grep 'Proto|:53 |:471' and only PID/Program name showed up
This means it isn't running but why?
No error message was present

What is the output of these commands?

sudo netstat -nltup | grep 'Proto\|:53 \|:471'

pihole status

for pihole status it is DNS service not running and for sudo netstat -nltup | grep 'Proto|:53 |:471' it has no programs running

What is the ouput of the following commands from the Pi terminal (first should have no output):

sudo service pihole-FTL restart

sudo service pihole-FTL status

pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated)
   Active: active (exited) since Mon 2020-04-20 16:12:58 PDT; 13s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2576 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SU

Apr 20 16:12:57 raspberrypi systemd[1]: Starting LSB: pihole-FTL daemon...
Apr 20 16:12:57 raspberrypi pihole-FTL[2576]: Not running
Apr 20 16:12:57 raspberrypi su[2600]: (to pihole) root on none
Apr 20 16:12:57 raspberrypi su[2600]: pam_unix(su:session): session opened for u
Apr 20 16:12:58 raspberrypi pihole-FTL[2576]: dnsmasq: cannot open or create lea
Apr 20 16:12:58 raspberrypi su[2600]: pam_unix(su:session): session closed for u
Apr 20 16:12:58 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.

The output of these three lines is cut off. Is there more on your display?

yes
er this is what I have

pihole-FTL.service - LSB: pihole-FTL daemon
Loaded: loaded (/etc/init.d/pihole-FTL; generated)
Active: active (exited) since Mon 2020-04-20 16:12:58 PDT; 13s ago
Docs: man:systemd-sysv-generator(8)
Process: 2576 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SU

Apr 20 16:12:57 raspberrypi systemd[1]: Starting LSB: pihole-FTL daemon...
Apr 20 16:12:57 raspberrypi pihole-FTL[2576]: Not running
Apr 20 16:12:57 raspberrypi su[2600]: (to pihole) root on none
Apr 20 16:12:57 raspberrypi su[2600]: pam_unix(su:session): session opened for u
Apr 20 16:12:58 raspberrypi pihole-FTL[2576]: dnsmasq: cannot open or create lea
Apr 20 16:12:58 raspberrypi su[2600]: pam_unix(su:session): session closed for u
Apr 20 16:12:58 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.

Try this command and see if the rest of the output appears:

sudo systemctl status --full --no-pager pihole-FTL

I got it

root@raspberrypi:/home/pi# sudo systemctl status --ful --no-pager pihole-FTL
● pihole-FTL.service - LSB: pihole-FTL daemon
   Loaded: loaded (/etc/init.d/pihole-FTL; generated)
   Active: active (exited) since Mon 2020-04-20 16:12:58 PDT; 17min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2576 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)

Apr 20 16:12:57 raspberrypi systemd[1]: Starting LSB: pihole-FTL daemon...
Apr 20 16:12:57 raspberrypi pihole-FTL[2576]: Not running
Apr 20 16:12:57 raspberrypi su[2600]: (to pihole) root on none
Apr 20 16:12:57 raspberrypi su[2600]: pam_unix(su:session): session opened for user pihole by (uid=0)
Apr 20 16:12:58 raspberrypi pihole-FTL[2576]: dnsmasq: cannot open or create lease file /var/lib/misc/dnsmasq.leases: Permission denied
Apr 20 16:12:58 raspberrypi su[2600]: pam_unix(su:session): session closed for user pihole
Apr 20 16:12:58 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.
root@raspberrypi:/home/pi#

What is the output of this command from the Pi terminal:

pihole-FTL dnsmasq-test

dnsmasq: syntax check OK

The file /var/lib/misc/dnsmasq.leases is not a Pi-hole file, and may be a vestige of the old dnsmasq that was running. I'm not sure how Pi-hole is even finding that file, but let's take a look at all your dnsmasq configuration. What is the output of this command which will show all the non-commented entries in the /etc/dnsmasq directory:

sudo grep -v '#\|^$' -R /etc/dnsmasq.*

literally nothing but when I hit enter i get a >
and it looks like this now

Very odd. Let's try running a repair to Pi-hole.

pihole -r and select the "repair" option.

i have tried that multiple times now

Let's look here then. It is highly unusual for that directory to be empty. It should have at minimum a file 01-pihole.conf , as this is installed by Pi-hole.

ls -lha /etc/dnsmasq.d

it has stuff in it
total 24K
drwxr-xr-x 2 root root 4.0K Apr 20 14:11 .
drwxr-xr-x 118 root root 12K Apr 20 14:11 ..
-rw-r--r-- 1 root root 1.5K Apr 20 14:11 01-pihole.conf
-rw-r--r-- 1 root root 117 Feb 12 15:51 custom-dnsmasq.conf