Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Unable to download/backup configuration via WebGUI: Backup-file is 0KB (empty) when "backup extra data" is checked

    Scheduled Pinned Locked Moved General pfSense Questions
    3 Posts 2 Posters 105 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      TomTheOne
      last edited by TomTheOne

      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

      1 Reply Last reply Reply Quote 0
      • T Offline
        TomTheOne
        last edited by

        🧠 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
        1 Reply Last reply Reply Quote 1
        • stephenw10S Offline
          stephenw10 Netgate Administrator
          last edited by

          Yup, that's fixed in current versions.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.