Project

General

Profile

Actions

Bug #11748

closed

Automated corruption recovery from cached ``config.xml`` backup files should check multiple backups

Added by Philippe Landsberg about 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Viktor Gurov
Category:
Backup / Restore
Target version:
Start date:
03/28/2021
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
21.05
Release Notes:
Default
Affected Version:
2.5.0
Affected Architecture:
amd64

Description

Apparently something went wrong during the saving in the environment of traffic shaping. The system was no longer accessible via the network. After a reset (power disconnect) the machine (pcengines / apu2) could only be accessed via the console in safe mode.
Autobackup was activated. The problem, the config.xml 0KB and the last backup hadm a file size of 0B. This leads to an unbootable system.
Older backup was available though. I assume that during a restore in the boot process the validity or on the file size (0B) is not checked.

In this case there should be a check to make sure that the backup file is valid and not corrupt.
Since older backups were available, this problem could definitely have been prevented.

The problem is the function /etc/inc/config.lib.inc:187 -> discover_last_backup() which looks for the last backup (timestamp) but does not check for a valid large, hash or xml validity.

The boot log is included in the attachment.


Files

pfsense_boot_log.txt (3.62 KB) pfsense_boot_log.txt Philippe Landsberg, 03/28/2021 11:16 AM
Actions #1

Updated by Jim Pingle about 3 years ago

  • Subject changed from Automatic restore of last backup config.xml failed during startup to Automatic restore of previous backup config.xml when detecting invalid configuration files should check multiple backups
  • Target version set to CE-Next

Updating subject.

tl;dr appears to be: config.xml corrupt/missing, and most recent historical backup is also corrupt. It should keep checking older configurations until it finds a valid one.

In the boot log it appeared to keep trying the same old config multiple times rather than looking back further.

Actions #3

Updated by Jim Pingle about 3 years ago

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

Updated by Jim Pingle almost 3 years ago

  • Plus Target Version set to 21.05
Actions #5

Updated by Anonymous almost 3 years ago

  • Status changed from Pull Request Review to Feedback
Actions #6

Updated by Viktor Gurov almost 3 years ago

  • % Done changed from 0 to 100
Actions #7

Updated by Jim Pingle almost 3 years ago

  • Subject changed from Automatic restore of previous backup config.xml when detecting invalid configuration files should check multiple backups to Automated corruption recovery from cached ``config.xml`` backup files should check multiple backups

Updating subject for release notes.

Actions #8

Updated by Jim Pingle almost 3 years ago

  • Target version changed from CE-Next to 2.5.2
Actions #9

Updated by Jim Pingle almost 3 years ago

  • Status changed from Feedback to Resolved
  • Assignee set to Viktor Gurov

On a fresh VM I made a few changes, booted to single user mode and truncated the last few configs to 0 bytes, and then rebooted again. It successfully went back and found the most recent viable backup and restored that.

Actions

Also available in: Atom PDF