Project

General

Profile

Actions

Regression #13570

closed

pfSense - Feature #13446: Upgrade PHP from 7.4 to 8.1

openvpn-client-export php error in 2.7

Added by John Doe about 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
OpenVPN Client Export
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.01
Affected Version:
2.7.x
Affected Plus Version:
Affected Architecture:

Description

Greeting,

opening the Client Export Utility with pfSense 2.7 throws a php-Error:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/vpn_openvpn_export.php:456 Stack trace: #0 {main} thrown in /usr/local/www/vpn_openvpn_export.php on line 456 PHP ERROR: Type: 1, File: /usr/local/www/vpn_openvpn_export.php, Line: 456, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/vpn_openvpn_export.php:456 Stack trace: #0 {main} thrown

Actions #1

Updated by Jim Pingle about 2 years ago

  • Tracker changed from Bug to Regression
  • Project changed from pfSense to pfSense Packages
  • Category changed from OpenVPN to OpenVPN Client Export
  • Release Notes deleted (Default)
Actions #2

Updated by Christian McDonald about 2 years ago

  • Status changed from New to Feedback
  • Assignee set to Christian McDonald
  • Target version set to 2.7.0
  • Plus Target Version set to 23.01
Actions #3

Updated by John Doe about 2 years ago

Greetings,

fyi:

I just updated to the newest Version 2.7.0.a.20221018.0600 and got a different php Error:

Parse error: Unmatched '}' in /usr/local/www/vpn_openvpn_export.php on line 463

Actions #4

Updated by Christian McDonald about 2 years ago

Hi, thanks for the feedback. This should be resolved in the next build. I also saw another potentially problematic config access that was also likely to have issues under PHP8.1. I fixed that one as well.

Actions #5

Updated by John Doe about 2 years ago

Hi,

I just updated to the newest Version an it looks good. Client-Export seems to work now.

Shared Key Export still throws the following Error:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/vpn_openvpn_export_shared.php:200 Stack trace: #0 {main} thrown in /usr/local/www/vpn_openvpn_export_shared.php on line 200 PHP ERROR: Type: 1, File: /usr/local/www/vpn_openvpn_export_shared.php, Line: 200, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/vpn_openvpn_export_shared.php:200 Stack trace: #0 {main} thrown

But so far as i know shared-key is not supported any longer, so the feature could be considered decrepit.

Anyway good Job!

Actions #6

Updated by Jim Pingle about 2 years ago

Yes, the shared key parts are deprecated and should be removed. I made a separate issue for that: https://redmine.pfsense.org/issues/13576

Actions #7

Updated by Kris Phillips about 2 years ago

  • Status changed from Feedback to Resolved

OpenVPN Client Export throws no PHP errors now in my testing either. Closing as Resolved.

Actions #8

Updated by Marcos M about 2 years ago

  • Status changed from Resolved to New

There's still some access issues - visiting vpn_openvpn_export.php gives the following error on the latest version:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/vpn_openvpn_export.php:449 Stack trace: #0 {main} thrown in /usr/local/www/vpn_openvpn_export.php on line 449 PHP ERROR: Type: 1, File: /usr/local/www/vpn_openvpn_export.php, Line: 449, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/vpn_openvpn_export.php:449 Stack trace: #0 {main} thrown

Actions #9

Updated by Jim Pingle about 2 years ago

Marcos M wrote in #note-8:

There's still some access issues - visiting vpn_openvpn_export.php gives the following error on the latest version:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/vpn_openvpn_export.php:449 Stack trace: #0 {main} thrown in /usr/local/www/vpn_openvpn_export.php on line 449 PHP ERROR: Type: 1, File: /usr/local/www/vpn_openvpn_export.php, Line: 449, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/vpn_openvpn_export.php:449 Stack trace: #0 {main} thrown

I can't reproduce this. It's a different case than the original issue here. I'll need to see the contents of the OpenVPN package section of the config.xml on there (the part corresponding to $config['installedpackages']['vpn_openvpn_export']) or at least get more concrete information on how to reproduce it specifically. Feels like that should be a new/fresh issue though since it's unrelated except that it happens to be the same sort of error.

Actions #10

Updated by Jim Pingle about 2 years ago

  • Status changed from New to In Progress
  • Assignee changed from Christian McDonald to Jim Pingle

OK, with the supplied configuration from Marcos I could reproduce it and worked up a fix. Commit coming shortly.

Actions #11

Updated by Jim Pingle about 2 years ago

  • Status changed from In Progress to Feedback

Should be fixed in pkg v1.7_3 and v1.6_8

Actions #12

Updated by Marcos M about 2 years ago

  • Status changed from Feedback to Resolved

Tested and it's working - thanks! Marking resolved.

Actions #13

Updated by Jim Pingle about 2 years ago

  • Parent task set to #13446
Actions #14

Updated by Jim Pingle about 2 years ago

  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF