Unable to add lists. Database seems to be readonly on Kubernetes

Hi,

I'm running pihole on a Raspberry Pi k3s Cluster and everything was working fine until I changed the Storage Provisioner from local-path-provisioner to nfs-subdir-external-provisioner. But maybe it's unrelated to this change.

At the moment I can't add any list and getting always this error.

Error, something went wrong!
While executing: attempt to write a readonly database
Added 0 out of 1 adlists

Here is also the log attached.
pihole-debug.txt (26.4 KB)

And here also the ls output of /etc/pihole

ls -lash   
total 6.5M
2.0K drwxr-xr-x 3 pihole pihole   17 Apr 14 09:11 .
8.0K drwxr-xr-x 1 root   root   4.0K Apr 14 07:13 ..
1.5K -rw-r--r-- 1 root   root     16 Apr 14 07:13 GitHubVersions
1.0K -rw-r--r-- 1 root   root      0 Apr 14 08:19 adlists.list
1.5K -rw-r--r-- 1 root   root     65 Apr 14 07:13 adlists.list.old
1.5K -rw-r--r-- 1 root   root    337 Apr 14 06:16 custom.list
2.0K -rw-r--r-- 1 root   root    618 Apr 14 07:13 dns-servers.conf
4.4M -rw-rw-r-- 1 pihole pihole 4.3M Apr 14 07:13 gravity.db
1.6M -rw-r--r-- 1 root   root   1.5M Apr 14 07:13 list.1.raw.githubusercontent.com.domains
1.5K -rw-r--r-- 1 root   root    168 Apr 14 07:13 local.list
1.5K -rw-r--r-- 1 root   root     20 Apr 14 09:10 localbranches
1.5K -rw-r--r-- 1 root   root     40 Apr 14 09:10 localversions
1.0K drwxr-xr-x 2 root   root      3 Apr 14 06:11 migration_backup
1.0K -rw-r--r-- 1 pihole pihole    0 Apr 14 06:11 pihole-FTL.conf
515K -rw-r--r-- 1 root   root   392K Apr 14 09:11 pihole-FTL.db
2.0K -rw-r--r-- 1 root   root    594 Apr 14 07:13 setupVars.conf
2.0K -rw-r--r-- 1 root   root    594 Apr 14 07:13 setupVars.conf.update.bak

Thank you. If you need anything else just write me.

Greets,
Christian

1 Like

TL;DR:

Remove --manage-gids from the RPCMOUNTDOPTS in the file /etc/default/nfs-kernel-server on the NFS server and restart the nfs-kernel-server service.

I found the solution on my own. One day later I justed searched for the right thing and found this topic and this issue.

1 Like

I've visit this site a lot and never have my account registered. I registered to leave a comment here because you saved my day, I have the exact same settings as yours and this trick does solved the problem, thank you so much and wish you happy & wealthy.