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

    "Corrupt XML" kills 2.60

    Scheduled Pinned Locked Moved General pfSense Questions
    9 Posts 3 Posters 567 Views 3 Watching
    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.
    • T Offline
      TheWaterbug
      last edited by

      After running flawlessly for 5 months my 2.60 on Protectli FW4C started having problems last week. I couldn't log in, and when I tried to boot into the console, it never finished booting. It gets to here and stops:

      7399cd05-077e-4926-9dbc-c958ef67c9b5-02752051-FBB1-4193-A2E2-6B6D0EAD55F4_1_105_c.jpeg

      I figured the easiest way back was to just reinstall and restore a backup from March. I reinstalled just fine, but when I attempted to Restore my XML file from a browser, my browser window displayed:

      Fatal error: Uncaught Exception: XML error: SSHDATA at line 3634 cannot occur more than once in /etc/inc/xmlparse.inc:89 Stack trace: #0 [internal function]: startElement(Resource id #6, 'SSHDATA', Array) #1 /etc/inc/xmlparse.inc(188): xml_parse(Resource id #6, 'WGUXTMry6ps4TWr...', false) #2 /etc/inc/xmlparse.inc(149): parse_xml_config_raw('/conf/config.xm...', Array, 'false') #3 /etc/inc/config.lib.inc(134): parse_xml_config('/conf/config.xm...', Array) #4 /etc/inc/config.inc(144): parse_config() #5 /etc/inc/gwlb.inc(25): require_once('/etc/inc/config...') #6 /etc/inc/functions.inc(35): require_once('/etc/inc/gwlb.i...') #7 /etc/inc/notices.inc(26): require_once('/etc/inc/functi...') #8 /etc/inc/config.gui.inc(39): require_once('/etc/inc/notice...') #9 /etc/inc/auth.inc(33): require_once('/etc/inc/config...') #10 /etc/inc/authgui.inc(27): include_once('/etc/inc/auth.i...') #11 /usr/local/www/guiconfig.inc(60): require_once('/etc/inc/authgu...') #12 /usr/local/www/index.php(46): require_once('/usr/local/www/...') #13 {m in /etc/inc/xmlparse.inc on line 89 PHP ERROR: Type: 1, File: /etc/inc/xmlparse.inc, Line: 89, Message: Uncaught Exception: XML error: SSHDATA at line 3634 cannot occur more than once in /etc/inc/xmlparse.inc:89 Stack trace: #0 [internal function]: startElement(Resource id #6, 'SSHDATA', Array) #1 /etc/inc/xmlparse.inc(188): xml_parse(Resource id #6, 'WGUXTMry6ps4TWr...', false) #2 /etc/inc/xmlparse.inc(149): parse_xml_config_raw('/conf/config.xm...', Array, 'false') #3 /etc/inc/config.lib.inc(134): parse_xml_config('/conf/config.xm...', Array) #4 /etc/inc/config.inc(144): parse_config() #5 /etc/inc/gwlb.inc(25): require_once('/etc/inc/config...') #6 /etc/inc/functions.inc(35): require_once('/etc/inc/gwlb.i...') #7 /etc/inc/notices.inc(26): require_once('/etc/inc/functi...') #8 /etc/inc/config.gui.inc(39): require_once('/etc/inc/notice...') #9 /etc/inc/auth.inc(33): require_once('/etc/inc/config...') #10 /etc/inc/authgui.inc(27): include_once('/etc/inc/auth.i...') #11 /usr/local/www/guiconfig.inc(60): require_once('/etc/inc/authgu...') #12 /usr/local/www/index.php(46): require_once('/usr/local/www/...') #13 {m
      

      Attempting to reload the webGUI or go Back in the browser resulted in similar messages.

      I rebooted the FW4C, and pfsense never finishes booting, with the console displaying messages like:

      afc8324d-63e6-4003-a473-7301104bb4f8-CADBB525-A0D6-41D0-84CA-0B23FC168EEC_1_105_c.jpeg /Users/steven/Pictures/Photos Library.photoslibrary/resources/derivatives/C/CADBB525-A0D6-41D0-84CA-0B23FC168EEC_1_105_c.jpeg

      Somewhere in that string of error text I saw the words "corrupt" and "XML".

      At this point, the box is dead. Entering 4 or 5 and then Enter results in another string of errors like the photo above.

      Rebooting ends up with a similar display, and I never even get to the text menu shown above.

      I reinstalled a few times, and every time I try to restore the March backup, I get the same result.

      I eventually rolled all the way back to a December backup, so my office is up and running, but I'm going to have to repeat a ton of work that I did between December and March.

      Is there any easy way to validate an XML backup before restoring it to pfsense?

      T 1 Reply Last reply Reply Quote 0
      • T Offline
        TheWaterbug @TheWaterbug
        last edited by

        @thewaterbug

        After getting the December config up and running I attempted to restore only some sections of the March config, such as the Firewall Rules, and the browser displayed this text instead of the GUI:

        Fatal error: Uncaught Exception: XML error: SSHDATA at line 3634 cannot occur more than once in /etc/inc/xmlparse.inc:89 Stack trace: #0 [internal function]: startElement(Resource id #6, 'SSHDATA', Array) #1 /etc/inc/xmlparse.inc(188): xml_parse(Resource id #6, 'WGUXTMry6ps4TWr...', false) #2 /etc/inc/xmlparse.inc(149): parse_xml_config_raw('/conf/config.xm...', Array, 'false') #3 /etc/inc/config.lib.inc(134): parse_xml_config('/conf/config.xm...', Array) #4 /etc/inc/config.inc(144): parse_config() #5 /etc/inc/gwlb.inc(25): require_once('/etc/inc/config...') #6 /etc/inc/functions.inc(35): require_once('/etc/inc/gwlb.i...') #7 /etc/inc/notices.inc(26): require_once('/etc/inc/functi...') #8 /etc/inc/config.gui.inc(39): require_once('/etc/inc/notice...') #9 /etc/inc/auth.inc(33): require_once('/etc/inc/config...') #10 /etc/inc/authgui.inc(27): include_once('/etc/inc/auth.i...') #11 /usr/local/www/guiconfig.inc(60): require_once('/etc/inc/authgu...') #12 /usr/local/www/index.php(46): require_once('/usr/local/www/...') #13 {m in /etc/inc/xmlparse.inc on line 89 PHP ERROR: Type: 1, File: /etc/inc/xmlparse.inc, Line: 89, Message: Uncaught Exception: XML error: SSHDATA at line 3634 cannot occur more than once in /etc/inc/xmlparse.inc:89 Stack trace: #0 [internal function]: startElement(Resource id #6, 'SSHDATA', Array) #1 /etc/inc/xmlparse.inc(188): xml_parse(Resource id #6, 'WGUXTMry6ps4TWr...', false) #2 /etc/inc/xmlparse.inc(149): parse_xml_config_raw('/conf/config.xm...', Array, 'false') #3 /etc/inc/config.lib.inc(134): parse_xml_config('/conf/config.xm...', Array) #4 /etc/inc/config.inc(144): parse_config() #5 /etc/inc/gwlb.inc(25): require_once('/etc/inc/config...') #6 /etc/inc/functions.inc(35): require_once('/etc/inc/gwlb.i...') #7 /etc/inc/notices.inc(26): require_once('/etc/inc/functi...') #8 /etc/inc/config.gui.inc(39): require_once('/etc/inc/notice...') #9 /etc/inc/auth.inc(33): require_once('/etc/inc/config...') #10 /etc/inc/authgui.inc(27): include_once('/etc/inc/auth.i...') #11 /usr/local/www/guiconfig.inc(60): require_once('/etc/inc/authgu...') #12 /usr/local/www/index.php(46): require_once('/usr/local/www/...') #13 {m
        

        This one wasn't fatal, and the box is still running, but I did get this same notification in the pfsense Notices area until I cleared it.

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

          That's a known issue: https://redmine.pfsense.org/issues/13132

          You should be able to removed the spurious tags manually before restoring.

          Steve

          T 2 Replies Last reply Reply Quote 1
          • T Offline
            TheWaterbug @stephenw10
            last edited by

            @stephenw10

            Thanks! At least I know I'm not crazy.

            I can edit the XML file, but how do I know which <sshdata> section is the correct one to keep and which to delete?

            One starts with:

            	<sshdata>
            		<sshkeyfile>
            			<filename>ssh_host_rsa_key</filename>
            			<xmldata>ldfHjqxIF. . . .
            

            and also contains:

            <filename>ssh_host_rsa_key.pub</filename>. . . .
            <filename>ssh_host_ed25519_key</filename>. . . . 
            <filename>ssh_host_ed25519_key.pub</filename> . . . .
            

            and the other with:

            	<sshdata>
            		<sshkeyfile>
            			<filename>ssh_host_rsa_key</filename>
            			<xmldata>ldfHrqw6. . . .
            

            and also contains:

            <filename>ssh_host_rsa_key.pub</filename>. . . .
            <filename>ssh_host_ed25519_key</filename>. . . . 
            <filename>ssh_host_ed25519_key.pub</filename> . . . .
            

            So both sections contain the same key/pub pairs, but with different data.

            How can I tell which set is currently in use?

            Thanks!

            1 Reply Last reply Reply Quote 0
            • T Offline
              TheWaterbug @stephenw10
              last edited by

              @stephenw10

              Also, if you know, does the bug trigger if a second <sshdata> section exists in the XML file, even if pfsense has been commanded to import only a small section of the XML file, e.g. the Firewall Rules, that doesn't include the <sshdata> tag?

              My results from last night suggest the answer is yes, but I thought I'd verify!

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

                Yes, it still tries to parse the full file and fails because have two sshdata sections is invalid.

                You could probably decode the data using base64 and compare it to what you expect. I would probably just remove both sections so the rest of the config is valid. It will generate a new ssh key.

                Steve

                T 1 Reply Last reply Reply Quote 0
                • T Offline
                  TheWaterbug @stephenw10
                  last edited by

                  @stephenw10

                  . . . or I could compare it to the December backup that imports successfully. 🤦 🤣

                  I'll try importing the edited version over the weekend.

                  1 Reply Last reply Reply Quote 1
                  • S Offline
                    Stewart
                    last edited by

                    How prevelant is this problem? I see a resolution is slated for 2.7.0 but how can the rest of us know if our devices on 2.6.0 will have the same problem when we go to restore our backups? Is there a specific package or something that causes this or a way to avoid it?

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

                      You can search the config for sshdata tags.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.