• Resolved WanDal

    (@dawasi)


    Hello

    Since we updated to version 5.1.9 of All In One WP Security, we frequently get the following error message with our cronjobs:

    file_get_contents(https://api.ipify.org/): failed to open stream: HTTP request failed! HTTP/1.0 502 Bad Gateway? in /wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-helper.php on line 182

    We have set the visitor IP address detection to REMOTE_ADDR, which works correctly.

    Many thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @dawasi

    Nothing to worry here it will not make any functionality related problem.

    It is PHP Warning: https://api.ipify.org/ failed to retrieve IP address due to WP cronjob running do not have REMOTE_ADDR and when try access the site seems api.ipify.org seems down. Generally the site works. some times due to load it have such issue.

    Regards

    Thread Starter WanDal

    (@dawasi)

    Hi @hjogiupdraftplus

    Thank you very much for your comments. Even though I can understand the reasoning, I unfortunately cannot confirm that the warnings are completely unproblematic. Namely, in our case, the customization of headers fails because the PHP warning about the connection problems with ipify has already been output (Cannot modify header information – headers already sent). This in turn causes the cronjob to fail.

    Kind regards

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @dawasi

    Corn run as console not run as browser so header information not required for cronjobs.

    Please cross check what the cronjob actual does and if possible stop execution as actual cronjob task done without output as browser.

    Regards

    Thread Starter WanDal

    (@dawasi)

    Hi @hjogiupdraftplus

    You are right of course. Unfortunately, I can’t just customize the cronjob as it is part of a third party plugin.
    Nevertheless, I think that errors caused by ipify should be caught by AIOS in the sense of a clean exception handling.

    Kind regards

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @dawasi

    It is warning if it is fatal error exception is generally taken care.

    Regards

    Thread Starter WanDal

    (@dawasi)

    Hi @hjogiupdraftplus

    Is there a way you can add a filter to the AIOS_Abstracted_Ids::get_ip_lookup_services() method so that the list of providers can be customized? Because if we comment out ipify, everything runs smoothly.

    Thanks

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @dawasi

    Ok, Thanks for your suggestion. I will create internal ticket for this.

    Regards

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @dawasi

    We can not add the filter there as code is to be used inside AIOS firewall which suppose to run before wordpress loads.

    The issue Ipify error on cron – api.ipify.org http request failed is solved by not to do those lookup services for cronjobs and wp cli.

    Please upload the zip as Add new plugin and replace it with existing AIOS plugin.

    https://gofile.io/d/DAKWa7

    This fix is going to be in the next release.

    Thread Starter WanDal

    (@dawasi)

    Hi @hjogiupdraftplus

    Great! This seems to solve the problem. Many thanks.

    Kind regards
    dawasi

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Ipify error on cron’ is closed to new replies.