Unable to download/backup configuration via WebGUI: Backup-file is 0KB (empty) when "backup extra data" is checked
-
Hi all,
I have a strange behaviour with my pfSenses CE. I have a 2 HA nodes and downloading the configuration on both boxes is resulting in a empty file xml (0kb). The backup is only empty when the checkbox "Include extra data: Backup extra data." is checked.
It is possible that the issue is present since the upgrade to 2.8.0; I'm not sure, maybe the issue is not linked to 2.8.0 as I have other 2.8.0 CEs without this issue (but the other boxes are no HA's).
The backup without extra data but with RRD data is around 12MB; the backup size of the box not having the issue is around 4MB.
Very strange. Any ideas how to troubleshoot this or if this is a already known issue?
Best regards
Tom -
🧠 Key Findings
Confirmed Bug in pfSense 24.03
A Netgate forum post describes a scenario where:Including large files (e.g. via Captive Portal or "extra data") causes the backup process to fail silently.
The issue is due to a PHP preg_replace() limit being exceeded when processing large XML strings.
The result is a 0-byte or empty config file.️ Workaround
Bugreport here
Increasing the PHP pcre.backtrack_limit (e.g. via ini_set('pcre.backtrack_limit', 5000000);) before the preg_replace() call resolves the issue, but this requires modifying pfSense internals—not recommended for most users.I had to add
ini_set('pcre.backtrack_limit', 5000000);
to file
/usr/local/pfSense/include/www/backup.inc
line 27 (right after the comment secion).
Now I can download all "extra data" again; the change solves the issue immediately.
The "Include Extra Data" option adds volatile data like:
- list itemCaptive Portal databases
- list itemDHCP lease databases
-
Yup, that's fixed in current versions.