No specific reason other than I wanted to try using that method as per "Alternative Methods" #1. I'm happy to use the standard method if you suggest.
What does below ones show?
pi@ph5b:~ $ mktemp --suffix .gravity
/tmp/tmp.uRpbYvNvB1.gravity
Replace uRpbYvNvB1 below with the ouput from above:
EDIT: Ow be very careful with the dd
command!!!
Its nickname is Disk Destroyer if just make a tiny mistake.
pi@ph5b:~ $ dd bs=1 count=2048000 if=/dev/zero of=/tmp/tmp.uRpbYvNvB1.gravity
2048000+0 records in
2048000+0 records out
2048000 bytes (2.0 MB, 2.0 MiB) copied, 101.058 s, 20.3 kB/s
pi@ph5b:~ $ stat /tmp/tmp.uRpbYvNvB1.gravity
File: /tmp/tmp.uRpbYvNvB1.gravity
Size: 2048000 Blocks: 4000 IO Block: 4096 regular file
Device: b302h/45826d Inode: 1718 Links: 1
Access: (0600/-rw-------) Uid: ( 1000/ pi) Gid: ( 1000/ UNKNOWN)
Access: 2022-07-13 21:26:27.025252488 +0200
Modify: 2022-07-13 21:29:31.392282571 +0200
Change: 2022-07-13 21:29:31.392282571 +0200
Birth: 2022-07-13 21:26:27.025252488 +0200
pi@ph5b:~ $ file /tmp/tmp.uRpbYvNvB1.gravity
/tmp/tmp.uRpbYvNvB1.gravity: data
Delete that test file when finished with below:
rm /tmp/tmp.*.gravity
As requested:
pi@pi2:~ $ mktemp --suffix .gravity
/tmp/tmp.1wYVc9MbyN.gravity
pi@pi2:~ $ dd bs=1 count=2048000 if=/dev/zero of=/tmp/tmp.1wYVc9MbyN.gravity
2048000+0 records in
2048000+0 records out
2048000 bytes (2.0 MB, 2.0 MiB) copied, 18.2121 s, 112 kB/s
pi@pi2:~ $ stat /tmp/tmp.1wYVc9MbyN.gravity
File: /tmp/tmp.1wYVc9MbyN.gravity
Size: 2048000 Blocks: 4000 IO Block: 4096 regular file
Device: b307h/45831d Inode: 1322561 Links: 1
Access: (0600/-rw-------) Uid: ( 1000/ pi) Gid: ( 1000/ pi)
Access: 2022-07-13 15:49:44.219696697 -0400
Modify: 2022-07-13 15:52:07.757854769 -0400
Change: 2022-07-13 15:52:07.757854769 -0400
Birth: -
pi@pi2:~ $ file /tmp/tmp.1wYVc9MbyN.gravity
/tmp/tmp.1wYVc9MbyN.gravity: data
Note that while pi-hole is newly installed, this system has been running a package called wfpiconsole (displays info from my weather station). I mention this only to point out that read/writes are working and in general the system is functioning normally. That package does not make any system-level changes (e.g., doesn't touch DNS), it simply listens to a websocket and displays the output.
Those file permissions look alright.
Could you check that directory as well?
ls -lahd /etc/pihole/
pi@pi2:~ $ ls -lahd /etc/pihole
drwxrwxr-x 3 pihole pihole 4.0K Jul 14 15:19 /etc/pihole
I'm guessing that's fine because A) it looks fine, and B) it's identical to my other (working) pi-hole machine setup.
Try below:
Here's the output from the start in debug mode:
[2022-07-14 16:21:03.312 4615M] Using log file /var/log/pihole/FTL.log
[2022-07-14 16:21:03.313 4615M] ########## FTL started on pi2.kozinn.com! ##########
[2022-07-14 16:21:03.314 4615M] FTL branch: master
[2022-07-14 16:21:03.314 4615M] FTL version: v5.16.1
[2022-07-14 16:21:03.314 4615M] FTL commit: 5ff5bed
[2022-07-14 16:21:03.315 4615M] FTL date: 2022-07-08 08:44:12 +0100
[2022-07-14 16:21:03.316 4615M] FTL user: pihole
[2022-07-14 16:21:03.316 4615M] Compiled for armv7hf (compiled on CI) using arm-linux-gnueabihf-gcc (Debian 6.3.0-18) 6.3.0 20170516
[2022-07-14 16:21:03.317 4615M] Creating mutex
[2022-07-14 16:21:03.318 4615M] Creating mutex
[2022-07-14 16:21:03.323 4615M] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2022-07-14 16:21:03.323 4615M] SOCKET_LISTENING: only local
[2022-07-14 16:21:03.324 4615M] AAAA_QUERY_ANALYSIS: Show AAAA queries
[2022-07-14 16:21:03.324 4615M] MAXDBDAYS: max age for stored queries is 365 days
[2022-07-14 16:21:03.325 4615M] RESOLVE_IPV6: Resolve IPv6 addresses
[2022-07-14 16:21:03.325 4615M] RESOLVE_IPV4: Resolve IPv4 addresses
[2022-07-14 16:21:03.325 4615M] DBINTERVAL: saving to DB file every minute
[2022-07-14 16:21:03.326 4615M] DBFILE: Using /etc/pihole/pihole-FTL.db
[2022-07-14 16:21:03.326 4615M] MAXLOGAGE: Importing up to 24.0 hours of log data
[2022-07-14 16:21:03.327 4615M] PRIVACYLEVEL: Set to 0
[2022-07-14 16:21:03.328 4615M] IGNORE_LOCALHOST: Show queries from localhost
[2022-07-14 16:21:03.328 4615M] BLOCKINGMODE: Null IPs for blocked domains
[2022-07-14 16:21:03.329 4615M] ANALYZE_ONLY_A_AND_AAAA: Disabled. Analyzing all queries
[2022-07-14 16:21:03.329 4615M] DBIMPORT: Importing history from database
[2022-07-14 16:21:03.330 4615M] PIDFILE: Using /run/pihole-FTL.pid
[2022-07-14 16:21:03.330 4615M] PORTFILE: Using /run/pihole-FTL.port
[2022-07-14 16:21:03.330 4615M] WARNING: Unable to write used port to file
[2022-07-14 16:21:03.331 4615M] (API might not find the port)
[2022-07-14 16:21:03.331 4615M] SOCKETFILE: Using /run/pihole/FTL.sock
[2022-07-14 16:21:03.332 4615M] SETUPVARSFILE: Using /etc/pihole/setupVars.conf
[2022-07-14 16:21:03.333 4615M] MACVENDORDB: Using /etc/pihole/macvendor.db
[2022-07-14 16:21:03.333 4615M] GRAVITYDB: Using /etc/pihole/gravity.db
[2022-07-14 16:21:03.333 4615M] PARSE_ARP_CACHE: Active
[2022-07-14 16:21:03.334 4615M] CNAME_DEEP_INSPECT: Active
[2022-07-14 16:21:03.334 4615M] DELAY_STARTUP: No delay requested.
[2022-07-14 16:21:03.335 4615M] BLOCK_ESNI: Enabled, blocking _esni.{blocked domain}
[2022-07-14 16:21:03.335 4615M] NICE: Set process niceness to -10 (default)
[2022-07-14 16:21:03.335 4615M] MAXNETAGE: Removing IP addresses and host names from network table after 365 days
[2022-07-14 16:21:03.336 4615M] NAMES_FROM_NETDB: Enabled, trying to get names from network database
[2022-07-14 16:21:03.337 4615M] EDNS0_ECS: Overwrite client from ECS information
[2022-07-14 16:21:03.337 4615M] REFRESH_HOSTNAMES: Periodically refreshing IPv4 names
[2022-07-14 16:21:03.338 4615M] RATE_LIMIT: Rate-limiting client making more than 1000 queries in 60 seconds
[2022-07-14 16:21:03.339 4615M] LOCAL_IPV4: Automatic interface-dependent detection of address
[2022-07-14 16:21:03.339 4615M] LOCAL_IPV6: Automatic interface-dependent detection of address
[2022-07-14 16:21:03.340 4615M] BLOCK_IPV4: Automatic interface-dependent detection of address
[2022-07-14 16:21:03.340 4615M] BLOCK_IPV6: Automatic interface-dependent detection of address
[2022-07-14 16:21:03.341 4615M] SHOW_DNSSEC: Enabled, showing automatically generated DNSSEC queries
[2022-07-14 16:21:03.341 4615M] MOZILLA_CANARY: Enabled
[2022-07-14 16:21:03.342 4615M] PIHOLE_PTR: internal PTR generation enabled (pi.hole)
[2022-07-14 16:21:03.342 4615M] ADDR2LINE: Enabled
[2022-07-14 16:21:03.342 4615M] REPLY_WHEN_BUSY: Drop queries when the database is busy
[2022-07-14 16:21:03.343 4615M] BLOCK_TTL: 2 seconds
[2022-07-14 16:21:03.343 4615M] BLOCK_ICLOUD_PR: Enabled
[2022-07-14 16:21:03.343 4615M] CHECK_LOAD: Enabled
[2022-07-14 16:21:03.343 4615M] CHECK_SHMEM: Warning if shared-memory usage exceeds 90%
[2022-07-14 16:21:03.344 4615M] CHECK_DISK: Warning if certain disk usage exceeds 90%
[2022-07-14 16:21:03.344 4615M] Finished config file parsing
[2022-07-14 16:21:03.347 4615M] Database version is 12
[2022-07-14 16:21:03.347 4615M] Resizing "FTL-strings" from 40960 to (81920 * 1) == 81920 (/dev/shm: 1.2MB used, 2.0GB total, FTL uses 1.2MB)
[2022-07-14 16:21:03.348 4615M] Imported 0 alias-clients
[2022-07-14 16:21:03.348 4615M] Database successfully initialized
[2022-07-14 16:21:03.386 4615M] Imported 0 queries from the long-term database
[2022-07-14 16:21:03.387 4615M] -> Total DNS queries: 0
[2022-07-14 16:21:03.388 4615M] -> Cached DNS queries: 0
[2022-07-14 16:21:03.388 4615M] -> Forwarded DNS queries: 0
[2022-07-14 16:21:03.389 4615M] -> Blocked DNS queries: 0
[2022-07-14 16:21:03.389 4615M] -> Unknown DNS queries: 0
[2022-07-14 16:21:03.390 4615M] -> Unique domains: 0
[2022-07-14 16:21:03.391 4615M] -> Unique clients: 0
[2022-07-14 16:21:03.391 4615M] -> Known forward destinations: 0
[2022-07-14 16:21:03.392 4615M] Successfully accessed setupVars.conf
[2022-07-14 16:21:03.394 4615M] listening on 0.0.0.0 port 53
[2022-07-14 16:21:03.395 4615M] listening on :: port 53
[2022-07-14 16:21:03.399 4615M] WARNING: Unable to write PID to file.
[2022-07-14 16:21:03.399 4615M] Continuing anyway...
[2022-07-14 16:21:03.399 4615M] PID of FTL process: 4615
[2022-07-14 16:21:03.399 4615/T4616] Listening on port 4711 for incoming IPv4 telnet connections
[2022-07-14 16:21:03.400 4615/T4618] Listening on Unix socket
[2022-07-14 16:21:03.400 4615M] INFO: FTL is running as user pihole (UID 999)
dnsmasq: started, version pi-hole-2.87test8 cachesize 10000
dnsmasq: DNS service limited to local subnets
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n IDN DHCP DHCPv6 Lua TFTP no-conntrack ipset no-nftset auth cryptohash DNSSEC loop-detect inotify dumpfile
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: using nameserver 8.8.4.4#53
dnsmasq: using only locally-known addresses for onion
dnsmasq: using only locally-known addresses for bind
dnsmasq: using only locally-known addresses for invalid
dnsmasq: using only locally-known addresses for localhost
dnsmasq: using only locally-known addresses for test
[2022-07-14 16:21:03.401 4615M] Reloading DNS cache
dnsmasq: read /etc/hosts - 5 addresses
dnsmasq: read /etc/pihole/custom.list - 0 addresses
[2022-07-14 16:21:03.402 4615/T4617] Listening on port 4711 for incoming IPv6 telnet connections
dnsmasq: failed to load names from /etc/pihole/local.list: No such file or directory
[2022-07-14 16:21:03.405 4615/T4619] gravityDB_count(SELECT value FROM info WHERE property = 'gravity_count';) - SQL error step no more rows available
[2022-07-14 16:21:03.406 4615/T4619] Count of gravity domains not available. Please run pihole -g
[2022-07-14 16:21:03.408 4615/T4619] Compiled 0 whitelist and 0 blacklist regex filters for 0 clients in 2.3 msec
[2022-07-14 16:21:03.408 4615/T4619] Blocking status is enabled
Is this a smoking gun?
dnsmasq: failed to load names from /etc/pihole/local.list: No such file or directory
No. That list is rarely used.
Looks like pihole-FTL
has no difficulties accessing the database as such - it is just empty.
Something may be wrong with the script creating the gravity database.
What's the output of:
ls -lah /opt/pihole/
EDIT: @dkozinn, please also provide:
cat /var/log/pihole/pihole_updateGravity.log
pi@pi2:~ $ ls -lah /opt/pihole
total 260K
drwxr-xr-x 2 root root 4.0K Jul 10 18:06 .
drwxr-xr-x 7 root root 4.0K Jul 10 16:05 ..
-rwxr-xr-x 1 root root 21K Jul 10 18:06 chronometer.sh
-rwxr-xr-x 1 root root 1.1K Jul 10 18:06 COL_TABLE
-rwxr-xr-x 1 root root 38K Jul 10 18:06 gravity.sh
-rwxr-xr-x 1 root root 11K Jul 10 18:06 list.sh
-rwxr-xr-x 1 root root 2.0K Jul 10 18:06 piholeARPTable.sh
-rwxr-xr-x 1 root root 8.2K Jul 10 18:06 piholeCheckout.sh
-rwxr-xr-x 1 root root 63K Jul 10 18:06 piholeDebug.sh
-rwxr-xr-x 1 root root 2.9K Jul 10 18:06 piholeLogFlush.sh
-rwxr-xr-x 1 root root 823 Jul 10 18:06 pihole-reenable.sh
-rwxr-xr-x 1 root root 9.1K Jul 10 18:06 query.sh
-rwxr-xr-x 1 root root 2.9K Jul 10 18:06 setupLCD.sh
-rwxr-xr-x 1 root root 8.0K Jul 10 18:06 uninstall.sh
-rwxr-xr-x 1 root root 3.1K Jul 10 18:06 updatecheck.sh
-rwxr-xr-x 1 root root 8.2K Jul 10 18:06 update.sh
-rwxr-xr-x 1 root root 2.9K Jul 10 18:06 utils.sh
-rwxr-xr-x 1 root root 6.7K Jul 10 18:06 version.sh
-rwxr-xr-x 1 root root 29K Jul 10 18:06 webpage.sh
Those files look alright as well.
What about the log file (later edit by me)?
FYI, I just now updated to the latest:
pi@ph5b:~ $ pihole -up
[..]
Update Complete!
Current Pi-hole version is v5.11.4
Current AdminLTE version is v5.13
Current FTL version is v5.16.1
And it still shows:
pi@ph5b:~ $ date; grep -i 'Database version' /var/log/pihole-FTL.log
Thu 14 Jul 23:08:02 CEST 2022
[..]
[2022-07-14 23:02:00.827 22988M] Database version is 12
Apologies - that version is correct - it's for pihole-FTL.db
, not gravity.db
.
I've removed that from my previous post.
Lost me a bit there, was there an ask for me?
Yes, I'm still missing pihole_updateGravity.log
.
Apparently so am I:
pi@pi2:~ $ cat /var/log/pihole/pihole_updateGravity.log
cat: /var/log/pihole/pihole_updateGravity.log: No such file or directory
Try kick here of manually with below and post outcome here:
pihole -g
EDIT: I realized that one might not run properly if nothing populated in that gravity.db
file:
pi@ph5b:~ $ pihole-FTL sqlite3 /etc/pihole/gravity.db "SELECT address FROM adlist"
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
Hold on, I'll type up something else to try.
Done previously with the same result, but here's a fresh one:
pi@pi2:~ $ pihole -g
[✗] DNS resolution is currently unavailable
[✗] DNS resolution is not available
There's more about this up in the thread, but there most definitely is DNS resolution on that box:
pi@pi2:~ $ cat /etc/resolv.conf
# Edited by dbk
#nameserver 192.168.0.48
nameserver 8.8.8.8
pi@pi2:~ $ host pi-hole.net localhost
Using domain server:
Name: localhost
Address: ::1#53
Aliases:
pi-hole.net has address 3.18.136.52
pi-hole.net mail is handled by 10 sunfire.mxrouting.net.
pi-hole.net mail is handled by 20 sunfire-relay.mxrouting.net.
pi@pi2:~ $ host pi-hole.net
pi-hole.net has address 3.18.136.52
pi-hole.net mail is handled by 10 sunfire.mxrouting.net.
pi-hole.net mail is handled by 20 sunfire-relay.mxrouting.net.
Was this what you wanted?
pi@pi2:~ $ pihole-FTL sqlite3 /etc/pihole/gravity.db "SELECT address FROM adlist"
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
I also tried fetching that file and it succeeded. (Did something similar previously as well.)
Was this what you wanted?
Yeah exactly.
It proves that gravity.db
file is populated.
[✗] DNS resolution is currently unavailable [✗] DNS resolution is not available
The gravity code phole -g
relies on the DNS nameserver(s) defined in below file:
/etc/resolv.conf contains:
nameserver 8.8.8.8
What does below ones show?
EDIT: nslookup -type=A raw.githubusercontent.com
dig @8.8.8.8 raw.githubusercontent.com a
And as I cant peek into the uploaded debug logs, also provide below pls?
ip -br l
ip -br -4 a
ip -4 r