FTLDNS upgrade failed - solved

Finally was able to compile though there are few changes happened like:
root@gw:~# pihole -v
Pi-hole version is v4.0 (Latest: v4.0)
AdminLTE version is v4.0 (Latest: v4.0)
FTL version is v4.0-dirty (Latest: v4.0)
what does dirty means ? :slight_smile:

running ldd now is not empty
root@gw:~# ldd /usr/bin/pihole-FTL
libgcc_s.so.1 => /lib/arm-linux-gnueabi/libgcc_s.so.1 (0x402b1000)
libpthread.so.0 => /lib/arm-linux-gnueabi/libpthread.so.0 (0x401dd000)
libc.so.6 => /lib/arm-linux-gnueabi/libc.so.6 (0x402db000)
/lib/ld-linux.so.3 (0x2a000000)

and lastly

pi-hole web admin console status says "unknown"

Thanks everyone :smiley:

I'm traveling and have very limited debugging capabilities today, so I cannot really comment on the "unknown status" problem now.

Dirty means that there have been uncommitted changes in your local repository, so nothing you have to worry about.

Again:

Which version of gcc are you using?

root@gw:~/FTL# gcc --version
gcc (Debian 4.6.3-14) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Nothing serious though as blocking is working perfectly fine.

Very nice. What is the output of pihole status?

root@gw:/# pihole status
[✓] DNS service is running
[✓] Pi-hole blocking is Enabled

Sorry for the delay, and what's the output of

pihole status web

?

(should be 1 for enabled)

root@gw:~# pihole status web
1

And is there still the "Unknown" status display on the dashboard?

If so, then PHP probably cannot access this command. I think we have seen this a few times on SELinux enabled systems. Does

tail /var/log/lighttpd/error.log

say anything interesting?

this are warnings since i restarted the web server and one more thing my changes in pihole admin console is not being saved after clicking save button

2018-08-22 22:25:17: (server.c.1558) server stopped by UID = 0 PID = 23809
2018-08-22 22:25:26: (log.c.166) server started
2018-08-22 22:28:40: (mod_fastcgi.c.2683) FastCGI-stderr: PHP Warning: unlink(../custom_disable_timer): No such file or directory in /var/www/html/admin/api.php on line 47

2018-08-22 22:34:30: (mod_fastcgi.c.2683) FastCGI-stderr: PHP Warning: unlink(../custom_disable_timer): No such file or directory in /var/www/html/admin/api.php on line 47

You may be missing the proper sudo file giving the web server permissions to access pihole commands. Please try

sudo -u www-data sudo pihole status

ya right it was permission issue, my /etc/sudoers/pihole is blank i simply add
www-data ALL=NOPASSWD: /usr/local/bin/pihole and admin console status is now active :metal::+1:

i have another issue at the moment looks like my pihole-FTL.db file is empty it just sits at 24k file size, and my pihole dashboard stats resets to zero everytime pihole is restarted.

root@gw:/# tail -f /var/log/pihole-FTL.log
[2018-08-25 20:39:34.757] -> Exactly blocked DNS queries: 0
[2018-08-25 20:39:34.757] -> Unknown DNS queries: 0
[2018-08-25 20:39:34.757] -> Unique domains: 0
[2018-08-25 20:39:34.757] -> Unique clients: 0
[2018-08-25 20:39:34.757] -> Known forward destinations: 0
[2018-08-25 20:39:34.757] Successfully accessed setupVars.conf
[2018-08-25 20:39:34.767] PID of FTL process: 10158
[2018-08-25 20:39:34.768] Listening on port 4711 for incoming IPv4 telnet connections
[2018-08-25 20:39:34.768] Listening on port 4711 for incoming IPv6 telnet connections
[2018-08-25 20:39:34.769] Listening on Unix socket

root@gw:/# ls -alh /etc/pihole/pihole-FTL.db
-rw-r--r-- 1 root root 24K Aug 25 19:24 /etc/pihole/pihole-FTL.db

pihole-FTL uses nobody as user

PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
1767 root 20 0 2304 1416 536 R 1.3 0.6 7:19.70 htop
10158 nobody 20 0 75460 23476 1876 S 0.0 9.2 0:03.05 pihole-FTL
10163 nobody 20 0 75460 23476 1876 S 0.0 9.2 0:00.16 pihole-FTL

Why not user pihole? This should be the standard.

Try changing the ownership to the FTL user or give write access to all user for the database.

Are there error messages concerning the database in /var/log/pihole-FTL.log ?

well it is supposed to be root due to failed set capabilities on my router.
no errors as per FTL log

[2018-08-25 20:39:34.750] ########## FTL started! ##########
[2018-08-25 20:39:34.750] FTL branch: master
[2018-08-25 20:39:34.750] FTL version: v4.0
[2018-08-25 20:39:34.750] FTL commit: 8493df4
[2018-08-25 20:39:34.751] FTL date: 2018-08-05 13:40:30 -0700
[2018-08-25 20:39:34.751] FTL user: root
[2018-08-25 20:39:34.751] WARNING: Starting pihole-FTL as user root is not recommended
[2018-08-25 20:39:34.751] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2018-08-25 20:39:34.751] SOCKET_LISTENING: only local
[2018-08-25 20:39:34.751] AAAA_QUERY_ANALYSIS: Show AAAA queries
[2018-08-25 20:39:34.751] MAXDBDAYS: max age for stored queries is 365 days
[2018-08-25 20:39:34.751] RESOLVE_IPV6: Resolve IPv6 addresses
[2018-08-25 20:39:34.751] RESOLVE_IPV4: Resolve IPv4 addresses
[2018-08-25 20:39:34.751] DBINTERVAL: saving to DB file every minute
[2018-08-25 20:39:34.751] DBFILE: Using /etc/pihole/pihole-FTL.db
[2018-08-25 20:39:34.752] MAXLOGAGE: Importing up to 24.0 hours of log data
[2018-08-25 20:39:34.752] PRIVACYLEVEL: Set to 0
[2018-08-25 20:39:34.752] IGNORE_LOCALHOST: Show queries from localhost
[2018-08-25 20:39:34.752] BLOCKINGMODE: Null IPs for blocked domains
[2018-08-25 20:39:34.752] REGEX_DEBUGMODE: Inactive
[2018-08-25 20:39:34.753] Finished config file parsing
[2018-08-25 20:39:34.753] INFO: No Regex file found
[2018-08-25 20:39:34.755] Database successfully initialized
[2018-08-25 20:39:34.756] Imported 0 queries from the long-term database
[2018-08-25 20:39:34.757] -> Total DNS queries: 0
[2018-08-25 20:39:34.757] -> Cached DNS queries: 0
[2018-08-25 20:39:34.757] -> Forwarded DNS queries: 0
[2018-08-25 20:39:34.757] -> Exactly blocked DNS queries: 0
[2018-08-25 20:39:34.757] -> Unknown DNS queries: 0
[2018-08-25 20:39:34.757] -> Unique domains: 0
[2018-08-25 20:39:34.757] -> Unique clients: 0
[2018-08-25 20:39:34.757] -> Known forward destinations: 0
[2018-08-25 20:39:34.757] Successfully accessed setupVars.conf
[2018-08-25 20:39:34.767] PID of FTL process: 10158
[2018-08-25 20:39:34.768] Listening on port 4711 for incoming IPv4 telnet connections
[2018-08-25 20:39:34.768] Listening on port 4711 for incoming IPv6 telnet connections
[2018-08-25 20:39:34.769] Listening on Unix socket

Oh, yes ...

Everything is as expected. Please try stoping pihole-FT, deleting /etc/pihole/pihole-FTL.dband restartingpihole-FTL`. It is very strange that it doesn't store data...

still no luck, file size remains at 24k, i already change ownership from root:root to nobody:root, pihole:pihole and permission from 0766 to 0777 blocking is working though as stats is showing in pihole admin dashboard but when pihole restarts everything is gone and stats will start from the beginning

Okay, one more try:

  • Stop pihole-FTL
  • Delete the database file (just to be sure to start afresh)
  • Start pihole-FTL not using service... but manually with:
    pihole-FTL debug
    

In debug mode, pihole-FTL will not go into daemon mode and will keep running in the foreground of your terminal. Its logging is much more verbose. Every minute, you should see a line like

[2018-08-25 17:02:00.204] Notice: Queries stored in DB: 27 (took 136.6 ms)

yes got some and pihole-FTL.db file size starts incrementing to 40K but after debugging mode file size is stuck again at 40K after manually running pihole

dnsmasq: 109 10.2.2.137/64032 reply livetileedge.dsx.mp.microsoft.com.edgekey.net is
[2018-08-25 23:12:58.400] **** got reply livetileedge.dsx.mp.microsoft.com.edgekey.net is (CNAME) (ID 109)
[2018-08-25 23:12:58.400] Flags: F_FORWARD F_CNAME
dnsmasq: 109 10.2.2.137/64032 reply e1898.dspg.akamaiedge.net is 23.56.24.142
[2018-08-25 23:12:58.400] **** got reply e1898.dspg.akamaiedge.net is 23.56.24.142 (ID 109)
[2018-08-25 23:12:58.400] Flags: F_FORWARD F_IPV4
[2018-08-25 23:13:00.083] Notice: Queries stored in DB: 75 (took 54.7 ms)

[2018-08-25 23:17:58.740] Flags: F_FORWARD F_NEG F_IPV4 F_NXDOMAIN F_DNSSECOK
[2018-08-25 23:18:00.113] Notice: Queries stored in DB: 14 (took 29.8 ms)

dnsmasq: 222 10.2.2.137/50042 reply discourse.pi-hole.net is NODATA-IPv6
[2018-08-25 23:18:56.679] **** got reply discourse.pi-hole.net is (NODATA) (ID 222)
[2018-08-25 23:18:56.680] Flags: F_FORWARD F_NEG F_IPV6
[2018-08-25 23:19:00.106] Notice: Queries stored in DB: 10 (took 23.2 ms)

This is weird. I'll have to check if there are any errors that are handled differently in debugging mode, but that shouldn't matter.

You said earlier that pihole-FTL seems to be running as user nobody. Is this also the case for when you start it manually? It may be that your service files are run as user nobody with root permissions? It something I haven't seen before, so this is mostly wild guessing...