• Resolved Reg Scheepers

    (@reg-scheepers)


    I have wordfence installed on http://www.TheApprenticeDoctor.com, academy.TheApprenticeDoctor.com, kits.TheApprenticeDoctor.com and events.TheApprenticeDoctor.com.

    Scan always fails. It says contacting wordfence to initiate the scan, but then shortly after says scan failed.
    I’m also running through cloudflare but disabling CF doesn’t solve the problem. Adding my server ip to the CF WAF allow doesn’t work either and neither does adding Wordfence server ips

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @reg-scheepers, thanks for your message and sorry to hear your scans are failing.

    If you check your Wordfence > Tools > Diagnostics page and look for connectivity, it should just ensure that your site can see our servers and connect back to your site.

    As you mention Cloudflare, you may find (especially if you have connectivity issues) that there’s some extra configuration involved.

    To detect visitor IPs correctly, you will most likely need to select, “Use the Cloudflare “CF-Connecting-IP” HTTP header to get a visitor IP. Only use if you’re using Cloudflare.” in Wordfence > All Options > General Wordfence Options > How does Wordfence get IPs.

    However as you mentioned the above not working on its own, you may also need to update your Cloudflare settings to allow your site to connect back to itself. You should be able to do this by going to your Cloudflare control panel. It’s worth checking all IPs associated with your server first (Find them at Wordfence > Tools > Diagnostics > IP(s) used by this server)

    • Login to Cloudflare
    • Go to “Firewall”
    • Click the “Firewall Rules” tab
    • Click “Create a Firewall rule”
    • Name the rule under “Rule Name”
    • Set the “Field” under “When incoming requests match…” to “IP Source Address”
    • Enter your site’s IP address(es) under “Value”
    • At the bottom, under “Then…Choose an action” change “Block” to “Allow”
    • Click “Deploy

    If it seems that you also need to allow our IPs, repeat the same process for the list of IPs given in this link: https://www.wordfence.com/help/advanced/#servers-and-ip-range

    If none of that works, it’d be great if you can do the following steps for me:

    • Go to the Wordfence > Tools > Diagnostics page
    • In the “Debugging Options” section check the circle “Enable debugging mode” 
    • Click to “Save Changes”.
    • CANCEL any current scan and start a NEW scan
    • Copy the last 20 lines from the Log (click the “Show Log” link) or so of the activity log once the scan finishes and paste them in this post.

    Wordfence > Tools > Diagnostic > Debugging Screenshot

    This will help me see exactly what is happening when the scan fails.

    Many thanks,
    Peter.

    Thread Starter Reg Scheepers

    (@reg-scheepers)

    Hi Peter,

    Thanks for taking the time and the detailed reply. I’ve followed all the steps and still cannot get it to work. Here is the diagnostic data:

    1. [Dec 12 14:19:51] Got value from wf config maxExecutionTime: 0
    2. [Dec 12 14:19:51] Got max_execution_time value from ini: 30
    3. [Dec 12 14:19:51] getMaxExecutionTime() returning half ini value: 15
    4. [Dec 12 14:19:52] Scan process ended after forking.
    5. [Dec 12 14:20:35] Scan stop request received.
    6. [Dec 12 14:20:46] Ajax request received to start scan.
    7. [Dec 12 14:20:46] Entering start scan routine
    8. [Dec 12 14:20:46] Got value from wf config maxExecutionTime: 0
    9. [Dec 12 14:20:46] Got max_execution_time value from ini: 30
    10. [Dec 12 14:20:46] getMaxExecutionTime() returning half ini value: 15
    11. [Dec 12 14:20:46] Test result of scan start URL fetch: array ( 'headers' => WpOrg\Requests\Utility\CaseInsensitiveDictionary::__set_state(array( 'data' => array ( 'date' => 'Tue, 12 Dec 2023 12:20:46 GMT', 'content-type' => 'text/html; charset=UTF-8', 'x-powered-by' => 'PHP/8.1.25', 'set-cookie' => 'wp_wpfileupload_0c26734c415dddce8cefa4241ef4a07f=98kLAj6hP9Mz7RMZK32cCPtKFsedA9MD; expires=Thu, 14-Dec-2023 12:20:46 GMT; Max-Age=172800; path=/', 'x-robots-tag' => 'noindex', 'x-content-type-options' => 'nosniff', 'expires' => 'Wed, 11 Jan 1984 05:00:00 GMT', 'cache-control' => 'no-cache, must-revalidate, max-age=0', 'referrer-policy' => 'strict-origin-when-cross-origin', 'x-frame-options' => 'SAMEORIGIN', 'vary' => 'Accept-Encoding', 'alt-svc' => 'h3=":443"; ma=86400', 'cf-cache-status' => 'DYNAMIC', 'report-to' => '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=zx3PfAY1%2FgMuazSjYly%2
    12. [Dec 12 14:20:46] Starting cron with normal ajax at URL https://academy.theapprenticedoctor.com/wp-admin/admin-ajax.php?action=wordfence_doScan&isFork=0&scanMode=standard&cronKey=034bc8c390fb40a629fa9038a2d1dc4c&signature=79178731d603f761190d01aaa154832f6a6599be5bc4af49e531afa032be4613
    13. [Dec 12 14:20:47] Scan engine received request.
    14. [Dec 12 14:20:47] Verifying start request signature.
    15. [Dec 12 14:20:47] Fetching stored cronkey for comparison.
    16. [Dec 12 14:20:47] Checking cronkey: 034bc8c390fb40a629fa9038a2d1dc4c (expecting 034bc8c390fb40a629fa9038a2d1dc4c)
    17. [Dec 12 14:20:47] Checking saved cronkey against cronkey param
    18. [Dec 12 14:20:47] Checking if scan is already running
    19. [Dec 12 14:20:47] Requesting max memory
    20. [Dec 12 14:20:47] Setting up error handling environment
    21. [Dec 12 14:20:47] Setting up scanRunning and starting scan
    22. [Dec 12 14:20:47] Contacting Wordfence to initiate scan
    23. [Dec 12 14:20:47] Calling Wordfence API v2.26:https://noc1.wordfence.com/v2.26/?k=eac3c44b2c5aad34d69c7c57d1551e558a4cc1ae1ccefd083351abb74ee827d6cb1564ce51808808c35670135f8929819a2a1c3b5b67d703cbdf43a81d25552e&s=eyJ3cCI6IjYuNC4xIiwid2YiOiI3LjExLjAiLCJtcyI6ZmFsc2UsImgiOiJodHRwczpcL1wvYWNhZGVteS50aGVhcHByZW50aWNlZG9jdG9yLmNvbSIsInNzbHYiOjI2OTQ4ODMxOSwicHYiOiI4LjEuMjUiLCJwdCI6ImxpdGVzcGVlZCIsImN2IjoiNy42MS4xIiwiY3MiOiJPcGVuU1NMXC8xLjEuMWsiLCJzdiI6IkxpdGVTcGVlZCIsImR2IjpudWxsLCJsYW5nIjoiIn0&action=log_scan
    24. [Dec 12 14:20:47] Got value from wf config maxExecutionTime: 0
    25. [Dec 12 14:20:47] Got max_execution_time value from ini: 30
    26. [Dec 12 14:20:47] getMaxExecutionTime() returning half ini value: 15
    27. [Dec 12 14:20:47] Scan process ended after forking.
    Thread Starter Reg Scheepers

    (@reg-scheepers)

    Hi there. Is there any update on this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Scan fails’ is closed to new replies.