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

    Cannot add a zone in brand new setup (2.2.1)

    Scheduled Pinned Locked Moved Captive Portal
    7 Posts 3 Posters 1.3k 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.
    • P Offline
      peterlinuxgeek
      last edited by

      Tried to add a zone in captive portal and see this in the Logs…

      Mar 22 17:03:29 php-fpm[25111]: /services_captiveportal_zones_edit.php: XML error: XML_ERR_NAME_REQUIRED at line 515 in /conf/config.xml
      Mar 22 17:03:29 php-fpm[25111]: /services_captiveportal_zones_edit.php: pfSense is restoring the configuration /cf/conf/backup/config-1427064860.xml

      Filled out both fields… Am I missing something obvious?

      Brand new install, just assigned some NICs, enabled DHCP, declared some aliases... nothing else.

      Thx

      Peter

      1 Reply Last reply Reply Quote 0
      • D Offline
        doktornotor Banned
        last edited by

        Sounds like you forgot to configure zone name? Though I don't see how you managed that, seems impossible to skip.

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

          http://pfsense/services_captiveportal_zones_edit.php - I can not get past the first form without entering a zone name (descriptions seems/is optional).
          What are you using as a zone name ? Some 'illegal' (XML) characters ?

          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 0
          • P Offline
            peterlinuxgeek
            last edited by

            Name is a mandatory field… if you leave it blank you get

            The following input errors were detected:

            The field Zone name is required.

            when you click on continue...

            So I filled it out (as I did with the description field)... BUT you got me thinking...

            I originally used a name starting with a number 3PartyZone... so I tried CPzone and guess what... problem solved.

            After 2 more tests it is obvious that the name of a CP zone cannot start with a number.
            I am not a XML specialist at all, but would find it very odd that you cannot start a name with a number.

            Not sure if this a minor bug or a a (un)documented feature ...
            The help line under the field says Zone name. Can only contain letters, digits, and underscores (_).
            Would be nice if it stated "and has to begin with a letter."

            Thx to get my brain going

            Peter

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

              @peterlinuxgeek:

              I originally used a name starting with a number 3PartyZone… so I tried CPzone and guess what... problem solved.

              After 2 more tests it is obvious that the name of a CP zone cannot start with a number.

              I confirm.

              I created a new captive portal zone, named "3Zone".
              This was the result (see image).

              pfSense doesn't like captive portal zone names that start with a number …...
              This might be a feature or a bug .... I don't know, but I can't see why this should be a XML limitation.

              edit: this is the zone-name limitation: /usr/local/www/services_captiveportal_zones_edit.php - line 65
              Is says :

              	if (preg_match('/[^A-Za-z0-9_]/', $_POST['zone'])) {
              		$input_errors[] = gettext("The zone name can only contain letters, digits, and underscores (_).");
              

              It might be a good idea to force the first character to a letter - non a number, by modifying the preg_match as follows :
              '/[^A-Za-z][A-Za-z0-9_]/'

              Capture-231.PNG
              Capture-231.PNG_thumb

              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 0
              • D Offline
                doktornotor Banned
                last edited by

                Someone file a bug, needs input validation in the GUI.

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

                  Yep, it looks like current validation isn't strong enough :  http://www.w3.org/TR/xml11/#sec-common-syn 
                  The first char (also called NameStartChar ) has limitations :

                  ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]

                  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 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.