Project

General

Profile

Actions

Bug #11801

closed

PHP error in ``upgrade_212_to_213()`` when upgrading certain IPsec tunnels

Added by Jim Pingle over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Configuration Upgrade
Target version:
Start date:
04/12/2021
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
21.05
Release Notes:
Default
Affected Version:
2.5.x
Affected Architecture:
All

Description

Certain IPsec tunnel configurations fail to upgrade cleanly with the following error:

Fatal error: Uncaught Error: Cannot unset string offsets in /etc/inc/upgrade_config.inc:6437
Stack trace:
#0 /etc/inc/config.lib.inc(482): upgrade_212_to_213()
#1 /etc/rc.bootup(132): convert_config()
#2 {main}
  thrown in /etc/inc/upgrade_config.inc on line 6437
PHP ERROR: Type: 1, File: /etc/inc/upgrade_config.inc, Line: 6437, Message: Uncaught Error: Cannot unset string offsets in /etc/inc/upgrade_config.inc:6437
Stack trace:
#0 /etc/inc/config.lib.inc(482): upgrade_212_to_213()
#1 /etc/rc.bootup(132): convert_config()
#2 {main}
  thrown

Appears to be this line:

unset($ph1ent['reauth_enable'], $ph1ent['rekey_enable'], $ph1ent['margintime'], $ph1ent['over_time']);

Separating the test and checking for existence first does not produce an error:

        if (isset($ph1ent['reauth_enable'])) {
            unset($ph1ent['reauth_enable']);
        }
        if (isset($ph1ent['rekey_enable'])) {
            unset($ph1ent['rekey_enable']);
        }
        if (isset($ph1ent['margintime'])) {
            unset($ph1ent['margintime']);
        }
        if (isset($ph1ent['over_time'])) {
            unset($ph1ent['over_time']);
        }

Forum thread: https://forum.netgate.com/topic/162843/upgrade-from-2-4-5-to-21-01-fatal-error-in-upgrade_config

Actions #1

Updated by Jim Pingle over 3 years ago

  • Target version changed from CE-Next to 2.6.0
Actions #2

Updated by Jim Pingle over 3 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #3

Updated by Jim Pingle over 3 years ago

  • Plus Target Version set to 21.05
Actions #4

Updated by Jim Pingle over 3 years ago

Already in 21.05 branch.

Actions #5

Updated by Jim Pingle over 3 years ago

  • Subject changed from PHP error in upgrade_212_to_213() when upgrading certain IPsec tunnels to PHP error in ``upgrade_212_to_213()`` when upgrading certain IPsec tunnels

Updating subject for release notes.

Actions #6

Updated by Jim Pingle over 3 years ago

  • Status changed from Feedback to Closed

Should be fine now, if anyone else has a problem, can reopen.

Actions #7

Updated by Jim Pingle over 3 years ago

  • Target version changed from 2.6.0 to 2.5.2
Actions

Also available in: Atom PDF