Webmin doesn't save

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

Expected Behaviour:

Make a change on the web interface, have the change saved when i click save

Actual Behaviour:

Make a change on the web interface, change doesnt save when I click save

Debug Token:

ak634r9d27

Settings not saved via web interface has a very similar issue with slight differences.

System is CentOS 7.4, selinux is set to permissive

to add a little, my status also shows unknown. If i click enable, it will green up until i click or refresh, then it's unknown again. That said, everything is working, so this may be cosmetic.

In your debug log I see some errors in your /var/log/lighttpd/error.log like:

   2017-12-28 10:59:00: (mod_fastcgi.c.434) FastCGI-stderr: PHP Fatal error:  Can't use function return value in write context in /var/www/html/pihole/index.php on line 108
   2017-12-28 10:59:54: (mod_fastcgi.c.434) FastCGI-stderr: PHP Fatal error:  Can't use function return value in write context in /var/www/html/pihole/index.php on line 108

do these coincidence with the times you tried to save something?

They do not, here is how I checked
I opened up a tail session on /var/log/lighttpd/error.log
i logged into the webmin and made a dns change, i clicked save. I clicked refresh (noted that the change has not saved) and verified no log entries in my tail session during this time.

to add to this, here are the referenced lines

// Determine if at least one block list has been generated
if (empty(glob("/etc/pihole/list.0.*.domains")))
    die("[ERROR] There are no domain lists generated lists within <code>/etc/pihole/</code>! Please update gravity by running <code>pihole -g</code>, or repair Pi-hole using <code>pihole -r</code>.");

ls /etc/pihole/list.0.*.domains
-rw-------. 1 root root 1276933 Dec 28 11:27 /etc/pihole/list.0.raw.githubusercontent.com.domains

Okay, do you see anything in your SELinux logs? The webinterface in its current form is running small scripts in the background to save updates to the configuration, so if the webserver is not allowed to run the command pihole with arguments, saving the configuration will not work. We are working on an all-integrated API that can handle everything without having to rely on external scripts but that one is still very much in the works.

I do have some items in selinux logs, but since i'm in permissive mode, it's just logging what would've been blocked (i havent set any constraints since im permissive, so i expect failures for pihole things), not taking any action. here are the relevant lines

type=USER_CMD msg=audit(1514489299.576:369): pid=8849 uid=992 auid=4294967295 ses=4294967295 subj=system_u:system_r:httpd_t:s0 msg='cwd="/var/www/html/admin" cmd=7069686F6C652073746174757320776562 terminal=? res=failed'
type=USER_CMD msg=audit(1514489299.580:370): pid=8850 uid=992 auid=4294967295 ses=4294967295 subj=system_u:system_r:httpd_t:s0 msg='cwd="/var/www/html/admin" cmd=7069686F6C65202D61202D69206C6F63616C202D776562 terminal=? res=failed'
type=USER_CMD msg=audit(1514489299.583:371): pid=8851 uid=992 auid=4294967295 ses=4294967295 subj=system_u:system_r:httpd_t:s0 msg='cwd="/var/www/html/admin" cmd=7069686F6C65202D6120736574646E73203139322E3136382E3132382E33302C382E382E342E3420646F6D61696E2D6E656564656420626F6775732D70726976206E6F2D646E73736563 terminal=? res=failed'

Is there a message at the top of the page after you try to save?

yes, it just states

Info

The DNS settings have been updated (using 2 DNS servers)

but it doesnt

I just performed a fresh install on CentOS7 and I was able to successfully add additional block lists and change my upstream DNS without issues.
However, I do not get the same PHP errors as you..

  • Is this a fresh install or an upgrade?
  • have you reboot since the install?
  • what DNS settings are you attempting to change?
  • Your debug log states that you also have local changes in your web directory. What changes have you made?
  • Was an existing centos7 box running openvpn and dhcpd
  • I have rebooted
  • the DNS ip for server 2 (i changed it in the file, so i'm not stuck or anything)
  • the only changes I made to the local web directory were chcon when i was going to leave selinux to enforcing

If it's not reproducible, it's not a big deal and we can close this. I just wanted to ensure I shared a potential bug :slight_smile:

I was unable to reproduce this issue.
Please try pihole -r with reconfigure option.

i am getting the same error on a fresh install of pihole. attempting to load the initial web page generates a 500 error in the browser, and

2018-01-02 03:14:57: (mod_fastcgi.c.2683) FastCGI-stderr: PHP Fatal error: Can't use function return value in write context in /var/www/html/pihole/index.php on line 108

in the error.log.

i have never gotten the web page to work, so i'm not trying to even save anything!

[update] i am accessing 192.168.0.5 (the pihole server); when i access 192.168.0.5/admin i do get the admin console, but the default lighttpd index.html still doesn't display and returns 500 error

tricorder: hv2yr3ih9v

I went ahead and did a full rebuild of the system. It's now debian 9 and everything is working properly.

2 Likes

Pinging @WaLLy3K on this. pihole/index.php is the blocking page.

1 Like

After i created index.html (and renamed index.php) in /var/www/html/pihole, http://192.168.0.5/pihole/ does bring up index.html ( and http://192.168.0.5 returns a 404 error )

interesting that http://192.168.0.5/pihole/ shows as GET /pihole/ HTTP/1.1|304|0 in access.log instead of a 200...

I also have (almost) this issue. Mine specifically is that i don't get the "blocking page" once i hit a blocked page (or http://pi.hole/ results in HTTP error 500). The error is similar:

2018-02-06 20:09:20: (mod_fastcgi.c.434) FastCGI-stderr: PHP Fatal error: Can't use function return value in write context in /var/www/html/pihole/index.php on line 108

I had to temporarily comment that specific line:

// Determine if at least one block list has been generated
//if (empty(glob("/etc/pihole/list.0.*.domains")))
//    die("[ERROR] There are no domain lists generated lists within <code>/etc/pihole/</code>! Please update gravity by running <code>pihole -g</code>, or repair Pi-hole using <code>pihole -r</code>.");

I tried:
pihole -r
pihole -up

OS fully updated...
Nothing seems to help.
Everything else works fine, lists are being saved, updated...

OS details:
centos-release-7-4.1708.el7.centos.x86_64
Kernel: Linux 3.10.0-693.17.1.el7.x86_64
SELinux disabled

So I replaced the code with this:

if (!glob("/etc/pihole/list.0.*.domains"))
    die("[ERROR] There are no domain lists generated lists within <code>/etc/pihole/</code>! Please update gravity by running <code>pihole -g</code>, or repair Pi-hole using <code>pihole -r</code>.");

No more error :slight_smile: