• Hi all. I’m having a problem finishing scans on one site I manage. I turned debugging on so I could see what files were being scanned, and it appears to be stuck in a loop when scanning the plugins starting at the beginning of the alphabet and ending with file <homedir-omitted>/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Search/Comparison/Entry/Checkbox.php. In the small snippet of the log that I gathered, 6,000+ lines, each file was scanned 13 times, and the scan ran through 3.5 million files (even though there are only 25,000 files in the site)…so there’s a lot of repetition happening.

    I’ll have sent the diagnostic info in, with user ID “scott8035”.

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

    (@wfpeter)

    Hi @scott8035, thanks for sending your diagnostic over.

    In addition to that information, it’d be good to see the precise scan lines you speak of. You can get that information by following these 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/fails and paste them in this post.

    Wordfence > Tools > Diagnostic > Debugging Screenshot

    Thanks,
    Peter.

    Thread Starter scott8035

    (@scott8035)

    Hi Peter. I sent the debugging log info to [email protected] on behalf of forum user “scott8035”. The last couple dozen lines are:

    SITE: https://dev.acornfinance.dev
    PLUGIN VERSION: 7.9.2
    WORDPRESS VERSION: 6.2
    LICENSE KEY: 8cce28ec0a5485825aef30968dd23cd63a3f1861f5ca7468b48900a7b6e9396d46032b9877294f3b4d4c5be4fe075e203140dc22379c92431c8abe900c094639
    ADMIN EMAIL: [email protected]
    LOG:

    Fri, 05 May 23 09:54:15 +0000::1683305655.1022:4:info::Calling Wordfence API v2.26:https://noc1.wordfence.com/stats.json

    Fri, 05 May 23 09:52:09 +0000::1683305529.4071:2:error::Scan terminated with error: The scan time limit of 1 hour has been exceeded and the scan will be terminated. This limit can be customized on the options page. <a href=”https://www.wordfence.com/help/?query=scan-time-limit“>Get More Information (opens in new tab)</a>
    Fri, 05 May 23 09:52:09 +0000::1683305529.4058:2:info::Wordfence used 190.52 MB of memory for scan. Server peak memory usage was: 220.52 MB
    Fri, 05 May 23 09:52:09 +0000::1683305529.0375:4:info::Calling Wordfence API v2.26:https://noc1.wordfence.com/v2.26/?k=8cce28ec0a5485825aef30968dd23cd63a3f1861f5ca7468b48900a7b6e9396d46032b9877294f3b4d4c5be4fe075e203140dc22379c92431c8abe900c094639&amp;s=eyJ3cCI6IjYuMiIsIndmIjoiNy45LjIiLCJtcyI6ZmFsc2UsImgiOiJodHRwczpcL1wvZGV2LmFjb3JuZmluYW5jZS5kZXYiLCJzc2x2IjoyNjk0ODgyMzksInB2IjoiOC4wLjIyIiwicHQiOiJmcG0tZmNnaSIsImN2IjoiNy42OC4wIiwiY3MiOiJPcGVuU1NMXC8xLjEuMWYiLCJzdiI6Im5naW54XC8xLjIxLjUiLCJkdiI6IjEwLjUuMTctTWFyaWFEQi0xOjEwLjUuMTcrbWFyaWF-dWJ1MjAwNCIsImxhbmciOiIifQ&amp;action=record_scan_metrics
    Fri, 05 May 23 09:52:09 +0000::1683305529.0075:10:info::SUM_FINAL:Scan interrupted. You have 1 new issue to fix. See below.
    Fri, 05 May 23 09:52:09 +0000::1683305529.0068:1:info::Scan interrupted. Scanned 958553 files, 49 plugins, 3 themes, 0 posts, 0 comments and 0 URLs in 1 hour 6 seconds.
    Fri, 05 May 23 09:52:09 +0000::1683305529.0060:1:info::——————-
    Fri, 05 May 23 09:52:08 +0000::1683305528.9988:4:info::Scanning: /www/dev2acornfinancedev_548/public/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/EntryConfigurator.php (Mem:46.0M)
    Fri, 05 May 23 09:52:08 +0000::1683305528.9953:4:info::Scanning: /www/dev2acornfinancedev_548/public/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/Entry.php (Mem:46.0M)
    Fri, 05 May 23 09:52:08 +0000::1683305528.9916:4:info::Scanning: /www/dev2acornfinancedev_548/public/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/Entry/ProductSelect.php (Mem:46.0M)
    Fri, 05 May 23 09:52:08 +0000::1683305528.9881:4:info::Scanning: /www/dev2acornfinancedev_548/public/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/Entry/Product.php (Mem:46.0M)
    Fri, 05 May 23 09:52:08 +0000::1683305528.9845:4:info::Scanning: /www/dev2acornfinancedev_548/public/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/Entry/Original/UserIp.php (Mem:46.0M)
    Fri, 05 May 23 09:52:08 +0000::1683305528.9808:4:info::Scanning: /www/dev2acornfinancedev_548/public/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/Entry/Original/User.php (Mem:46.0M)
    Fri, 05 May 23 09:52:08 +0000::1683305528.9766:4:info::Scanning: /www/dev2acornfinancedev_548/public/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/Entry/Original/TransactionId.php (Mem:46.0M)

    Plugin Support wfpeter

    (@wfpeter)

    Hi @scott8035, thanks for sending that over.

    Since we allow Premium licenses to be shared between corresponding dev, staging, and test domains you could reach out for support on this issue in our Premium support ticketing system at https://support.wordfence.com. Please notify them of the information you’ve already sent to wftest if you do, so you don’t need to duplicate anything you’ve done so far.

    Scan timeouts can be caused by server platform (such as Litespeed that needs to be told not to abort), or other factors such as excessively large files or just a large number of files rather than the individual sizes. Have you already attempted to increase the scan duration as mentioned in the error?

    I see max_execution_time = 300 in your php.ini. Wordfence’s scan only ever attempts to use half of this value by default but there have been known problems with timeouts when higher values than 60 are set, so it could be worth making this change for sure.

    For a screenshot of my recommended Performance setting options too – Click Here.

    Your WP_MEMORY_LIMIT could be set to 256M or 512M in wp-config.php. WooCommerce, for example, recommend 64M minimum, so if you also have many hits on the site at once especially during a Wordfence scan, a lower limit (like the 40M I see here currently) could be reached fairly easily. Also check your PHP memory_limit value matches when making this change.

    Thanks again,
    Peter.

    Thread Starter scott8035

    (@scott8035)

    You must have forgotten about the original description…the reason the scan stops is because the scan limit was reached, so it self-terminates. The reason it reaches the scan limit is because it’s in an infinite loop going over the same range of files again and again. It never makes it completely through the plugin directory, it restarts while still in the range of plugins starting with an “A”.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Infinite loop on file scan’ is closed to new replies.