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

    Restoring backup from 22.01 breaks 23.01 installation

    General pfSense Questions
    4
    5
    624
    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.
    • E
      EndlessDIY
      last edited by

      After a recent (accidental) attempt to upgrade my SG-3100 from 22.01 to 23.01, the new installation threw an error in the console and would not properly map any of my interfaces or do anything at all.

      thrown in /etc/inc/interfaces.inc on line 1563
      PHP ERROR: Type: 1, File: /etc/inc/interfaces.inc, Line: 1563, Message: Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/interfaces.inc:1563
      Stack trace:
      #0 /etc/inc/interfacesNetgate 3100 
      

      I opened the file and the second line of this snippet was line 1563:

      foreach (config_get_path('ipsec/phase1', []) as $ph1ent) {
      	if ($ph1ent['disabled']) {
      		continue;
      	}
      	if (interface_ipsec_vti_configure($ph1ent, $gateways_status) &&
      		!$bootmsg && platform_booting()) {
      		echo gettext("Configuring IPsec VTI interfaces...");
      		$bootmsg = true;
      	}
      }
      

      I tried commenting out the lines and this led to another rabbit hole of ipsec related errors in other files. So I flashed the system clean to 23.01 and tried again. Same issue. So I decided to try modifying my backup file to remove any references to ipsec (I don't use anything IPsec related) and see if that would work. I removed the following contents from my backup:

      pfsense -> system -> user (admin)

      <ipsecpsk></ipsecpsk>
      

      And removed the same empty line from 2 other users in the same section.

      pfsense

      <ipsec>
      	<phase1>i</phase1>
      	<logging>
      		<dmn>1</dmn>
      		<mgr>1</mgr>
      		<ike>1</ike>
      		<chd>1</chd>
      		<job>1</job>
      		<cfg>1</cfg>
      		<knl>1</knl>
      		<net>1</net>
      		<asn>1</asn>
      		<enc>1</enc>
      		<imc>1</imc>
      		<imv>1</imv>
      		<pts>1</pts>
      		<tls>1</tls>
      		<esp>1</esp>
      		<lib>1</lib>
      	</logging>
      	<vtimaps></vtimaps>
      </ipsec>
      

      These are the only lines I removed from the backup (3 empty ipsecpsk fields from users, and the ipsec top level object). I tried restoring the backup, and it worked perfectly, no issues at all.

      This seems to me like a bug, I'm not sure where. Possibly a bug in 23.01 not parsing these ipsec fields properly? Possibly a bug in the 22.01 backup code making a bad config file?

      S 1 Reply Last reply Reply Quote 0
      • S
        SteveITS Galactic Empire @EndlessDIY
        last edited by

        @endlessdiy I’ve seen a handful of errors about similar issues with empty config sections. Presumably all due to the move to PHP 8. You could create a report at Redmine.pfsense.org.

        There are also several patches in the System Patches package including at least one specifically for the 3100.

        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
        Upvote 👍 helpful posts!

        1 Reply Last reply Reply Quote 0
        • jimpJ jimp moved this topic from Problems Installing or Upgrading pfSense Software on
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          @endlessdiy said in Restoring backup from 22.01 breaks 23.01 installation:

          <phase1>i</phase1>

          That's the only one you probably had to remove. It's not a valid configuration entry. Not sure how it ended up there, but it's definitely broken.

          It's hard to account for every possible way someone could break their config over the years (either due to bugs we fixed long ago, manual edits, or who knows what).

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 2
          • E
            EndlessDIY
            last edited by

            Thanks all. It's good to know there's a general "patches" package I can add for small fixes, and good to know there's an obviously invalid line in the config. It's very likely a remnant of something from years ago.

            Is it worth filling a redmine bug for generic better config validation? It would have been much easier to debug if something said "invalid line in your config at line XX" instead of crashing with a generic PHP error where something made incorrect assumptions about the data it was trying to process.

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              If you're able to replicate it then a bug would be helpful. We would need to know what the config was in 22.01 in order to prevent it failing it upgrade.

              Steve

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