• Resolved BenLinders

    (@benlinders)


    I’m seeing a database error using Query Monitor which points to Wordfence:

    INSERT INTO xxx_wfConfig (name, val, autoload) values (‘lastNotificationID’, ‘1’, ‘no’)+wfConfig::atomicInc()

    Plugin: wordfence

    Duplicate entry ‘lastNotificationID’ for key ‘PRIMARY’

    1062

    Can you help me finding out what might cause it and solve it?

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

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

    (@wfpeter)

    Hi @benlinders, thanks for your message.

    With errors such as this being picked up in Query Monitor or similar tools, warnings like this can be displayed for our intended silent failures. We sometimes utilize WordPress’ $wpdb->suppress_errors(true); function in situations we know an error may occur. This might sound counter-intuitive but there’s no fixed amount of resources we know Wordfence will use on each customers’ server. Therefore, some non-critical situations where it’s more expensive on resources to retry or check for the presence of a file/record, we simply choose to fail silently and continue.

    It looks like your case involved 2 almost simultaneous hits on the database trying to do the same thing. The first succeeded, so the second hit a duplicate entry error. Query Manager often ignores this intentional error suppression inbuilt into WordPress and presents them as issues.

    Thanks,
    Peter.

    Thread Starter BenLinders

    (@benlinders)

    Hi Peter,

    Thanks for your response.

    I’m trying to understand how this works fr me. Des this mean that I should ignore the error. Or will you a plugin update to suppress the error?

    Ben Linders

    Plugin Support wfpeter

    (@wfpeter)

    Hi @benlinders,

    The plugin had already suppressed the error at the time it occurred, but Query Monitor still reported it. You can safely ignore this kind of race condition.

    Thanks again,
    Peter.

    Thread Starter BenLinders

    (@benlinders)

    thanks for letting me know.

    Ben Linders

    Plugin Support wfpeter

    (@wfpeter)

    No worries @benlinders, if you have further Wordfence questions in future by all means start a new topic and we’ll always be happy to help out!

    Peter.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Database error Duplicate entry ‘lastNotificationID’ for key ‘PRIMARY’’ is closed to new replies.