Project

General

Profile

Actions

Bug #11801

closed

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

Added by Jim Pingle almost 3 years ago. Updated almost 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

Also available in: Atom PDF