• Resolved Mark Howells-Mead

    (@markhowellsmead)


    The following error is blocking the site. The redacted email (a different user’s email address) in this code does not correspond to the redacted first name (mine), so I don’t know why this update is being run. This error is blocking the login page, as well as many of the views in WordPress admin.

    [29-Jan-2025 15:02:30 UTC] WordPress database error Duplicate entry '***REDACTEDEMAIL***' for key 'uniq_email' for query UPDATE wpen_2_matomo_user SET email = '***REDACTEDEMAIL***' WHERE login = '***REDACTEDFIRSTNAME***' made by require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, WpMatomo->init_plugin, WpMatomo\Updater->update_if_needed, WpMatomo\Updater->get_plugins_requiring_update, WpMatomo\Installer::is_intalled, WpMatomo\Bootstrap::do_bootstrap, WpMatomo\Bootstrap->bootstrap, Piwik\FrontController->init, Piwik\Access->reloadAccess, Piwik\Plugins\WordPress\SessionAuth->authenticate, Piwik\Plugins\WordPress\SessionAuth->findMatomoUser, WpMatomo\User\Sync->sync_current_users, WpMatomo\User\Sync->sync_users, WpMatomo\User\Sync->ensure_user_exists, Piwik\Plugins\UsersManager\Model->updateUserFields, Piwik\Db\Adapter\WordPress->query
Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @markhowellsmead can you check for duplicate entries for that email in the wp_users table?

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    There are no duplicate users in the users table.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @markhowellsmead ok, can you check what the login for the redacted email is in the wpen_2_matomo_user table? Is it the same as the login in the error message? If it’s different, was the existing login in the wpen_2_matomo_user table deleted at some point?

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    The login name for the user with the specified email address relates to a different user with a different email address. The login name for the specified email address is “Michaela” but the login name in the error message is “Mark” (my login name), and that user (me) has a different email address in the wpen_2_matomo_user table.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Can you find the WordPress user ID’s for your user and the user mentioned, then check the value for the following entries in the wp_options table:

    • WHERE option_name = matomo-user-login-$YOUR_USER_ID
    • WHERE option_name = matomo-user-login-$OTHER_USER_ID

    ?

    You could also enable debug logging then run a user sync manually in the Troubleshooting tab to get some details about the user syncing process, before it fails.

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    My user ID is matomo-user-login-3.
    The other user ID is matomo-user-login-18.

    You could also enable debug logging then run a user sync manually in the Troubleshooting tab to get some details about the user syncing process, before it fails.

    That throws the same critical PHP error.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @markhowellsmead and after it shows the critical error, you checked the debug.log file for something relevant, correct?

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    Yes, the same error message I’ve already provided is logged.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    My user ID is matomo-user-login-3.
    The other user ID is matomo-user-login-18.

    That is not the information I was asking for, read my request again.

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    • WHERE option_name = matomo-user-login-$YOUR_USER_ID

    option_value = Mark

    • WHERE option_name = matomo-user-login-$OTHER_USER_ID

    option_value = Michaela

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @markhowellsmead Is this a multisite setup?

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    Yes. The option_values are the same in all of the *_options tables.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Yes, the same error message I’ve already provided is logged.

    There should be more logs before that error, such as “Matomo is now creating a user for…”.

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    • Matomo: Matomo will now sync 17 users
    • Matomo: Matomo is now updating the email for wpUserID 18 matomo login Mark
    • WordPress database error Duplicate entry ‘***REDACTED EMAIL***’ for key ‘uniq_email’ for query UPDATE wpen_2_matomo_user SET email = ‘***REDACTED EMAIL***’ WHERE login = ‘Mark’
    • PHP Fatal error:? Uncaught Zend_Db_Statement_Exception: WP DB Error: [1062] Duplicate entry ‘***REDACTED EMAIL***’ for key ‘uniq_email’ SQL: UPDATE wpen_2_matomo_user SET email = ? WHERE login = ? in ***webroot***/wp-content/plugins/matomo/classes/WpMatomo/Db/WordPress.php:417

    (Again, noting that this query is attempting to set the wrong email address for the user Mark.)

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @markhowellsmead Ok I think I see the issue if this is a multisite install. I should hopefully have a fix soon.

Viewing 15 replies - 1 through 15 (of 23 total)
  • You must be logged in to reply to this topic.