Cannot see dashboard screens after recent Pi-Hole update

Expected Behaviour:

The dashboard screens should show data and settings

  • Raspberry OS (Debian v. 9.13)
  • Raspberry Pi

Actual Behaviour:

The dashboard is not showing or are lacking data. I can see the UI and the menus but not the graphs, data, settings etc.

Reason I need help is that I want to update to Debian 10 or 11 and would like to back up my Pi-Hole settings but can't access the Settings screen or figure out how to do so using CLI. I get this error message:

pihole -a -t
PHP Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /var/www/html/admin/scripts/pi-hole/php/database.php on line 285

Debug Token:

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

screen shot

Um, I think this is a different problem...

1 Like

Right you are - my error.

You can make a teleporter export file using the terminal - just be sure to move the file off the uSD card to somewhere it will be available after you format the uSD card.

pihole -a -t

pihole -a --help
Usage: pihole -a [options]
Example: pihole -a -p password
Set options for the Admin Console

Options:
  -p, password                    Set Admin Console password
  -c, celsius                     Set Celsius as preferred temperature unit
  -f, fahrenheit                  Set Fahrenheit as preferred temperature unit
  -k, kelvin                      Set Kelvin as preferred temperature unit
  -h, --help                      Show this help dialog
  -i, interface                   Specify dnsmasq's interface listening behavior
  -l, privacylevel                Set privacy level (0 = lowest, 3 = highest)
  -t, teleporter                  Backup configuration as an archive
  -t, teleporter myname.tar.gz    Backup configuration to archive with name myname.tar.gz as specified`

Hi, thanks for the response. The problem is that I cannot export the settings via the teleporter by either UI or CLI (see the error message I received pasted in on my post).

You are using the version v5.14 of the web interface.

The error happens here, at line 285:

This code causes errors if PHP version is less than 7.1.

This was already fixed by Use constants in place of class constants by rdwebdesign · Pull Request #2342 · pi-hole/AdminLTE · GitHub


Edit:

If you want a quick fix to allow you to use teleporter before you update your OS, just remove the public keyword and save the file. Like this:

if (!class_exists('ListType')) {
    class ListType
    {
        const whitelist = 0;
        const blacklist = 1;
        const regex_whitelist = 2;
        const regex_blacklist = 3;
    }
}

This will probably avoid the error and you will be able to save your config.

2 Likes

I went with your quick edit to database.php and my dashboard returned! Coincidentally, I found that the backup file DID indeed save to my drive even with the error. :roll_eyes: I re-exported the teleporter file anyway from the UI to yet another drive just to be extra certain I had my 5+ years of configs backed up.

THANKS!!

1 Like