Errors in debug.log on site

I'm seeing these recurring errors in my debug.log file:

[03-Jun-2019 17:15:43 UTC] PHP Warning: Invalid argument supplied for foreach() in /var/web/site/public_html/wp-cron.php on line 111

[03-Jun-2019 17:10:22 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/web/site/public_html/wp-includes/class-wp-query.php on line 4094

  • Adam Czajczyk
    • Support Gorilla

    Hello Edoardo

    I hope you're well today!

    [03-Jun-2019 17:15:43 UTC] PHP Warning: Invalid argument supplied for foreach() in /var/web/site/public_html/wp-cron.php on line 111

    Please try clearing up site's transient first (all, not only expired). You can do it using Hummingbird's "Advanced Tools -> Database cleanup" tools.

    After that Flush Cache on server, clear Hummingbird's cache and then temporarily disable maintenance mode. Give it a while and see if the warning still shows up and let me know, please.

    `[03-Jun-2019 17:10:22 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /var/web/site/public_html/wp-includes/class-wp-query.php on line 4094

    Did you add or remove any code (some plugin or change in theme or a custom code) that is/was using some custom type posts? Was there any custom post type removed recently from site?

    Let me know, please.

    Kind regards,
    Adam

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Edoardo ,

    The "post_type" error originates from the WordPress function is_singular() ( https://developer.wordpress.org/reference/functions/is_singular/ ). This means that "something" within your WordPress doesn't pass as an object either on a check or on itself and is_singular can't check it properly. I say "something" as it's really hard to find without touching the website.

    The cron error means that a cron is either not registered properly so it can't run correctly, or the plugin that is trying to run it is calling it wrongly so it breaks. Again this is something that to check it out we have to run each cron one by one and to disable mostly everything until we at least find from which cron the error generates.

    In any of the cases in order to help out as much as possible I'll have to make various conflict tests that will take time and still it might be hard to get to the bottom of this as both of the errors are too vague without giving a specific hint of what might be causing this ( as an example is_singular might be running on all posts/pages/custom post types/templates within the website ).

    I wanted to inform you first before I proceed with a conflict test as I wanted your OK for this since the website won't be fully functional during that time. Please make sure to keep a full backup yourself as well and I'll keep one as well before the tests.

    Do inform me if I can proceed with the tests :slight_smile: .

    Regards,
    Konstantinos

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hey Edoardo ,

    I've checked the staging but I didn't see those errors getting produced there at all. Also during that time I was checking the live site as well and didn't see them there either. Did you maybe change anything?

    In any case since those 2 are "warnings" they shouldn't be breaking the site at all and unfortunately as I've mentioned it would be really hard to pinpoint them down especially without an 100% conflict test or replication process.

    If you continue to get the same warnings from time to time maybe you'd want to hire some extra help from a developer in order to research this further in case of any findings, you can do so if you like from our partners page:
    https://premium.wpmudev.org/partners/#wpmud-hg-discounts-services

    Regards,
    Konstantinos

  • Edoardo
    • Flash Drive

    Konstantinos Xenos this old eror dont trigger anymore i dont know why...but in aifb.staging.wpmudev.host i have a lot of

    [07-Jun-2019 14:30:09 UTC] PHP Warning: preg_match(): Empty regular expression in /var/web/staging/public_html/wp-content/plugins/wp-defender/app/module/scan/behavior/pro/content-scan.php on line 598

    and other

  • Adam Czajczyk
    • Support Gorilla

    Hello Edoardo

    This warning would be related to Defender's "File Scan" module. At this point it's supposed to analyse content of files (functions inside) against potentially malicious "code patterns" but it looks like it's not actually getting function content.

    This is happening only on the staging site right? The "and other" that you mentioned - you mean that there are multiple warnings of the same but with different line numbers of there are multiple different warnings?

    Also - does file scan actually report any issues there or says that site's clean?

    Best regards,
    Adam

  • Edoardo
    • Flash Drive

    In hosting log appear this.

    [500])
    
    [WPMUDEV API Error] 4.7.1.3 | cURL error 28: Operation timed out after 15001 milliseconds with 0 bytes received ((unknown URL)
    
    [17-Jun-2019 21:03:37 UTC]
    
    [500])
    
    [WPMUDEV API Error] 4.7.1.3 | cURL error 28: Operation timed out after 15001 milliseconds with 0 bytes received ((unknown URL)
    
    [17-Jun-2019 21:03:06 UTC]

    i cant make hummingbird performance test no report after test.

    Jonathan Solorzano failed to find a solution

  • Predrag Dubajic
    • Support

    Hi Edoardo,

    Apologies for the long delay here, we were a bit short staffed the last couple of days but we're picking things up now as fast as we can.

    That error is usually related to DNS issues if something isn't resolving properly and once the issues are gone it can take up to 24 hours for Hub to pick it up and remove the error.
    I see in your logs that there were no more reports about this since 17. so it seems that it should be all good now.

    Are you perhaps still seeing this error anywhere?

    Best regards,
    Predrag

  • Adam Czajczyk
    • Support Gorilla

    Hello Edoardo

    Thanks for confirmation!

    If I understand correctly in this case only the two other that were discussed earlier would be left, is that right?

    As Konstantinos explained earlier (see here) those would be just warning and shouldn't actually affect site performance and cause any issues. In fact, on some servers reporting "warnings" is even disabled in PHP configuration so they wouldn't even be visible :slight_smile:

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.