• Can Wordfence be updated to say WHY the scan stage failed? Surely there is some check that fails that causes it to stop scanning. It would be immensely helpful to log that. I recently switched hosting to Nexcess and before Wordfence used to be very reliable in scanning. Now it fails about 15% of the time with no discoverable pattern. All I get is:

    [Sep 08 09:45:39:1694180739.570659:2:info] Scanned contents of 6611 additional files at 23.73 per second
    [Sep 08 09:45:38:1694180738.812135:2:info] Attempting to resume scan stage (1 attempt(s) remaining)...
    [Sep 08 09:43:46:1694180626.792340:2:info] Scanned contents of 6604 additional files at 39.81 per second

    There should be some sort of error message there. I tried to dig into it a bit and found that in wordfenceClass.php ajax_activityLogUpdate_callback for SCAN_FAILED_CALLBACK_TEST_FAILED it deliberately skips populating the rawErrorHTML variable which contains the exception message. So I added that in via:

    $scanFailedHTML = wfView::create('scanner/scan-failed', array(
    					'messageTitle' => __('Scan Stage Failed', 'wordfence'),
    					'messageHTML' => __('A scan stage has failed to start. This is often because the site either cannot make outbound requests or is blocked from connecting to itself.', 'wordfence') . $resumeMessage . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_SCAN_FAILED_START) . '" target="_blank" rel="noopener noreferrer">' . __('Click here for steps you can try.', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>',
    					'rawErrorHTML' => esc_html(wfConfig::get('lastScanCompleted', '')),
    					'buttonTitle' => __('Close', 'wordfence'),
    				))->render();

    And…. it just says ‘ok’. So an exception occurred, causing it to set the scan failed to wfIssues::SCAN_FAILED_CALLBACK_TEST_FAILED yet the exception message is just ‘ok’? What the heck is going on. How do i fix this?

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

    (@wfpeter)

    Hi @gmariani405, thanks for your enquiry.

    In the case where rawErrorHTML is not displayed, it’s because it does not contain a useful error for the type of failure that occurred. This may mean that something at the host killed the process in the middle of the scan, or that the scan failed while “forking”. We can’t log error messages in the first case, and “forked” scan processes would stack up if each one waited on the next to finish.

    We do have some plans around this area, but more testing and development to reliably log errors without using excess resources is required.

    We may be able to troubleshoot if you can turn on Wordfence > Tools > Diagnostics > Debugging Options > Enable debugging mode, run a scan, and email us a scan log from the plugin when it fails. It may also help us to see access logs and diganostics from around the time of the scan. You can send any access log exports and a downloaded diagnostic TXT from Wordfence > Tools > Diagnostics to wftest @ wordfence . com. Just make sure to put your forum username in the subject line and let us know here when you’ve sent them so we can take a look.

    Thanks,
    Peter.

    Thread Starter gmariani405

    (@gmariani405)

    I enabled debugging mode, ran the wordfence scan and it failed twice but was able to finish up eventually (just takes forever). I emailed the activity log directly from the Scan screen. On the Diagnostic page, I sent the report by email and put my username in there. Let me know if you need anything else.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Scan stage failed reason?’ is closed to new replies.