Project

General

Profile

Actions

Bug #6229

closed

pfblockerng: implode(): Invalid arguments passed in /usr/local/pkg/pfblockerng/pfblockerng.inc on line 4638

Added by Chris Buechler about 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
pfBlockerNG
Target version:
-
Start date:
04/21/2016
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

getting a number of crash reports with:

[14-Apr-2016 04:44:33 UTC] PHP Warning:  implode(): Invalid arguments passed in /usr/local/pkg/pfblockerng/pfblockerng.inc on line 4638
[14-Apr-2016 04:44:33 UTC] PHP Stack trace:
[14-Apr-2016 04:44:33 UTC] PHP   1. {main}() /etc/rc.start_packages:0
[14-Apr-2016 04:44:33 UTC] PHP   2. sync_package() /etc/rc.start_packages:66
[14-Apr-2016 04:44:33 UTC] PHP   3. eval() /etc/inc/pkg-utils.inc:597
[14-Apr-2016 04:44:33 UTC] PHP   4. sync_package_pfblockerng() /etc/inc/pkg-utils.inc(597) : eval()'d code:3
[14-Apr-2016 04:44:33 UTC] PHP   5. implode() /usr/local/pkg/pfblockerng/pfblockerng.inc:4638

Actions #1

Updated by BBcan177 . about 8 years ago

Are these crash reports from multiple IPs?

I had one user PM me with this issue (Full Install in a KVM VM w/o Ramdisks).

The pfBlockerNG "General Tab" uses pkg_edit.php, and when the user hits "Save", it creates all of the xml tags to < pfblockerng > in the config.xml... However, one xml tag "pfb_interval" is not saving for this particular user. I have not been able to duplicate this issue either... So when the code is run, the tag is non-existent and causes this error. I can default this variable to "1", but I still need to see why this tag is not being created.

I asked this user to try to change the "Hour" Cron setting in the General tab to "Every two hours" and see if the tag is created. This user is in Europe so I can't get feedback till tomorrow...

If anyone else is experiencing this issue, run this command and see if the tag exists:

grep "pfb_interval" /conf/config.xml

Note: These crash reports don't provide a lot of help, since the real error is actually on line 4679:

4673                 // Define CRON hour (CRON interval & start hour)
4674 if ($pfb['interval'] == 1) {
4675 $pfb_hour = '*';
4676 } elseif ($pfb['interval'] == 24) {
4677 $pfb_hour = $pfb['24hour'];
4678 } else {
4679 $pfb_hour = implode(',', pfb_cron_base_hour());
4680 }
Actions #2

Updated by Chris Buechler about 8 years ago

BBcan177 . wrote:

Are these crash reports from multiple IPs?

Yes, at least a dozen different systems, different IPs and timezones, from April alone. I don't have access to any of them so not sure what their configs are like.

Actions #3

Updated by BBcan177 . about 8 years ago

I can submit a Rush patch if that makes it less "Noisy" for you? :) But I still need to see why this tag is missing... I posted in the forum to see if I can drum up a live body...

Actions #4

Updated by Chris Buechler about 8 years ago

It's a trivially small portion of the total PHP warning crash reports, no need for a rush fix for purposes of reducing noise.

Actions #5

Updated by BBcan177 . almost 8 years ago

FYI, I have had no one else report this issue in the Forum or via PM... I can't reproduce this issue either... The one user I mentioned previously, updated to the latest version 2.0.11 and the issue went away, however, there were no changes to that part of the code.

Actions #6

Updated by Chris Buechler almost 8 years ago

  • Status changed from Confirmed to Resolved
Actions #7

Updated by Chris Buechler almost 8 years ago

  • Status changed from Resolved to Confirmed

I misread that as it having been fixed previously. Still being reported as an issue.
https://forum.pfsense.org/index.php?topic=111298.0;topicseen

Actions #8

Updated by Chris Buechler almost 8 years ago

  • Status changed from Confirmed to Feedback

Pushed a fix to make sure it's an array before it hits that line. BBcan might want to check that thread to find root issue.

Actions #9

Updated by BBcan177 . almost 8 years ago

I have posted a PR https://github.com/pfsense/FreeBSD-ports/pull/125 for this issue.

When $pfb['interval'] is not defined, default the variable to '1'.

This variable was introduced over a year ago, but if the user does not hit "save" in the pfBlockerNG General Tab, this variable does not get created.

In 2.2.x, the error was never noticed; however, in 2.3, the PHP errors are more verbose. So when a user upgrades from 2.2.x to 2.3.x, this variable, when not defined, will cause issues.

Actions #10

Updated by Chris Buechler almost 8 years ago

  • Status changed from Feedback to Resolved

merged, thanks BBcan.

Actions

Also available in: Atom PDF