setupVars.conf has syntax errors: pihole works, but admin panel is corrupted

Hello, I have a raspberry pi4 with retropie, kodi and pihole running. I recently had to reflash my SSd with a backup image - and although pihole is working, the admin panel seems to be corrupted. Please find the error messages and all things I have tried in folowwing sections - and once again, thanks a lot for support!

Expected Behaviour:

PiHole admin panel shows stats etc.

Actual Behaviour:

No stats shown on admin panel

Settings page shows the above error and none of the settings changes are indeed applied

Restoring using teleporter gives the following error:

Error connecting to database /etc/pihole/gravity.db: Unable to open database: unable to open database file

I simply tried to use pihole -r to repair/ reconfigure it, but both show a similar error:

Even a full install did not work (still using pihole -r):

All this time, pihole is properly working, and blocking ads like a champ~

pi@retropie:~ $ pihole status
[✓] DNS service is listening
[✓] UDP (IPv4)
[✓] TCP (IPv4)
[✓] UDP (IPv6)
[✓] TCP (IPv6)

[✓] Pi-hole blocking is enabled

Lastly, setupVars.conf has the following content:

<?xml version="1.0"?>
<bool name="BackgroundJoystickInput" value="false" />
<bool name="CaptionsCompatibility" value="true" />
<bool name="CollectionShowSysBLOCKING_ENABLED=true
PIHOLE_DNS_3=1.1.1.1
PIHOLE_DNS_4=1.0.0.1
DNS_FQDN_REQUIRED=true
DNS_BOGUS_PRIV=true
DNSSEC=false
REV_SERVER=false
WEBPASSWORD=XXXXXX
PIHOLE_INTERFACE=eth0
IPV4_ADDRESS=192.168.1.115/24
IPV6_ADDRESS=
PIHOLE_DNS_1=8.8.8.8
PIHOLE_DNS_2=8.8.4.4
QUERY_LOGGING=true
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
LIGHTTPD_ENABLED=true
CACHE_SIZE=10000

Debug Token:

q35z868eql

Remove the first 3,5 lines from that file.
BLOCKING_ENABLED=True should stay,.

huh, that worked!

where did the lines come from?

Well - thank you so much!!!

Well, i can update reconfigure and repair installation, but there is something wrong with my gravity lists.

I tried using the teleporter aagain, and got,

Failed to prepare statement for adlist table.INSERT OR IGNORE INTO adlist (id,address,enabled,date_added,comment) VALUES (:id,:address,:enabled,:date_added,:comment);Processed adlist (0 entries)
Failed to prepare statement for adlist_by_group table.INSERT OR IGNORE INTO adlist_by_group (adlist_id,group_id) VALUES (:adlist_id,:group_id);Processed adlist group assignments (0 entries)
Failed to prepare statement for blacklist table.INSERT OR IGNORE INTO domainlist (id,domain,enabled,date_added,comment,type) VALUES (:id,:domain,:enabled,:date_added,:comment,1);Processed blacklist (exact) (0 entries)
Failed to prepare statement for regex_blacklist table.INSERT OR IGNORE INTO domainlist (id,domain,enabled,date_added,comment,type) VALUES (:id,:domain,:enabled,:date_added,:comment,3);Processed blacklist (regex) (0 entries)
Failed to prepare statement for client table.INSERT OR IGNORE INTO client (id,ip,date_added,comment) VALUES (:id,:ip,:date_added,:comment);Processed client (0 entries)
Failed to prepare statement for client_by_group table.INSERT OR IGNORE INTO client_by_group (client_id,group_id) VALUES (:client_id,:group_id);Processed client group assignments (0 entries)
Failed to prepare statement for domain_audit table.INSERT OR IGNORE INTO domain_audit (id,domain,date_added) VALUES (:id,:domain,:date_added);Processed domain_audit (0 entries)
Failed to prepare statement for domainlist_by_group table.INSERT OR IGNORE INTO domainlist_by_group (domainlist_id,group_id) VALUES (:domainlist_id,:group_id);Processed black-/whitelist group assignments (0 entries)
Failed to prepare statement for group table.INSERT OR IGNORE INTO "group" (id,name,date_added,description) VALUES (:id,:name,:date_added,:description);Processed group (0 entries)
Failed to prepare statement for whitelist table.INSERT OR IGNORE INTO domainlist (id,domain,enabled,date_added,comment,type) VALUES (:id,:domain,:enabled,:date_added,:comment,0);Processed whitelist (exact) (0 entries)
Failed to prepare statement for regex_whitelist table.INSERT OR IGNORE INTO domainlist (id,domain,enabled,date_added,comment,type) VALUES (:id,:domain,:enabled,:date_added,:comment,2);Processed whitelist (regex) (0 entries)
OK

So - too many errors, but what @yubiuser's solution did was to enable me to uninstall and reinstall pihole completely - hence I am closing this. Thanks!

No, it would be the fact that setupVars.conf literally contained xml data. Nothing even close to newlines.

I would be highly surprised if Pi-hole was able to write xml for BackgroundJoystickInput.

I suspect there is filesystem corruption and the inodes crossed so files were pointing to blocks that were not their own.

There's obviously no problems with newlines in that output. There are no lines with extra information on one line.

Edit: It's not a newline that is the problem, it's the < and > as it's seen as a redirect.

I disagree but then this is derailing the topic and I don't want to do that whole dance again. You made your point of linking to your topic and that's enough.

If you didn't enter those lines yourself, you're likely suffering from file system corruption.

Either your SD card is nearing its end of life, or you're using an insufficient PSU to power your RPi, or the backup image you are reflashing is itself corrupted.
You could try to confirm the latter if reflashing your backup image (optionally, to another SD card) would produce the same faulty lines in setupVars.conf.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.