Attempt to write to readonly database

I am getting the error "cannot write to read only database" when saving to thw whitelist. This topic was previously reported on in this thread

I have checked that www-data is a member of the pihole group. This should be OK since the gravity database is pihole:pihole 664 and is as should be as reported in the above post

pi@raspberrypi-b:~ $ grep pihole /etc/group
pihole:x:995:www-data

pi@raspberrypi-b:~ $ stat -c "%U:%G %a %n" /etc/pihole/* | column -t
root:root 644 /etc/pihole/adlists.list
root:root 644 /etc/pihole/adlists.list.old
root:root 644 /etc/pihole/custom.list
pihole:pihole 644 /etc/pihole/dhcp.leases
root:root 644 /etc/pihole/dns-servers.conf
root:root 644 /etc/pihole/GitHubVersions
pihole:pihole 664 /etc/pihole/gravity.db
root:root 644 /etc/pihole/install.log
root:root 644 /etc/pihole/list.1.raw.githubusercontent.com.domains
root:root 644 /etc/pihole/list.1.raw.githubusercontent.com.domains.sha1
root:root 644 /etc/pihole/localbranches
root:root 644 /etc/pihole/local.list
root:root 644 /etc/pihole/localversions
root:root 644 /etc/pihole/logrotate
pihole:pihole 644 /etc/pihole/macvendor.db
root:root 755 /etc/pihole/migration_backup
pihole:root 664 /etc/pihole/pihole-FTL.conf
pihole:pihole 644 /etc/pihole/pihole-FTL.db
root:root 644 /etc/pihole/setupVars.conf

System - Raspberry PI-B 8GB, pihole, lighttpd
Lighttpd is installed to /var/www/pihole rather than the default /var/www/html since I already run an Apache2 instance at that location.
pi@raspberrypi-b:~ $ cat /etc/lighttpd/external.conf
server.document-root := "/var/www/pihole"
server.port := 8080

There haven't been any changes since the original install (~3mo) though this issue could have been there all along. I just never had cause to write the whitelist till today.

Mint that all folders beneath the database need to be accessible for www-data (so it can get there) and the directory containing the database itself needs to be writable for the group. Because sqlite3 has to create a journal file next to the database as safeguard in case a powercut happens in the middle of writing to the database.

The database is a file at /etc/pihole/gravity.db, so there aren't folders below it?

/etc/pihole/ is pihole:pihole 755. Should this be set to 775?

I did try this and it now allows the whitelist to be written so I guess I answered my own question :+1:

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