Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Domain Overrides: 500 server error

    Scheduled Pinned Locked Moved Plus 24.11 Development Snapshots (Retired)
    7 Posts 4 Posters 541 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • patient0P
      patient0
      last edited by

      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

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @patient0
        last edited by Gertjan

        @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" =

        093c8b9f-4f09-4538-afd2-eb46ab9ee89a-image.png

        page.
        So getting redirected directly to page like that seems to be a no go for me.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        patient0P 1 Reply Last reply Reply Quote 0
        • patient0P
          patient0 @Gertjan
          last edited by

          @Gertjan adding a domain override to your 24.08-DEV instance works for you?

          GertjanG 1 Reply Last reply Reply Quote 0
          • M
            marcosm Netgate
            last edited by

            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');
            
            
            patient0P 1 Reply Last reply Reply Quote 2
            • GertjanG
              Gertjan @patient0
              last edited by Gertjan

              @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 👍

              No "help me" PM's please. Use the forum, the community will thank you.
              Edit : and where are the logs ??

              1 Reply Last reply Reply Quote 1
              • patient0P
                patient0 @marcosm
                last edited by

                @marcosm Works excellent, a classic typo :) .. thanks again @marcosm.

                That was very fast, I think if I report the next issue, you'll have a fix before I report it :o)

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • patient0P patient0 referenced this topic on
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.