Broken Snort dashboard widget after system upgrade to 2.3.3_1
-
I'm fairly new to pfSense. Can anyone tell me how to clear a dashboard widget when I can't access the dashboard? I've been using Snort for about a year. After updating pfSense to 2.3.3_1, the Snort widget appears to be causing a PHP error that causes the dashboard to fail to render. I just get a white page with this error message:
Fatal error: Cannot redeclare widget_snort_uninstall() (previously declared in /usr/local/www/widgets/include/widget-snort.inc:29) in /usr/local/www/widgets/include/.widget-snort.inc.uIzi3Hvkv9Po on line 29 Call Stack: 0.0002 228336 1\. {main}() /usr/local/www/index.php:0 PHP ERROR: Type: 1, File: /usr/local/www/widgets/include/.widget-snort.inc.uIzi3Hvkv9Po, Line: 29, Message: Cannot redeclare widget_snort_uninstall() (previously declared in /usr/local/www/widgets/include/widget-snort.inc:29)
I'm guessing that some configuration was corrupted when I upgraded. If I uninstall Snort then all is well, but as soon as I install the package, the dashboard stops working. Is there a way to clear out the settings for this widget, and (hopefully) get Snort working without killing my dashboard? Any advice would be greatly appreciated. Thanks!
-
Interesting. If I open widget-snort.inc and comment out this function:
function widget_snort_uninstall() { global $config; /* Remove the Snort widget from the Dashboard display list */ $widgets = $config['widgets']['sequence']; if (!empty($widgets)) { $widgetlist = explode(",", $widgets); foreach ($widgetlist as $key => $widget) { if (strstr($widget, "snort_alerts")) unset($widgetlist[$key]); } $config['widgets']['sequence'] = implode(",", $widgetlist); write_config(); } }
Then the dashboard is displayed correctly. It looks like there's a name collision in the PHP code, as I have another .inc file i this folder called ".widget-snort.inc.uIzi3Hvkv9Po" that appears to be identical. I suspect that this is a temp file that wasn't deleted after the update. Can anyone confirm? Can I just delete this file?
-
Remove and reinstall the package.
-
Remove and reinstall the package.
I should have mentioned that I've done this 5 or 6 times. After the uninstall the dashboard was fine, but I got the same error as soon as I reinstalled it.
It looks like I ended up resolving my own issue. I moved the file, ".widget-snort.inc.uIzi3Hvkv9Po" out of the widgets/include folder, and everything went back to normal. It looks like it was probably a temp file created during my system upgrade, and for some reason it wasn't deleted after the upgrade finished. It was causing the PHP function, "widget_snort_uninstall()" to be declared twice, which caused the dashboard code to fail to compile. Uninstalling and reinstalling the package didn't help, as the uninstall still left the widget temp file behind in the folder and caused the issue to reemerge after re-installation. I held on to the file just in case, but its contents are identical to those of "widget-snort.inc," so I'm sure I don't need it.
Anyway, if you ever get a "previously declared…" error on the dashboard page with regard to a widget, check your /usr/local/www/widgets/include/ folder for stray temp files. ;D