Config restore fail - Exception in XML



  • The drive in my pfSense box so I am trying to restore it. No matter what way I install pfSense, UFS/ZFS, BIOS/UEFI, when I finally get into the web interface and restore the config.xml I get this error:

    Fatal error: Uncaught exception 'Exception' with message 'XML error: RRDDATA at line 2567 cannot occur more than once ' in /etc/inc/xmlparse.inc:87 Stack trace: #0 [internal function]: startElement(Resource id #21, 'RRDDATA', Array) #1 /etc/inc/xmlparse.inc(186): xml_parse(Resource id #21, 'G3GOXA80MwAHFNs…', 0) #2 /etc/inc/xmlparse.inc(147): parse_xml_config_raw('/conf/config.xm...', Array, 'false') #3 /etc/inc/config.lib.inc(132): parse_xml_config('/conf/config.xm...', Array) #4 /usr/local/www/diag_backup.php(297): parse_config(true) #5 {main} thrown in /etc/inc/xmlparse.inc on line 87 PHP ERROR: Type: 1, File: /etc/inc/xmlparse.inc, Line: 87, Message: Uncaught exception 'Exception' with message 'XML error: RRDDATA at line 2567 cannot occur more than once ' in /etc/inc/xmlparse.inc:87 Stack trace: #0 [internal function]: startElement(Resource id #21, 'RRDDATA', Array) #1 /etc/inc/xmlparse.inc(186): xml_parse(Resource id #21, 'G3GOXA80MwAHFNs…', 0) #2 /etc/inc/xmlparse.inc(147): parse_xml_config_raw('/conf/config.xm...', Array, 'false') #3 /etc/inc/config.lib.inc(132): parse_xml_config('/conf/config.xm...', Array) #4 /usr/local/www/diag_backup.php(297): parse_config(true) #5 {main} thrown

    This is the exact same XML I used a couple months ago on the SAME hardware and version (2.4.2) to restore pfSense (different reason). As soon as I hit the error above, the pfSense is completely FUBAR. I cannot get into the web UI and none of the options at the console work. It has to be reinstalled to try anything else.

    Please help and thanks in advance.



  • Have you tried just restoring the areas that are the most work to redo. Just work around the RRDDATA section of your restore file. Instead of selecting restore all, use the drop menu to restore the areas one at a time.
    Your file at line 2567 seems to be bricking the complete restore. I never backup the RRDDATA so what it may look like in an editor is unknown to me. Not sure how to repair file.
    Note that I have usually many backups but not sure how it will work out this way. All your settings are readable in the file but it may take some time to get used to the file layout to understand.



  • I have not tried that. Like I said, this backup worked a couple months ago and I would like to keep the RRD part if at all possible. The RRD data part of the XML is just one long blob, so I can’t tell if anything looks wrong with it. The result is the same with a slightly more recent backup, but I have to double check that it’s the same line number.



  • ;D yeah one long blob, Well maybe one of the other guys can chime in but my experience in blob repair really sucks. :o



  • Is there more than one RRDDATA section in your config backup?  The first part of the error message seems to indicate there is:

    
    Fatal error: Uncaught exception 'Exception' with message 'XML error: RRDDATA at line 2567 cannot occur more than once ...
    
    

    I realize this doesn't address your current issue, but I backup my configuration without the RRD data.  I then backup only the RRD data in a separate file.  I've used this in the past to restore both the config and the separate RRD section.



  • There is more than one section, but they appear to contain (mostly) different data. I tried to restore one part of the config (system) but got the same result. pfSense gets messed up just reading the file. I did take a closer look at the XML though.

    G3GOXA80MwAHFNs
    

    This part does appear in a node called opt2-packets.rrd. That node does occur twice and the data appears to be exactly the same. I think other nodes occur twice as well with different data, but I don't know if that is correct or not. Also, I don't recall having an opt2, but maybe I did very briefly. I have restored older versions of pfSense on hardware with different interfaces, so I don't think just the interface being missing now is the problem.

    At this point I am going to try to remove the offending parts of the XML and test more restores in VirtualBox. I really want to get the RRD data back, I find it very helpful in troubleshooting, and I need so many of the other parts of the backup that it's all or nothing anyway.


  • Banned

    Could be the cause of duplicated RRD Data: https://redmine.pfsense.org/issues/7634



  • I finally got the backup to work after editing it and some trial and error.

    At first, I thought removing the problem parts of the RRD data referring to opt2 would be enough, but the error would just move to a different line. I then noticed that the second rrddata node had two nodes for opt2 while the first only had one. I deleted the entire first rrddata section and was able to restore the config.

    However, after reboot, the web UI and console got messed up again for a different reason: During restore, pfsense reinstalls the packages, but it doesn't seem to install the right ones. At first I thought it was partially due to pfsense not being up to date. At the time, the current version was 2.4.2-1, but the version downloaded from the site was 2.4.2. Updating to the latest version first didn't make a difference, however. I had to reinstall the packages manually, but that wasn't a big deal because their configuration was restored.

    Thanks again to everyone for the help.


Log in to reply