Buggy regex.list

Please follow the below template, it will help us to help you!

Expected Behaviour:

Trying to add domain to blacklist as wildcard

Actual Behaviour:

Failure! Something went wrong.
Unable to add regex "(^|.)plufdsb.com$" to /etc/pihole/regex.list
Error message: file_put_contents(/etc/pihole/regex.list): failed to open stream: Permission denied

Debug Token:

none

ls -l /etc/pihole/regex.list
-rw-r--r-- 1 pihole pihole 10772 Nov 3 07:30 /etc/pihole/regex.list

Not sure why it does that now. Had the pi-hole running for like 1 year now whit no problems

1 Like

Since you are writing to this from the admin interface, www-data needs access. Here's my output for the same command (Pi-Hole on a Pi):

ls -l /etc/pihole/regex.list
-rw-rw-r-- 1 pihole www-data 9432 Nov 14 10:41 /etc/pihole/regex.list

Are you running Pi-Hole in docker?

on a VPS server

chown pihole:www-data /etc/pihole/regex.list

Works now.

Hmm The error is back again.

Failure! Something went wrong.
Unable to add regex "(^|.)tagcommander.com$" to /etc/pihole/regex.list
Error message: file_put_contents(/etc/pihole/regex.list): failed to open stream: Permission denied

ls -l /etc/pihole/regex.list
-rw-r--r-- 1 pihole www-data 10772 Nov 3 07:30 /etc/pihole/regex.list

What is the umask on that server?

Needs to be chmod 664 /etc/pihole/regex.list

2 Likes

I have never set any chmod on any files in /etc/pihole before

That may be the case, but the permissions on your regex list are not correct and need to be changed to correct the problem (however it occurred).

What was the output of umask ?

Says 0022

...

With a umask of 0022 then any file created will automatically be set to 644. We set the permissions on the file creation, but if you manually created the file or edited it then when it was created outside of our process it would have been set to 644 instead of 664. We need the group to have write permissions.

1 Like

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