Pi-hole not receiving queries

Thanks, I ran the following:

pi@raspberrypi:~ $ sudo dpkg -P --force-depends php7.3-json
dpkg: php7.3-json: dependency problems, but removing anyway as you requested:
 php7.3-cli depends on php7.3-json.
 php7.3-cgi depends on php7.3-json.

(Reading database ... 154545 files and directories currently installed.)
Removing php7.3-json (7.3.19-1~deb10u1) ...
Purging configuration files for php7.3-json (7.3.19-1~deb10u1) ...
pi@raspberrypi:~ $ sudo apt install --reinstall php7.3-json
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 dnsmasq-base : Depends: libhogweed2 (>= 2.7) but it is not installable
                Depends: libnettle4 (>= 2.2) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or speci                                          fy a solution).
pi@raspberrypi:~ $ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  dnsmasq-base php7.3-json
The following NEW packages will be installed:
  php7.3-json
The following packages will be upgraded:
  dnsmasq-base
1 upgraded, 1 newly installed, 0 to remove and 159 not upgraded.
2 not fully installed or removed.
Need to get 400 kB/416 kB of archives.
After this operation, 42.0 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://archive.raspberrypi.org/debian buster/main armhf dnsmasq-base armhf                                           2.80-1+rpt1 [400 kB]
Fetched 400 kB in 1s (496 kB/s)
Reading changelogs... Done
(Reading database ... 154536 files and directories currently installed.)
Preparing to unpack .../dnsmasq-base_2.80-1+rpt1_armhf.deb ...
Unpacking dnsmasq-base (2.80-1+rpt1) over (2.76-5+rpi1) ...
Selecting previously unselected package php7.3-json.
Preparing to unpack .../php7.3-json_7.3.19-1~deb10u1_armhf.deb ...
Unpacking php7.3-json (7.3.19-1~deb10u1) ...
Setting up php7.3-json (7.3.19-1~deb10u1) ...

Creating config file /etc/php/7.3/mods-available/json.ini with new version
Setting up dnsmasq-base (2.80-1+rpt1) ...
Setting up dnsmasq (2.76-5+rpi1) ...

Configuration file '/etc/dnsmasq.conf'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** dnsmasq.conf (Y/I/N/O/D/Z) [default=N] ? Y
Installing new version of config file /etc/dnsmasq.conf ...
Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /l                                          ib/systemd/system/dnsmasq.service.
Job for dnsmasq.service failed because the control process exited with error cod                                          e.
See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
invoke-rc.d: initscript dnsmasq, action "start" failed.
● 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 Wed 2020-10-14 10:54:43 CDT; 59ms ag                                          o
  Process: 8418 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUC                                          CESS)
  Process: 8419 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=                                          2)

Oct 14 10:54:43 raspberrypi systemd[1]: Starting dnsmasq - A lightweight DHCP an                                          d caching DNS server...
Oct 14 10:54:43 raspberrypi dnsmasq[8418]: dnsmasq: syntax check OK.
Oct 14 10:54:43 raspberrypi dnsmasq[8419]: dnsmasq: failed to create listening s                                          ocket for port 53: Address already in use
Oct 14 10:54:43 raspberrypi dnsmasq[8419]: failed to create listening socket for                                           port 53: Address already in use
Oct 14 10:54:43 raspberrypi dnsmasq[8419]: FAILED to start up
Oct 14 10:54:43 raspberrypi systemd[1]: dnsmasq.service: Control process exited,                                           code=exited, status=2/INVALIDARGUMENT
Oct 14 10:54:43 raspberrypi systemd[1]: dnsmasq.service: Failed with result 'exi                                          t-code'.
Oct 14 10:54:43 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight                                           DHCP and caching DNS server.
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for dbus (1.12.16-1) ...
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
pi@raspberrypi:~ $

The dashboard is still not working. Not sure what the dnsmasq failures are about.

Run php -m again and see if json appears.

Somehow dnsmasq was installed/updated during the process. This will conflict with pihole, which has dnsmasq build in. So please uninstall dnsmasq

sudo apt-get remove dnsmasq-base

Yes, json appears now.

pi@raspberrypi:~ $ php -m
[PHP Modules]
calendar
Core
ctype
date
dom
exif
fileinfo
filter
ftp
gettext
hash
iconv
intl
json
libxml
openssl
pcntl
pcre
PDO
Phar
posix
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

pi@raspberrypi:~ $ sudo apt-get remove dnsmasq-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  dnsmasq dnsmasq-base
0 upgraded, 0 newly installed, 2 to remove and 158 not upgraded.
After this operation, 967 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 154545 files and directories currently installed.)
Removing dnsmasq (2.76-5+rpi1) ...
Removing dnsmasq-base (2.80-1+rpt1) ...
Processing triggers for man-db (2.8.5-2) ...

I rebooted the pi-hole, but the dashboard is still broken:

Please generate a new debug token

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

[I removed the debug log - it might contain sensible data]

Your debug log looks fine.

You can try two things

  1. Clear your browser's cache
  2. Run pihole -r again (choose repair)

After doing both things, the query log is now fixed instead of throwing an error.

However, local DNS records throws this error: DataTables warning: table id=customDNSTable - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

Groups under Group Management also throws basically the same error: DataTables warning: table id=groupsTable - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

Pi-hole diagnosis under Tools is the same: DataTables warning: table id=messagesTable - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

The overall dashboard is also not working yet. It seems like all these errors are related?

Edit: Tried this on two different browsers with the same results.

Edit 2: If it's any help, here's the output from the repair:

pi@raspberrypi:~ $ pihole -r

  [✓] Root user check

        .;;,.
        .ccccc:,.
         :cccclll:.      ..,,
          :ccccclll.   ;ooodc
           'ccll:;ll .oooodc
             .;cll.;;looo:.
                 .. ','.
                .',,,,,,'.
              .',,,,,,,,,,.
            .',,,,,,,,,,,,....
          ....''',,,,,,,'.......
        .........  ....  .........
        ..........      ..........
        ..........      ..........
        .........  ....  .........
          ........,,,,,,,'......
            ....',,,,,,,,,,,,.
               .',,,,,,,,,'.
                .',,,,,,'.
                  ..'''.

  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.3.19-1~deb10u1
  [i] Repair option selected
  [✓] Disk space check

  [✓] Checking apt-get for upgraded packages... 158 updates available
  [i] It is recommended to update your OS after installing the Pi-hole!

  [i] Installer Dependency checks...
  [✓] Checking for dhcpcd5
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for whiptail
  [✓] Checking for dnsutils

  [✓] Supported OS detected
  [i] SELinux not detected
  [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 cron
  [✓] Checking for curl
  [✓] Checking for iputils-ping
  [✓] Checking for lsof
  [✓] Checking for netcat
  [✓] Checking for psmisc
  [✓] Checking for sudo
  [✓] Checking for unzip
  [✓] Checking for wget
  [✓] Checking for idn2
  [✓] Checking for sqlite3
  [✓] Checking for libcap2-bin
  [✓] Checking for dns-root-data
  [✓] Checking for libcap2
  [✓] Checking for lighttpd
  [✓] Checking for php7.3-common
  [✓] Checking for php7.3-cgi
  [✓] Checking for php7.3-sqlite3
  [✓] Checking for php7.3-xml
  [✓] Checking for php7.3-intl

  [✓] Enabling lighttpd service to start on reboot...
  [✓] Checking for user 'pihole'

  [i] FTL Checks...

  [✓] Detected ARM-hf architecture (armv7+)
  [i] Checking for existing FTL binary...
  [i] Latest FTL Binary already installed (v5.2). Confirming Checksum...
  [i] Checksum correct. No need to download!
  [✓] 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] Installing blocking page...
  [✓] Creating directory for blocking page, and copying files
  [i] 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] Backing up /etc/dnsmasq.conf to /etc/dnsmasq.conf.old
  [✓] man pages installed and database updated
  [i] Testing if systemd-resolved is enabled
  [i] Systemd-resolved is not enabled
  [✓] Restarting lighttpd service...
  [✓] Enabling lighttpd service to start on reboot...
  [i] Restarting services...
  [✓] Enabling pihole-FTL service to start on reboot...
  [✓] Restarting pihole-FTL service...
  [✓] Deleting existing list cache
  [i] Neutrino emissions detected...
  [✓] Pulling blocklist source list into range

  [✓] Preparing new gravity database
  [i] Target: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
  [✓] Status: Retrieval successful
  [i] Received 56288 domains

  [i] Target: https://mirror1.malwaredomains.com/files/justdomains
  [✓] Status: Retrieval successful
  [i] Received 26854 domains

  [✓] Storing downloaded domains in new gravity database
  [✓] Building tree
  [✓] Swapping databases
  [i] Number of gravity domains: 83142 (83100 unique domains)
  [i] Number of exact blacklisted domains: 0
  [i] Number of regex blacklist filters: 0
  [i] Number of exact whitelisted domains: 0
  [i] Number of regex whitelist filters: 0
  [✓] Flushing DNS cache
  [✓] Cleaning up stray matter

  [✓] DNS service is running
  [✓] Pi-hole blocking is Enabled

  [i] The install log is located at: /etc/pihole/install.log
Update Complete!

  Current Pi-hole version is v5.1.2.
  Current AdminLTE version is v5.1.1.
  Current FTL version is v5.2.

This has worked in at least two other cases


If it's not working yet, I'm out of ideas.

It is still not working. However the query log is now functional so that's a big step forward. Thank you for your help to get this far.

@jfb Do you have any further suggestions for fixing the dashboard?