• Resolved erikdemarco

    (@erikdemarco)


    I recommend all your developer to turn on the WP_DEBUG and install debug plugin like ‘query monitor’ so you can monitor warning and error that is hidden from user.

    When installing plugin I get database error:

    INSERT INTO wp_wfconfig (name, val, autoload) values ('lastNotificationID', '1', 'no')	
    
        wfConfig::atomicInc()
        wfNotification->__construct()
        wp-content/plugins/wordfence/lib/wfNotification.php:83
        wordfence::_refreshUpdateNotification()
        wp-content/plugins/wordfence/lib/wordfenceClass.php:377
        wordfence::_scheduleRefreshUpdateNotification()
        wp-content/plugins/wordfence/lib/wordfenceClass.php:342
        do_action('upgrader_process_complete')
        wp-includes/plugin.php:484
        WP_Upgrader->run()
        wp-admin/includes/class-wp-upgrader.php:857
        Plugin_Upgrader->install()
        wp-admin/includes/class-plugin-upgrader.php:137
    
    	Plugin: wordfence 	Duplicate entry 'lastNotificationID' for key 'PRIMARY' 	1062
    INSERT INTO wp_wfconfig (name, val, autoload) values ('lastNotificationID', '1', 'no')	
    
        wfConfig::atomicInc()
        wfNotification->__construct()
        wp-content/plugins/wordfence/lib/wfNotification.php:83
        wfScanEngine::refreshScanNotification()
        wp-content/plugins/wordfence/lib/wfScanEngine.php:114
        wfIssues->reconcileUpgradeIssues()
        wp-content/plugins/wordfence/lib/wfIssues.php:735
        wordfence::_refreshUpdateNotification()
        wp-content/plugins/wordfence/lib/wordfenceClass.php:387
        wordfence::_scheduleRefreshUpdateNotification()
        wp-content/plugins/wordfence/lib/wordfenceClass.php:342
        do_action('upgrader_process_complete')
        wp-includes/plugin.php:484
        WP_Upgrader->run()
        wp-admin/includes/class-wp-upgrader.php:857
        Plugin_Upgrader->install()
        wp-admin/includes/class-plugin-upgrader.php:137
    
    	Plugin: wordfence 	Duplicate entry 'lastNotificationID' for key 'PRIMARY' 	1062
Viewing 1 replies (of 1 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @erikdemarco, thanks for getting in touch.

    The function wfConfig::atomicInc() where this occurs is using $wpdb->suppress_errors(true); to suppress this message, because we expect an error if the row already exists. It looks like query monitor is able to still ignore the error suppression and pick up the error.

    The reason why we allow this particular error to happen silently in the background is because it decreases the chance of a race condition happening, which could occur if we ran an extra query to check if the value exists yet. In short, the value could be created between the check and the attempted INSERT.

    Thanks,

    Peter.

Viewing 1 replies (of 1 total)
  • The topic ‘[BUG] Database error when installing plugin’ is closed to new replies.