Converting DHCP lease to static -> PHP error

Problem with Beta 5.0:
When I convert a DHCP lease to static a PHP error is shown:

There was a problem applying your settings.
Debugging information:
PHP error (2): fopen(/etc/dnsmasq.d/04-pihole-static-dhcp.conf): failed to open stream: No such file or directory in /var/www/html/admin/scripts/pi-hole/php/savesettings.php:84

Clean install of Beta 5 on a fresh Debian Buster VM.

Pi-hole Version vDev (release/v5.0, v4.3.2-419-gee7090b) Web Interface Version vDev (release/v5.0, v4.3.2-424-ge169bec9) FTL Version vDev (release/v5.0, vDev-ff840d0)

Debug Token:
https://tricorder.pi-hole.net/0eqvway2fv

What is the contents of /etc/dnsmasq.d/04-pihole-static-dhcp.conf?

There are some database errors as well. How did you upgrade to the beta release?

Hi Dan.

dhcp-host=XX:XX:XX:XX:XX,192.168.XX.XX,MYHOSTNAME (I tried only to convert one address to static, so it worked but throwed the above mentioned error)

I followed these instructions from @DL6ER:

sudo mkdir /etc/pihole/
echo "release/v5.0" | sudo tee /etc/pihole/ftlbranch

sudo mkdir -p /var/www/html/admin
cd /var/www/html/admin
sudo git clone https://github.com/pi-hole/AdminLTE.git .
sudo git checkout release/v5.0

sudo mkdir -p /etc/.pihole
cd /etc/.pihole
sudo git clone https://github.com/pi-hole/pi-hole.git .
sudo git checkout release/v5.0

sudo ./automated\ install/basic-install.sh

It is a fresh install and no upgrade from V4.X.

What are the permissions on the files in that directory? sudo ls -lach /etc/dnsmasq.d

It looks like you have imported data from a previous installation, via teleporter? What was the previous version and does the problem happen with a fresh install and no importing of previous data?

Well, "these instructions" were explicitly labeled as being untested and experimental. I do not recall where I put them up, however, there should be enough posts like "does not really work" below...

drwxr-xr-x  2 root root 4,0K Feb 18 22:16 .
drwxr-xr-x 82 root root 4,0K Feb 18 22:06 ..
-rw-r--r--  1 root root 1,7K Feb 18 22:06 01-pihole.conf
-rw-r--r--  1 root root  668 Feb 18 22:06 02-pihole-dhcp.conf
-rw-r--r--  1 root root   53 Feb 18 22:16 04-pihole-static-dhcp.conf

Yes, but only the Black- and Whitelists.

There was no previous installation on this system. It was a fresh installation from scratch on Debian 10. Or do you mean the system from where I imported the data via teleporter? That was:

Pi-Hole Version v4.3.2
Web Interface: v4.3.2
FTL version: v4.3.1

Generally said the installation works. It's only the previously mentioned error I encountered when I try to convert a DHCP lease to static.

Does the same situation happen with a v4 install that is upgraded in-place to v5?

Hi, I have the same issue but with the current release:

  Pi-hole version is v4.3.2 (Latest: v4.3.2)
  AdminLTE version is v4.3.3 (Latest: v4.3.3)
  FTL version is v4.3.1 (Latest: v4.3.1)

Setup on a PI 4 Model B with Ubuntu 19.10
I get the same results as cwt (can't use@) for the troubleshooting
The savesettings.php has the correct entry

I'll have to try this. Could set up another VM with v4 and do an upgrade to v5.

Hello,

Pi-hole 5.0 here. Upgrade from 4.3.5 and I have the same issue. That was an in-place migration.

History:
Pi-hole 4.3.5 with DHCP disabled (enabled on the OPNsense)
Migration to Pi-hole 5.0
Enable DHCP (and disabled it on the OPNsense)
I tried to shift an active DHCP lease to a static lease and got the same issue:

There was a problem applying your settings.
Debugging information:
PHP error (2): fopen(/etc/dnsmasq.d/04-pihole-static-dhcp.conf): failed to open stream: No such file or directory in /var/www/html/admin/scripts/pi-hole/php/savesettings.php:84

After a refresh the targeted computer has been shifted to static leases.

Cheers :slight_smile:

Thanks for your report. This misbehavior (even if there was no negative effect on anything) will be corrected by:

The fix has been merged into the beta.