Project

General

Profile

Bug #8905

status_logs_settings.php PHP errors on 2.4.4 snapshots

Added by Jason Unovitch 9 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Logging
Target version:
Start date:
09/16/2018
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.4.4
Affected Architecture:
All

Description

Info:

Working on testing the latest snapshots and I'm unable to add remote syslog on 2.4.4 snapshot (pfSense-2.4.4.a.20180903.1144). I do not see this mentioned in an issue or any commits to the file just yet. Not a PHP guy so figured I'd report as first priority.

Steps to repro:

  1. Go to "Status" -> "System Logs"
  2. Go to "Settings"
    1. Set "Enable Remote Logging" checkbox
    2. Set a remote log server and contents
    3. Attempt to save.

Results:

Warning: Illegal string offset 'reverse' in /usr/local/www/status_logs_settings.php on line 109 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 109 Warning: Illegal string offset 'nentries' in /usr/local/www/status_logs_settings.php on line 110 Fatal error: Uncaught Error: Cannot unset string offsets in /usr/local/www/status_logs_settings.php:116 Stack trace: #0 {main} thrown in /usr/local/www/status_logs_settings.php on line 116 PHP ERROR: Type: 1, File: /usr/local/www/status_logs_settings.php, Line: 116, Message: Uncaught Error: Cannot unset string offsets in /usr/local/www/status_logs_settings.php:116 Stack trace: #0 {main} thrown

8905-status_logs_settings.php.diff (567 Bytes) 8905-status_logs_settings.php.diff Jim Pingle, 09/18/2018 08:57 AM

Associated revisions

Revision 508c66ac (diff)
Added by Jim Pingle 9 months ago

Init syslog settings before using the array. Fixes #8905

Revision 30a3c370 (diff)
Added by Jim Pingle 9 months ago

Init syslog settings before using the array. Fixes #8905

(cherry picked from commit 508c66ace779a6021b217d055b53587fdb021fec)

History

#1 Updated by Jim Pingle 9 months ago

  • Status changed from New to Feedback
  • Assignee set to Jim Pingle

I can't reproduce that here. I took a system that had never had syslog settings changed on it since the last factory reset and made the same change you describe and it saved without error. I also removed the syslog section from config.xml entirely and retried it, still did not receive an error. The system I tested on is running a snapshot from the same date you listed.

Does your config.xml have a <syslog>...</syslog> section? If so, what is in it?

#2 Updated by Jason Unovitch 9 months ago

Does your config.xml have a <syslog>...</syslog> section? If so, what is in it?

Hmm, this is rather strange. So it's just an empty XML tag.

                <ipv6nat></ipv6nat>
        </diag>
        <syslog></syslog>
        <nat>
                <outbound>

I can confirm what you observed. On a fresh install of the latest RC I don't see this.

I thought I had a repro case because I see this on two SG-4860s that have been updated through the 2.4 series. However I am actually seeing it here when I save anything on the status/system logs/settings page. If I attempt to save with a log size of "500000" for example I get a much longer PHP errors (show below).

I'm thinking this must be something local to my setup. Sorry for the mislead if that is the case. I am just not seeing what that could be tonight. Let me dig at this a bit more tomorrow.

Warning: Illegal string offset 'reverse' in /usr/local/www/status_logs_settings.php on line 109 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 109 Warning: Illegal string offset 'nentries' in /usr/local/www/status_logs_settings.php on line 110 Warning: Illegal string offset 'logfilesize' in /usr/local/www/status_logs_settings.php on line 113 Warning: Illegal string offset 'remoteserver' in /usr/local/www/status_logs_settings.php on line 118 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 118 Warning: Illegal string offset 'remoteserver2' in /usr/local/www/status_logs_settings.php on line 119 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 119 Warning: Illegal string offset 'remoteserver3' in /usr/local/www/status_logs_settings.php on line 120 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 120 Warning: Illegal string offset 'sourceip' in /usr/local/www/status_logs_settings.php on line 121 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 121 Warning: Illegal string offset 'ipproto' in /usr/local/www/status_logs_settings.php on line 122 Warning: Illegal string offset 'filter' in /usr/local/www/status_logs_settings.php on line 123 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 123 Warning: Illegal string offset 'dhcp' in /usr/local/www/status_logs_settings.php on line 124 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 124 Warning: Illegal string offset 'portalauth' in /usr/local/www/status_logs_settings.php on line 125 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 125 Warning: Illegal string offset 'vpn' in /usr/local/www/status_logs_settings.php on line 126 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 126 Warning: Illegal string offset 'dpinger' in /usr/local/www/status_logs_settings.php on line 127 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 127 Warning: Illegal string offset 'relayd' in /usr/local/www/status_logs_settings.php on line 128 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 128 Warning: Illegal string offset 'hostapd' in /usr/local/www/status_logs_settings.php on line 129 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 129 Warning: Illegal string offset 'logall' in /usr/local/www/status_logs_settings.php on line 130 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 130 Warning: Illegal string offset 'system' in /usr/local/www/status_logs_settings.php on line 131 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 131 Warning: Illegal string offset 'resolver' in /usr/local/www/status_logs_settings.php on line 132 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 132 Warning: Illegal string offset 'ppp' in /usr/local/www/status_logs_settings.php on line 133 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 133 Warning: Illegal string offset 'routing' in /usr/local/www/status_logs_settings.php on line 134 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 134 Warning: Illegal string offset 'ntpd' in /usr/local/www/status_logs_settings.php on line 135 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 135 Warning: Illegal string offset 'disablelocallogging' in /usr/local/www/status_logs_settings.php on line 136 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 136 Warning: Illegal string offset 'enable' in /usr/local/www/status_logs_settings.php on line 137 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 137 Warning: Illegal string offset 'nologdefaultblock' in /usr/local/www/status_logs_settings.php on line 143 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 143 Warning: Illegal string offset 'nologdefaultpass' in /usr/local/www/status_logs_settings.php on line 144 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 144 Warning: Illegal string offset 'nologbogons' in /usr/local/www/status_logs_settings.php on line 145 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 145 Warning: Illegal string offset 'nologprivatenets' in /usr/local/www/status_logs_settings.php on line 146 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 146 Warning: Illegal string offset 'nolognginx' in /usr/local/www/status_logs_settings.php on line 147 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 147 Warning: Illegal string offset 'rawfilter' in /usr/local/www/status_logs_settings.php on line 148 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 148 Warning: Illegal string offset 'igmpxverbose' in /usr/local/www/status_logs_settings.php on line 149 Warning: Cannot assign an empty string to a string offset in /usr/local/www/status_logs_settings.php on line 149 Fatal error: Uncaught Error: Cannot unset string offsets in /usr/local/www/status_logs_settings.php:154 Stack trace: #0 {main} thrown in /usr/local/www/status_logs_settings.php on line 154 PHP ERROR: Type: 1, File: /usr/local/www/status_logs_settings.php, Line: 154, Message: Uncaught Error: Cannot unset string offsets in /usr/local/www/status_logs_settings.php:154 Stack trace: #0 {main} thrown

#3 Updated by Jim Pingle 9 months ago

I still can't reproduce that here but can you try the attached patch? Apply it either by making the edit by hand or using the system patches package (set path strip = 2)

It's a simple one-line change but it should make sure the syslog section is initialized before it's used.

#4 Updated by Jim Pingle 9 months ago

  • Status changed from Feedback to In Progress
  • Target version changed from 2.4.4-GS to 2.4.4

...and as soon as I posted that, I managed to reproduce it with an empty syslog section here. The patch did fix it for me. Commit inbound.

#5 Updated by Jim Pingle 9 months ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100

#6 Updated by Anonymous 9 months ago

  • Status changed from Feedback to Resolved

Tested with an older version of 2.4.4 and was able to reproduce the error. Upgraded to 2.4.5 current and no longer see the errors. Looks good.
2.4.5-DEVELOPMENT (amd64)
built on Tue Sep 18 11:12:41 EDT 2018
FreeBSD 11.2-RELEASE-p3

#7 Updated by Jason Unovitch 9 months ago

Perfect. That one liner fixes the issue I saw.

Jim, thanks for the quick fix!

Steve, thanks for the QA check!

Also available in: Atom PDF