• Resolved linkinab

    (@linkinab)


    Hi!

    Trying to install the matomo wordpress plugin on a wordpress multisite installation. There are users in the existing website without an email adress (“”). When activating Matomo plugin it tries to create a a matomo for ALL users in the network, which is not ideal.

    But the problem lies in the plugin doing this automatically upon activation, and with users missing email, the unique index constraint on email in wp_matomo_user table will fail and result in a server 500 error when trying to access /wp-admin.

    From the server error log:
    PHP message: WordPress database error Duplicate entry '' for key 'uniq_email' for query INSERT INTO wp_matomo_user (login, password, email, date_registered, superuser_access, ts_password_modified, idchange_last_viewed, invited_by)?
    (VALUES not shown cause of privacy)

    Removing the index constraint on the table solves the issue and the users imports successfully.

    Is it possible to delay this import or simply avoid importing users with no email adress if this mandatory for matomo?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support emermatomo

    (@emermatomo)

    @linkinab It seems like it’s trying to re-create a user that is already in there, I’m not sure why exactly but one thing you could try is deleting all the users in the matomo_user table then running that “Sync users” again to pull them all back across.
    So in your database run:
    SELECT * FROM wp_matomo_user; (with the correct table prefix)
    Copy the results, just in case.
    DELETE FROM wp_matomo_user;
    Then click the “Sync users” button again.

    If this fails could you please check again the users in the wp_users table for duplicate emails:
    SELECT user_email FROM wp_users;

    Plugin Support emermatomo

    (@emermatomo)

    Hi @linkinab I assume that it worked since it’s been 3 weeks and will therefore mark the issue for now as resolved. If something is not working feel free to leave a comment and we continue following up.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unique index constraint on wp_matomo_users breaks site’ is closed to new replies.