Domain Overrides: 500 server error
-
I wanted to add a domain override for lab.example.com and point it to pfSense itself (example.com not being the real domain of course). There was already an existing override.
After doing that I get a 500 server error if I try to access
https://pfsense/services_unbound.php
and a php error.Crash report begins. Anonymous machine information: amd64 15.0-CURRENT FreeBSD 15.0-CURRENT #0 plus-devel-main-n256343-80c8c174e57: Tue Jul 2 06:34:20 UTC 2024 root@freebsd:/var/jenkins/workspace/pfSense-Plus-snapshots-master-main/obj/amd64/bbKuoBRr/var/jenkins/workspace/pfSense-Plus-snapshots-master-main/sources/FreeBS Crash report details: PHP Errors: [04-Jul-2024 17:25:51 Europe/Zurich] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/services_unbound.php:627 Stack trace: #0 {main} thrown in /usr/local/www/services_unbound.php on line 627 No FreeBSD crash data found.
Using
vsconfig
I had a look at the config and the syntax in the XML seems wrong:<domainoverrides>lab.example.com</domainoverrides> <domainoverrides>127.0.0.1</domainoverrides> <domainoverrides>Just an example override</domainoverrides> <domainoverrides></domainoverrides>
And the previous override was gone.
If I only edited the existing override, the issue didn't pop up.
Running pfSense+ 24.08-DEVELOPMENT 24.08.a.20240702.0600
-
@patient0 said in Domain Overrides: 500 server error:
I wanted to add a domain override for lab.example.com and point it to pfSense itself
and then go go for a pure "syntax error" :
@patient0 said in Domain Overrides: 500 server error:
https://pfsense/services_unbound.php
Try, as you said yourself : https://lab.example.com/services_unbound.php
look around on the Internet. Try finding a 'host name' that looks like 'pfsense', that is, just one word without at least one dot. I can tell you up front : that doesn't exists, and is an error.
If the web server used by the GUI has a certificat that says its "lab.example.com" then your see the (login) GUI page right away. If not, after an ugly browser warning that says the certificat says that your are NOT visiting "lab.example.com" but some other random name (the name in the pfSense GUI certificat !) then accept that warning for "ok", and you'll be good.
Btw : I just tried your https://pfsense.my-own-local-host-name.tld/services_unbound.php and I was presented the pfSense login screen.
After entering 'admin' and my password, I was presented the GUI dashboard, and not this "services_unbound.php" =page.
So getting redirected directly to page like that seems to be a no go for me. -
@Gertjan adding a domain override to your 24.08-DEV instance works for you?
-
Thank you for testing, this should fix it:
diff --git a/src/usr/local/www/services_unbound_domainoverride_edit.php b/src/usr/local/www/services_unbound_domainoverride_edit.php index 66bdadfa50..b24a5d4b3a 100644 --- a/src/usr/local/www/services_unbound_domainoverride_edit.php +++ b/src/usr/local/www/services_unbound_domainoverride_edit.php @@ -98,7 +98,7 @@ if ($_POST['save']) { if ($this_domainOverrides_config) { config_set_path("unbound/domainoverrides/{$id}", $doment); } else { - config_set_path('unbound/domainoverrides', $doment); + config_set_path('unbound/domainoverrides/', $doment); } mark_subsystem_dirty('unbound');
-
@patient0 said in Domain Overrides: 500 server error:
override to your 24.08-DEV
Oops. Didnt' saw you were using a dev version - and I'm even posting (answering) in the dev forum ...
Humm : great : real time issue and solution reporting is going on here
-
-
This post is deleted! -