• Hello,

    I use the email file change notifications on all my sites.
    I receive the mail everyday, which tell me that the whole site has been added.
    For example :

    Files Added: 7016
    Files Deleted: 0
    Files Modified: 0
    Memory Used: 15.19 MB

    I try what your proposals here
    But it doesn’t work, the itsec_local_file_list col is always empty.

    My manual scans are always empty ( when I click on the logs tab then, scan files now ).

    Have you got any idea.

    Thanks

    https://wordpress.org/plugins/better-wp-security/

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter matrium

    (@matrium)

    Sorry, but your two links give me a 404 error.

    Ah, I forgot to rename the files …
    My apologies for the inconvenience.
    The links should work now.

    dwinden

    Thread Starter matrium

    (@matrium)

    Hello,

    No problem, this is the logs

    File lock file_change.lock created.
    # logged_files: 0
    # current_files: 7032

    Array
    (
    )

    *****************************************************************************************************************

    Array
    (
    [wp-admin/install.php] => Array
    (
    [d] => 1430160378
    [h] => 6a48aee948fe2ea5d3a6b9a325b604f5
    )

    [wp-admin/js/accordion.js] => Array
    (
    [d] => 1427365157
    [h] => f25e56e30af6382e3770be437493373a
    )

    [wp-comments-post.php] => Array
    (
    [d] => 1430160379
    [h] => 91c0d3c3f1d0a5f06ca9b225f966e6a7
    )

    [license.txt] => Array
    (
    [d] => 1430160379
    [h] => 3938fcd57688b4d7681a50d6a1f53e71
    )

    )

    File lock file_change.lock released.
    Unable to update the itsec_local_file_list option.
    # Added: 7032
    # Deleted: 0
    # Changed: 0

    Array
    (
    [added] => Array
    (
    [wp-admin/install.php] => Array
    (
    [d] => 1430160378
    [h] => 6a48aee948fe2ea5d3a6b9a325b604f5
    )

    [wp-admin/js/accordion.js] => Array
    (
    [d] => 1427365157
    [h] => f25e56e30af6382e3770be437493373a
    )

    [wp-settings.php] => Array
    (
    [d] => 1430160378
    [h] => 891420b0ac987228906c327d2bee1dba
    )

    [wp-config-sample.php] => Array
    (
    [d] => 1430160379
    [h] => 6f224d13e4a270c2e671e6fe24761942
    )

    [wp-comments-post.php] => Array
    (
    [d] => 1430160379
    [h] => 91c0d3c3f1d0a5f06ca9b225f966e6a7
    )

    [license.txt] => Array
    (
    [d] => 1430160379
    [h] => 3938fcd57688b4d7681a50d6a1f53e71
    )

    )

    [removed] => Array
    (
    )

    [changed] => Array
    (
    )

    [memory] => 15.05
    )

    Start logging scan …
    Scan logged.
    Return: true

    Ok, finally we’ve got something.

    When trying to save the current file list to the database you’ve got:

    Unable to update the itsec_local_file_list option.

    The code below should normally save the itsec_local_file_list option:

    update_site_option( $db_field, $current_files );

    So this is where your problem is. This is why you repeatedly get only a high number of files added …

    Now we need to figure out why the itsec_local_file_list option cannot be updated. There is probably an error happening there. I’ll try and think of a way to get that error …
    Actually try and run the debug script again after setting WP_DEBUG to true in the wp-config.php file. Perhaps an error will be displayed.
    Don’t forget to set WP_DEBUG back to false after debugging.

    Furthermore it looks like the scan is logged as it says at the end:

    Start logging scan …
    Scan logged.

    So I expect you now have one entry in the File Change History log.
    If not then something also goes wrong with logging the scan.

    dwinden

    Thread Starter matrium

    (@matrium)

    This is the log of itsec_scan.php with debug ( I think nothing has change ).
    There is still no entry in the Fil CHange History log.

    File lock file_change.lock created.
    # logged_files: 0
    # current_files: 7032

    Array
    (
    )

    *****************************************************************************************************************

    Array
    (
    [wp-admin/install.php] => Array
    (
    [d] => 1430160378
    [h] => 6a48aee948fe2ea5d3a6b9a325b604f5
    )

    [wp-admin/js/accordion.js] => Array
    (
    [d] => 1427365157
    [h] => f25e56e30af6382e3770be437493373a
    )

    [license.txt] => Array
    (
    [d] => 1430160379
    [h] => 3938fcd57688b4d7681a50d6a1f53e71
    )

    )

    File lock file_change.lock released.
    Unable to update the itsec_local_file_list option.
    # Added: 7032
    # Deleted: 0
    # Changed: 0

    Array
    (
    [added] => Array
    (
    [wp-admin/install.php] => Array
    (
    [d] => 1430160378
    [h] => 6a48aee948fe2ea5d3a6b9a325b604f5
    )

    [wp-admin/js/accordion.js] => Array
    (
    [d] => 1427365157
    [h] => f25e56e30af6382e3770be437493373a
    )

    [wp-admin/js/editor-expand.js] => Array
    (
    [d] => 1430966504
    [h] => 001eee141532f8fc1fac023dbb945a92
    )

    [license.txt] => Array
    (
    [d] => 1430160379
    [h] => 3938fcd57688b4d7681a50d6a1f53e71
    )

    )

    [removed] => Array
    (
    )

    [changed] => Array
    (
    )

    [memory] => 15.04
    )

    Start logging scan …
    Scan logged.
    Return: true

    Ok, it was worth a try.

    Please also check your web server error_log for any errors.

    dwinden

    Also please update the topic with the MySQL Database Version and MySQL Client Version from the Database Information part of the System Information section on the iTSec plugin Dashboard page.

    I think the symptoms of itsec_local_file_list option and File Change Detection log entries not being saved to the database have the same root cause …
    Both database statements (update, insert) try to write the same serialized current file list (7036 files) to the database…

    So this may not be an iTSec plugin issue after all. It could be a MySQL database config\tuning issue.
    Possibly max_allowed_packet is too low … (Default 1MB or 4MB depending on the MySQL version used).

    If this is true it means I should be able to reproduce the issue…
    So as a test I lowered my MySQL max_allowed_packet value from 1MB to 149504 bytes.
    (I only have 1330 files to scan in my test env which according to my calculations would only work with a max_allowed_packet value >= 168090 bytes).
    And … Yessssss I can reproduce the issue !

    So to solve the issue contact you hosting provider and ask them to increase the MySQL max_allowed_packet value (from probably 1MB) to 16MB. You can check the value from phpMyAdmin.

    Increasing the MySQL max_allowed_packet value should be no problem since the 16MB memory is not immediately allocated. Memory from the max_allowed_packet is allocated as needed based on the size(s) of a sql query(ies).

    dwinden

    Thread Starter matrium

    (@matrium)

    Ok, I will try to change the max_allowed_packet on my website.

    My Apache error_log shows:

    WordPress database error MySQL server has gone away for query UPDATE wp_options SET option_value = ‘a:1330:{…}’ WHERE option_name = ‘itsec_local_file_list’;

    WordPress database error MySQL server has gone away for query INSERT INTO wp_itsec_log (log_type, log_priority, log_function, log_date, log_date_gmt, log_host, log_username, log_user, log_url, log_referrer, log_data) VALUES (‘file_change’, ‘8’, ‘File Changes Detected’, ‘2015-06-06 14:01:38’, ‘2015-06-06 12:01:38’, ”, ”, ‘0’, ”, ”, ‘a:4:{s:5:\”added\”;a:1330:{…}s:7:\”removed\”;a:0:{}s:7:\”changed\”;a:0:{}s:6:\”memory\”;s:4:\”2.13\”;}’);

    Perhaps you should first confirm you have the same errors in the Apache error_log before changing anything.

    dwinden

    @matrium

    If you require no further assistance with this topic please mark it as ‘resolved’.

    dwinden

Viewing 10 replies - 16 through 25 (of 25 total)

The topic ‘File change notification – mail’ is closed to new replies.