Project

General

Profile

Actions

Bug #13132

open

Two SSHDATA Sections in Restored Config Breaks Unit

Added by Viktor Gurov 3 months ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Backup / Restore
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
22.11
Release Notes:
Default
Affected Version:
2.7.0
Affected Architecture:

Description

https://forum.netgate.com/topic/171966/not-posible-to-restore-backups:

I just tried to restore a backup from two days ago .......... which did work !

There must be errors in the way the backup is created and/or the backup restore software.

Below the errors I get

Louis
PS I had to restore for an older backup file (loosing changes of cause)

Fatal error: Uncaught Exception: XML error: SSHDATA at line 17301 cannot occur more than once in /etc/inc/xmlparse.inc:89 Stack trace: #0 [internal function]: startElement(Resource id #20, 'SSHDATA', Array) #1 /etc/inc/xmlparse.inc(188): xml_parse(Resource id #20, 'AjiJwzfL2fT7Oz1...', 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 /usr/local/pfSense/include/www/backup.inc(309): parse_config(true) #5 /usr/local/www/diag_backup.php(63): execPost(Array, Array) #6 {main} thrown 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 17301 cannot occur more than once in /etc/inc/xmlparse.inc:89 Stack trace: #0 [internal function]: startElement(Resource id #20, 'SSHDATA', Array) #1 /etc/inc/xmlparse.inc(188): xml_parse(Resource id #20, 'AjiJwzfL2fT7Oz1...', 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 /usr/local/pfSense/include/www/backup.inc(309): parse_config(true) #5 /usr/local/www/diag_backup.php(63): execPost(Array, Array) #6 {main} thrown

similar to #8994

Actions #2

Updated by Jim Pingle 3 months ago

  • Status changed from New to Pull Request Review
Actions #3

Updated by Viktor Gurov 3 months ago

  • Status changed from Pull Request Review to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Danilo Zrenjanin 3 months ago

Tested the patch against:

2.7.0-DEVELOPMENT (amd64)
built on Tue May 10 14:23:11 UTC 2022
FreeBSD 12.3-STABLE

I added an empty <sshdata></sshdata> in the running-config. When I took a backup, both the empty and the newly generated one existed in the backup config file, which broke the restoration process.

Please check.

Actions #5

Updated by Danilo Zrenjanin 3 months ago

  • Status changed from Feedback to Resolved

I was getting the error only when manually added sshdata tags in the following order:

<sshdata>
</sshdata>

The fix works fine since it should never be formatted that way in pfSense.

I am marking this ticket resolved.

Actions #6

Updated by Jim Pingle about 2 months ago

  • Status changed from Resolved to New
  • Assignee changed from Viktor Gurov to Jim Pingle
  • % Done changed from 100 to 0
  • Plus Target Version changed from 22.05 to 22.11
  • Release Notes changed from Force Exclusion to Default

There is still some issue here as users are hitting this on 22.05 when restoring backups with two sections.

Actions

Also available in: Atom PDF