Project

General

Profile

Actions

Bug #11098

closed

Backup Files and Directories plugin crashes firewall if /root specified as backup location

Added by Privacy Please over 3 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Viktor Gurov
Category:
Backup
Target version:
-
Start date:
11/24/2020
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:
All

Description

The Backup Files and Directories plugin crashes firewall if /root specified as backup location. The plugin creates its backup at /root/backup and does not exclude the backup directory. This creates a recursive tar which fills all available storage and crashes pfSense.

Additional info at:
[[https://forum.netgate.com/topic/158572/who-maintains-this-package-how-do-i-file-a-bug-report?lang=en-GB]]


Files

backup.php (7.33 KB) backup.php Untested Potential Fix (Line 57 added --exclude) Privacy Please, 11/24/2020 01:33 PM
Screenshot from 2020-11-25 12-05-49.png (35.3 KB) Screenshot from 2020-11-25 12-05-49.png Steve Wheeler, 11/25/2020 06:31 AM
Actions #1

Updated by Jim Pingle over 3 years ago

  • Project changed from pfSense to pfSense Packages
  • Category changed from Backup / Restore to Backup
Actions #3

Updated by Steve Wheeler over 3 years ago

I can't replicate this by simply attempting to backup /root.

The backup file is not included in the .tgz.

Testing Backup package version 0.5_3 in 2.4.5p1.

Actions #4

Updated by Marcos M over 3 years ago

I was not able to reproduce the issue either:

path: /root/backup
dir contents: empty
result: archive with empty /root/backup dir

path: /root/backup
dir contents: pfsense.bak.tgz
result: archive with empty /root/backup dir

path: /root
dir contents: default files; empty backup dir
result: archive with default files and empty backup dir

When I tested "path: /", it the failed because it ran out of space (but this is not indicative of a recursive failure).

Actions #5

Updated by Renato Botelho over 3 years ago

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

PR has been merged. Thanks!

Actions #6

Updated by Jordan G over 3 years ago

Attempted creating backup for '/' on XG-7100 on ZFS

received following
PHP ERROR: Type: 1, File: /usr/local/www/packages/backup/backup.php, Line: 77, Message: Allowed memory size of 536870912 bytes exhausted (tried to allocate 552079360 bytes) @ 2021-01-09 21:35:18

Actions #7

Updated by Kris Phillips over 2 years ago

Attempting a backup produces a crash, but doesn't freeze the entire firewall or fill the drive thankfully. It also spiked RAM usage by 50% due to PHP usage. Seems there is more work to be done here.

Crash report begins. Anonymous machine information:

amd64
12.3-PRERELEASE
FreeBSD 12.3-PRERELEASE plus-devel-12-n202608-e4bc455a39a pfSense

Crash report details:

PHP Errors:
[31-Oct-2021 00:01:06 Etc/UTC] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 498034928 bytes) in Unknown on line 0

No FreeBSD crash data found.

Actions #9

Updated by Jim Pingle over 2 years ago

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

Updated by Viktor Gurov over 2 years ago

  • Status changed from Pull Request Review to Feedback

Merged

Actions #11

Updated by Jordan G almost 2 years ago

attempted creation of backup for "/" - after creating the entry and using the backup button, I'm eventually given 504 gateway timeout but it appears the file was actually created in /root/backup
eventually was given an error on the dashboard - PHP ERROR: Type: 1, File: /usr/local/www/packages/backup/backup.php, Line: 77, Message: Allowed memory size of 536870912 bytes exhausted (tried to allocate 875831296 bytes) @ 2022-07-02 17:13:19

Actions #12

Updated by Kris Phillips almost 2 years ago

Jordan Greene wrote in #note-11:

attempted creation of backup for "/" - after creating the entry and using the backup button, I'm eventually given 504 gateway timeout but it appears the file was actually created in /root/backup
eventually was given an error on the dashboard - PHP ERROR: Type: 1, File: /usr/local/www/packages/backup/backup.php, Line: 77, Message: Allowed memory size of 536870912 bytes exhausted (tried to allocate 875831296 bytes) @ 2022-07-02 17:13:19

Jordan,

I think the issue is that you're trying to back up / and not /root/, which is what the original bug report was for. Backing up the actual root directory would be huge and I would expect it to bomb out due to PHP cache limitations.

Actions #13

Updated by Jordan G almost 2 years ago

my apologies, I did misunderstand the initial report

in case of specifying "/root/" as path, the backup button produces the proper pfsense.bak.tgz archive with the contents of /root/ directory

Actions #14

Updated by Marcos M almost 2 years ago

  • Status changed from Feedback to Resolved

I'll close this given that the original issue (crash) no longer happens. There's still the issue of the package locking the GUI to the backup process instead of delegating it to a background task like nmap, though that would be a separate issue report.

Actions

Also available in: Atom PDF