A Few issues with the beta on a fresh install

im still having these errors from the log and i think its affecting gravity, im not exactly sure what it means
2020-02-08 17:44:02: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning: SQLite3St mt::execute(): Unable to execute statement: attempt to write a readonly database in /var/www/html/admin/scripts/pi-hole/php/database.php on line 165

Check your database permissions. Both /etc/pihole and /etc/pihole/gravity.db should be owned by pihole:pihole and the web server user should be member of the group pihole.

Here some Screenshots to help with debugging, thins is the 3rd fresh install ive done with the same issues, i hope it helps.
when i tested its the same issue on any fresh install i do, if you need in willing to let you team viewer in and check if need be

Thanks, I’m sure we’ll get down to it. What are the outputs of

sudo ps aux | grep lighttpd
groups pihole

here is the out put of both

Hmm, this looks like what I’d have expected.

What does

sudo -u pihole sqlite3 /etc/pihole/pihole-FTL.db "SELECT * FROM queries LIMIT 1;"


@DanSchaper @PromoFaux This looks to be a Rock64. I vaguely recall one of you having played with this thing if I’m not completely mistaken, do you recall any specialty that was needed to get Pi-hole running on there?

the only issue prior i had was php failing to auto install, with the pi-hole 4.0 installer but that came up as a known issue if i rember correctly, after a manual install it works.
It installs the same as it does on my pi 3B, ill eventually be upgrading to a pi 4.0

Okay, so

  1. the web user is www-data, and
  2. the user pihole was able to correctly read a line from the database.

Let’s try:

sudo -u www-data sqlite3 /etc/pihole/pihole-FTL.db "SELECT * FROM queries LIMIT 1;"

If this works as well, I’m seriously confused what may be going wrong. Have you already tried restarting* the device?

*) I know that this sounds very much like a Windows advice, however, we’ve seen before that the web user didn’t pick up permission changes due to the addition of www-data to group pihole. A restart fixes such a thing.

i rebooted and i reinstalled twice before, not sure if this has something to do with it but i had to install php manually when i installed version 4.0, it fails cant remember when it started exactly on install when in install 4.0, but it happens when i use the curl command to install pi-hole.
for some reason the installer fails to install that dependency and i have to manually install php in order for the installer to keep going.
ill see about wiping it again and see if it sill has an issue

heres the screen shot of the command

when installed the update for the first time and it worked i got an update could not complete please contact support error after the upgrade and this gravity error, this error occurred even when the gui was working

Hmm, this enormous list of errors is very strange…and this happens from fresh checkout? I will have to try this myself at some point. I still don’t know why the web interface cannot work on the database.

Do you have SELinux or maybe apparmor in use on your Rock64?

Installer did not detect any se Linux it was green, and I have no Idea what app armour is.

Could it have anything to do with me manually installing PHP when I installed 4.0 due to the depndacy falling to install with the script?

I don’t really think so, because the web interface does actually load for you (at least partially) and the SQLite error in the error log also shows you seem to have the right PHP database plugin ready at hand.

2020-02-08 17:44:02: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning: SQLite3Stmt::execute(): Unable to execute statement: attempt to write a readonly database in /var/www/html/admin/scripts/pi-hole/php/database.php on line 165

What is strange is also that it “just” doesn’t work for you. The API doesn’t seem to give any output whereas there is no error logged … wait … do you use any browser plugins in the browser you used for testing? If so, please disable them all for one second and try again. Also, please try to access the web interface from another device, preferably using a different browser (e.g., mobile phone).

This just to ensure we’re looking at the right end of the line…

No plugins, at all just stock chrome and edge, also same issue in chrome on mobile, is it possible there is an issue with me having 3mill domains on block list before I did the upgrade

From mobile screen shot, chrome browser.

Okay, it is still a bit confusing, so the -2 on the number of blocked domains is gone and replaced by the correct number, but the rest is still not working (guessing from your photo of your screen).

No, the number of blocking domains is mostly irrelevant and we’re commonly seeing that Pi-hole works with such large numbers even on low-end hardware.

What is the output of

sudo getenforce
sudo aa-status 

? This will check SELinux and AppArmor. If any error pops up, this may be okay as that might just show that this respective thing is not even installed.

Did you point any device at the Pi-hole? If not, please perform a few queries on the device locally, e.g. using

dig discourse.pi-hole.net @

The photos is from the 4.0 installation before I updated to 5.0 after I updated to 5 I lost a few domains due to the gravity error.

I pointed my phone at it at one point, but not recently.

Okay, so next question is: What is the output of

edit Also, could you tell me what blocking lists you’re using? I will try to reproduce this.

sqlite3 /etc/pihole/gravity.db "SELECT address FROM vw_adlist;"

should tell you


Thanks, please also see my edit. I think I need to try to reproduce this locally.

Do you still see the same when disabling all but one standard blocking list and running pihole -g thereafter?