• Resolved Norm Sash

    (@normsash)


    Hi,

    I’m receiving errors similar to the following on several sites. Any ideas as to what is causing this?

    [04-Mar-2023 00:44:50 UTC] PHP Fatal error:  Declaration of Monolog\Handler\FilterHandler::isHandling(array $record) must be compatible with Monolog\Handler\AbstractHandler::isHandling(array $record): bool in /home/xxx/public_html/wp-content/plugins/pods/tribe-common/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php on line 93
    
    • This topic was modified 1 year, 8 months ago by Norm Sash.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Sounds like there’s another plugin with a different version of Monolog being used on the site. If it only just happened, what plugins did you update most recently?

    Thread Starter Norm Sash

    (@normsash)

    Hi Scott,

    I’ve done some isolation and it seems to be related to Shield security plugin https://www.ads-software.com/plugins/wp-simple-firewall/.

    I’ve also submitted a support ticket to them. What happens when different devs use different versions of a library like Monolog?

    Thread Starter Norm Sash

    (@normsash)

    Hi Scott, I just got a reply from Shield support. Here it is…

    It looks like the Pods plugin you’re using is making use of an old version of the PHP monolog library.

    The best solution going forward is reach out to them and ask them to bring their Monolog library up-to-date…
    If you want to use their plugin, you may revert Shield to the previous v16.1.5 till they release a fix.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Last time we updated a library like this in a release, it broke other plugins that had the same or older versions of that library also like with https://github.com/firebase/php-jwt

    This may have to wait for Pods 3.0 because there’s too much risk there to update this library in a 2.9.x release.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    A workaround is to load your own (newer) version of Monolog before Pods loads so that Pods won’t load it’s own.

    Thread Starter Norm Sash

    (@normsash)

    Thanks Scott. Yes, I do see where some other plugins are having issues with the different versions of Monolog. I’m not aware of any other plugins that I’m using are having issues, but other sites are.

    Question… since you are saying that if a (newer) version of Monolog is loaded before Pods, Pods won’t load its own, I’m wondering if I can change the load order of the plugins so that Shield always loads before Pods. My thought is that if Shield loads first, then the newer version of Monolog will be loaded, and then Pods can load after that. What do you think of that idea? And do you know how I can change the plugin load order to try it?

    My tupence worth (for what it’s worth)

    I’ve included this text on ShieldPro and these support pages.

    Been digging after my crash report email came through, and that was after updating the plugin SheieldPro.

    This is their latest version:
    Ultimate WP Security Protection – Scans, 2FA, Firewall, SPAM, Activity Log, Security Admin, and so much more.
    Version 17.0.9 | By Shield Security

    After updating this plugin – my website crashed out with the dreaded white screen of death,
    Renaming (wp-simple-firewall) to (old-wp-simple-firewall), ..
    IT WORKS AGAIN.

    (BUT)
    From reading the crash report email .. its seems like it’s the PODS side that’s now causing new error.

    Version 2.9.11.1 | By Pods Framework Team | View details
    This plugin failed to load properly and is paused during recovery mode.

    An error of type E_COMPILE_ERROR was caused in line 93 of the file /home2/b92couk/public_html/wp-content/plugins/pods/tribe-common/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php. Error message: Declaration of Monolog\Handler\FilterHandler::isHandling(array $record) must be compatible with Monolog\Handler\AbstractHandler::isHandling(array $record): bool

    Now, I know that ShieldPro can’t fix some PODS code, and I also know that PODS can’t dictate how ShieldPro works, but I was wondering if someone (from both parties) could perhaps look into this weird issue.

    From reading the above thread, then at least I am aware that the issue is being addressed.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Thread Starter Norm Sash

    (@normsash)

    Hi Scott.

    Yes, I got the update from Shield support. It’s a partial workaround (not really a fix) that I’m testing now. Some features of Shield won’t work with this workaround. Here’s some of the explanation from Shield:

    You can install the latest version: 17.0.13.

    We’ve taken a very unconventional step to avoid these errors. We’ve created 2 separate dependency libraries within our own plugin to avoid any critical errors with other libraries.

    If the library in conflict (Monolog) is found to be on the site already, Shield won’t load our version of library and so you won’t have any conflicts. However, you will no longer have access to Activity Logs or Traffic Logs on those affect sites.

    Cheers POD people, installed the new Shield plugin and my site now runs again, ..

    But! – It’s only a kludge, being as there’s now huge banner on the dashboard warning about this incompatible Monolog library version number, and with no fix being sorted out in the near future.

    So, that means that it’s now a toss-up between ShieldPro and subscription PODS, .. (no contest) – I’ve installed Cerber as an alternative, and now don’t have any dashboard warnings floating about.

    Laters chaps ..

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I think this is something many plugin authors are trying to sort out right now. We’re all using libraries and as WP and PHP continues to move forward, we’re also all using different versions of the same libraries which introduce incompatibility errors over time on their own.

    Something I’m eager to do for Pods is to namespace some of the libraries we use, if we ship them and we call them then we should have those Composer packages be namespaced so they won’t conflict or become conflicted with usages by other plugins.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Fatal error, monolog’ is closed to new replies.