• Resolved webdevwalton

    (@webdevwalton)


    Hi there,

    I’m getting a critical error when adding a user to the site: https://footprint.no/

    Here’s the error:

    An error of type E_ERROR was caused in line 407 of the file /nas/content/live/footprintas/wp-content/plugins/matomo/classes/WpMatomo/Db/WordPress.php. Error Message: Uncaught Zend_Db_Statement_Exception: WP DB Error: [1062] Duplicate entry '[email protected]' for key 'uniq_email' in /nas/content/live/footprintas/wp-content/plugins/matomo/classes/WpMatomo/ Db/WordPress.php:407

    The user is still created, it only seems to be an issue when WordPress attemps to create the user.

    Here’s the status dump:

          # Errors
    
    * Error PHP cli Version:  (Your PHP cli version is not compatible with the <a  target="_blank">Matomo requirements</a>. Please upgrade your PHP cli version, otherwise, you might have some archiving errors)
    
    * Error MySQLi support: missing (Your PHP cli does not load the MySQLi extension. You might have archiving problems in Matomo but also others problems in your WordPress cron tasks. You should enable this extension)
    
    # Matomo
    
    * Matomo Plugin Version: 4.14.1
    
    * Config exists and is writable.: Yes ("$abs_path/wp-content/uploads/matomo/config/config.ini.php" )
    
    * JS Tracker exists and is writable.: Yes ("$abs_path/wp-content/uploads/matomo/matomo.js" )
    
    * Plugin directories: Yes ([{"pluginsPathAbsolute":"$abs_path\/wp-content\/plugins\/matomo\/plugins","webrootDirRelativeToMatomo":"..\/"}])
    
    * Tmp directory writable: Yes ($abs_path/wp-content/cache/matomo)
    
    * Matomo Version: 4.14.1
    
    * Matomo Blog idSite: 1
    
    * Matomo Install Version: 4.6.0 (Install date: 2022-04-26 17:11:16)
    
    * Upgrades outstanding: No
    
    * Upgrade in progress: No
    
    ## Endpoints
    
    * Matomo JavaScript Tracker URL:  ($site_url/wp-content/uploads/matomo/matomo.js)
    
    * Matomo JavaScript Tracker - WP Rest API:  ($site_url/wp-json/matomo/v1/hit/)
    
    * Matomo HTTP Tracking API:  ($site_url/wp-content/plugins/matomo/app/matomo.php)
    
    * Matomo HTTP Tracking API - WP Rest API:  ($site_url/wp-json/matomo/v1/hit/)
    
    ## Crons
    
    * Server time: 2023-04-27 19:38:01
    
    * Blog time: 2023-04-27 20:38:01 (Below dates are shown in blog timezone)
    
    * Sync users & sites: Next run: 2023-04-28 12:12:19 (15 timer 34 min) ( Last started: 2023-04-27 12:12:30 (-8 timer 25 min). Last ended: 2023-03-27 12:12:53 (-31 dager 8 timer). Interval: daily)
    
    * Archive: Next run: 2023-04-27 21:13:01 (35 min 0s) ( Last started: 2023-04-27 20:13:19 (-24 min 42s). Last ended: 2023-04-27 20:13:38 (-24 min 23s). Interval: hourly)
    
    * Update GeoIP DB: Next run: 2023-05-18 12:12:07 (20 dager 15 timer) ( Last started: 2023-04-18 12:12:37 (-9 dager 8 timer). Last ended: 2023-04-18 12:12:39 (-9 dager 8 timer). Interval: matomo_monthly)
    
    ## Mandatory checks
    
    * PHP-versjon >= 7.2.5: ok
    
    * PDO utvidelse: ok
    
    * PDO\MYSQL utvidelse: ok
    
    * MYSQLI utvidelse: ok
    
    * Andre n?dvendige utvidelser: ok
    
    * N?dvendige funksjoner: ok
    
    * P?krevd PHP-konfigurasjon (php.ini): ok
    
    * Kataloger med skrivetilgang: ok
    
    * Mapper med skrivetilgang for Tagg-behandler: ok
    
    ## Optional checks
    
    * 64-biters PHP-bin?rfil: ok
    
    * Tracker-status: ok
    
    * Minnegrense: ok
    
    * Tidssone: ok
    
    * ?pne URL: ok
    
    * GD > 2.x + FreeType (grafikk): ok
    
    * Andre utvidelser: ok
    
    * Andre funksjoner: ok
    
    * Filsystem: ok
    
    * Siste fullf?rte arkivering: ok
    
    * Database-egenskaper: ok
    
    * Warning Maksimal pakkest?rrelse: warning  (Det anbefales ? sette opp en 'max_allowed_packet'-st?rrelse i din MySQL-database som minst 64MB. 16MB er n? valgt. )
    
    * Geoposisjonering: ok
    
    * Oppdater over HTTPS: ok
    
    * Supports Async Archiving: No
    
    * Location provider ID: geoip2php
    
    * Location provider available: Yes
    
    * Location provider working: Yes
    
    * Warning Proxy header: HTTP_CF_CONNECTING_IP (A proxy header is set which means you maybe need to configure a proxy header in the Advanced settings to make location reporting work. If the location in your reports is detected correctly, you can ignore this warning. <a  target="_blank">Learn more</a>)
    
    * Had visit in last 5 days: Yes
    
    * Matomo URL: Yes ($site_url/wp-content/plugins/matomo/app/)
    
    ## Matomo Settings
    
    * Track mode: default
    
    * Track codeposition: footer
    
    * Track api endpoint: default
    
    * Track js endpoint: default
    
    * Version history: 4.14.1, 4.13.5, 4.13.3, 4.13.0, 4.12.0
    
    * Core version: 4.14.1
    
    * Last tracking settings update: 1650989476
    
    * Last settings update: 1650989476
    
    * Track ecommerce: No
    
    * Disable cookies: Yes
    
    * Mail history: 2023-04-01 00:17:46, 2023-04-01 00:17:45, 2023-04-01 00:17:41
    
    ## Logs
    
    * cron_sync: 2023-04-22 12:13:24 (WP DB Error: [1062] Duplicate entry '[email protected]' for key 'uniq_email' => WordPress.php:407; WordPress.php:461; Model.php:543; Sync.php:341; Sync.php:205; Sync.php:147; Sync.php:93; ScheduledTasks.php:268; class-wp-hook.php:306; class-wp-hook.php:332; plugin.php:565; wp-cron.php:188;)
    
    * cron_sync: 2023-04-23 12:20:46 (WP DB Error: [1062] Duplicate entry '[email protected]' for key 'uniq_email' => WordPress.php:407; WordPress.php:461; Model.php:543; Sync.php:341; Sync.php:205; Sync.php:147; Sync.php:93; ScheduledTasks.php:268; class-wp-hook.php:306; class-wp-hook.php:332; plugin.php:565; wp-cron.php:188;)
    
    * cron_sync: 2023-04-24 12:13:10 (WP DB Error: [1062] Duplicate entry '[email protected]' for key 'uniq_email' => WordPress.php:407; WordPress.php:461; Model.php:543; Sync.php:341; Sync.php:205; Sync.php:147; Sync.php:93; ScheduledTasks.php:268; class-wp-hook.php:306; class-wp-hook.php:332; plugin.php:565; wp-cron.php:188;)
    
    * cron_sync: 2023-04-25 12:14:14 (WP DB Error: [1062] Duplicate entry '[email protected]' for key 'uniq_email' => WordPress.php:407; WordPress.php:461; Model.php:543; Sync.php:341; Sync.php:205; Sync.php:147; Sync.php:93; ScheduledTasks.php:268; class-wp-hook.php:306; class-wp-hook.php:332; plugin.php:565; wp-cron.php:188;)
    
    * cron_sync: 2023-04-26 12:12:48 (WP DB Error: [1062] Duplicate entry '[email protected]' for key 'uniq_email' => WordPress.php:407; WordPress.php:461; Model.php:543; Sync.php:341; Sync.php:205; Sync.php:147; Sync.php:93; ScheduledTasks.php:268; class-wp-hook.php:306; class-wp-hook.php:332; plugin.php:565; wp-cron.php:188;)
    
    * cron_sync: 2023-04-27 12:12:31 (WP DB Error: [1062] Duplicate entry '[email protected]' for key 'uniq_email' => WordPress.php:407; WordPress.php:461; Model.php:543; Sync.php:341; Sync.php:205; Sync.php:147; Sync.php:93; ScheduledTasks.php:268; class-wp-hook.php:306; class-wp-hook.php:332; plugin.php:565; wp-cron.php:188;)
    
    # WordPress
    
    * Home URL: $site_url
    
    * Site URL: $site_url
    
    * WordPress Version: 6.2
    
    * Number of blogs: 1
    
    * Multisite Enabled: No
    
    * Network Enabled: No
    
    * WP_DEBUG: No
    
    * WP_DEBUG_DISPLAY: Yes
    
    * WP_DEBUG_LOG: No
    
    * DISABLE_WP_CRON: No
    
    * FORCE_SSL_ADMIN: Yes
    
    * WP_CACHE: Yes
    
    * CONCATENATE_SCRIPTS: -
    
    * COMPRESS_SCRIPTS: -
    
    * COMPRESS_CSS: -
    
    * ENFORCE_GZIP: -
    
    * WP_LOCAL_DEV: -
    
    * WP_CONTENT_URL: $site_url/wp-content
    
    * WP_CONTENT_DIR: $abs_path/wp-content
    
    * UPLOADS: -
    
    * BLOGUPLOADDIR: -
    
    * DIEONDBERROR: -
    
    * WPLANG:
    
    * ALTERNATE_WP_CRON: -
    
    * WP_CRON_LOCK_TIMEOUT: 60
    
    * WP_DISABLE_FATAL_ERROR_HANDLER: -
    
    * MATOMO_SUPPORT_ASYNC_ARCHIVING: -
    
    * MATOMO_TRIGGER_BROWSER_ARCHIVING: -
    
    * MATOMO_ENABLE_TAG_MANAGER: -
    
    * MATOMO_SUPPRESS_DB_ERRORS: -
    
    * MATOMO_ENABLE_AUTO_UPGRADE: -
    
    * MATOMO_DEBUG: -
    
    * MATOMO_SAFE_MODE: -
    
    * MATOMO_GLOBAL_UPLOAD_DIR: -
    
    * MATOMO_LOGIN_REDIRECT: -
    
    * Permalink Structure: /%postname%/
    
    * Possibly uses symlink: No
    
    * Upload base url: $site_url/wp-content/uploads
    
    * Upload base dir: $abs_path/wp-content/uploads
    
    * Upload url: $site_url/wp-content/uploads/2023/04
    
    * Custom upload_path:
    
    * Custom upload_url_path:
    
    * Compatible content directory: Yes
    
    # WordPress Plugins
    
    ## MU Plugins
    
    * Force Strong Passwords - WPE Edition: 1.8.0
    
    * WP Engine Cache Plugin: 1.1.2
    
    * WP Engine Seamless Login Plugin: 1.6.0
    
    * WP Engine Security Auditor: 1.0.10
    
    * WP Engine System: 5.0.1
    
    ## Plugins
    
    * Admin Menu Editor: 1.11
    
    * Advanced Custom Fields PRO: 6.0.7
    
    * Custom Post Type UI: 1.13.5
    
    * Footprint Theme Support: 1.0.0
    
    * GDPR Cookie Consent: 2.3.7
    
    * Matomo Analytics - Ethical Stats. Powerful Insights.: 4.14.1
    
    * Redirection: 5.3.10
    
    * Safe SVG: 2.1.0
    
    * SCSS-Library: 0.4.1
    
    * Smush: 3.12.6 (Network enabled)
    
    * Where's My Bread ? ??: 1.0.6
    
    * WPvivid Backup Plugin: 0.9.84
    
    * Yoast SEO: 20.4
    
    * Active Plugins: 12 (Where-Is-My-Bread-main admin-menu-editor advanced-custom-fields-pro custom-post-type-ui footprint-theme-support matomo redirection safe-svg scss-library wordpress-seo wp-smushit wpvivid-backuprestore)
    
    * Theme: footprint (footprint)
    
    # Server
    
    * Server Info: Apache
    
    * Apache AddHandler support: Supported
    
    * PHP OS: Linux
    
    * PHP Version: 8.0.28
    
    * PHP SAPI: apache2handler
    
    * PHP Maxmind DB extension: Not loaded
    
    * PHP Error Reporting:  After bootstrap: 4437
    
    * Timezone: UTC
    
    * WP timezone: Europe/London
    
    * Locale: nb_NO
    
    * User Locale: nb_NO
    
    * Memory Limit: 512M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
    
    * WP Memory Limit: 40M
    
    * WP Max Memory Limit: 512M
    
    * Timezone version: 2022.6
    
    * Time: 1682624283
    
    * Max Execution Time: 3600
    
    * Max Post Size: 100M
    
    * Max Upload Size: 52428800
    
    * Max Input Vars: 10000
    
    * Disabled PHP functions: Yes (apache_child_terminate,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_setenv,disk_free_space,disk_total_space,diskfreespace,dl,exec,fastcgi_finish_request,link,opcache_compile_file,opcache_get_configuration,opcache_invalidate,opcache_is_script_cached,opcache_reset,passthru,pclose,pcntl_exec,popen,posix_getpid,posix_getppid,posix_getpwuid,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,realpath_cache_get,shell_exec,show_source,symlink,system)
    
    * zlib.output_compression is off: Yes
    
    * Curl Version: 7.74.0, OpenSSL/1.1.1n
    
    * Suhosin installed: No
    
    # PHP cli
    
    * Error PHP cli Version:  (Your PHP cli version is not compatible with the <a  target="_blank">Matomo requirements</a>. Please upgrade your PHP cli version, otherwise, you might have some archiving errors)
    
    * Error MySQLi support: missing (Your PHP cli does not load the MySQLi extension. You might have archiving problems in Matomo but also others problems in your WordPress cron tasks. You should enable this extension)
    
    # Database
    
    * MySQL Version: 5.7.41
    
    * Mysqli Connect: Yes
    
    * Force MySQL over Mysqli: No
    
    * DB Prefix: wp_
    
    * DB CHARSET: utf8
    
    * DB COLLATE: utf8_unicode_ci
    
    * SHOW ERRORS: No
    
    * SUPPRESS ERRORS: No
    
    * Uses Socket: No
    
    * Uses IPv6: No
    
    * Matomo tables found: 139
    
    * DB tables exist: Yes
    
    * Matomo users found: 9
    
    * Matomo sites found: 1
    
    * Required permissions: OK
    
    # Browser
    
    * Browser:  (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/113.0)
    
    * Language: en-gb,en

    Any help would be greatly appreciated.

    Thanks,

    Alex

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

    (@emermatomo)

    @webdevwalton It sounds like it is 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;

    Please let me know how it goes.

    Thread Starter webdevwalton

    (@webdevwalton)

    Hi @emermatomo ,

    Thanks for getting back to me.

    I’ve attempted the above, but we’re still getting issues when adding new users.

    Do you have any other suggestions?

    Thanks for your help,

    Alex

    Plugin Support emermatomo

    (@emermatomo)

    @webdevwalton can you please address the Error PHP cli Version by following the steps on this guide https://github.com/matomo-org/matomo-for-wordpress/issues/647#issuecomment-1409284712

    Once that error is fixed, please try to add a user again. If it still doesn’t work, please share to us the error showing in your debug log.

    Plugin Support emermatomo

    (@emermatomo)

    Hello @webdevwalton . Have you already had a look at our last comment or maybe any question about it?

    Thread Starter webdevwalton

    (@webdevwalton)

    Hi there,

    I added the config line:

    define( 'MATOMO_SUPPORT_ASYNC_ARCHIVING', false );

    However I’m still getting issues when attempting to create a new user, and sign in as that new user.

    Any suggestions?

    Thanks, Alex

    • This reply was modified 1 year, 10 months ago by webdevwalton.
    Plugin Support emermatomo

    (@emermatomo)

    Hi again @webdevwalton. Can you please try to disable Matomo plugin and try to create a new user to have access to your WP-admin? Please let us know if that will work. If it still not allows you to create a new user even after disabling the Matomo plugin, please reach out to your hosting service provider what’s causing the issue.

    Thread Starter webdevwalton

    (@webdevwalton)

    Hi @emermatomo ,

    I disabled the Matomo plugin, and the issue dissapeared. When I re-enable Matomo and try again, I’m hit with the same problem mentioned previously.

    Any ideas?

    Thanks,

    Alex

    Plugin Support emermatomo

    (@emermatomo)

    Can you please share to us the php error log when you are trying to create a user and got an error? There probably will be something in there that will help us identify what’s causing the issue.

    Thread Starter webdevwalton

    (@webdevwalton)

    @emermatomo Sure. Here’s the log that’s created when attempting to add a new user:

    {
    "installName": "footprintas",
    "environment": "PROD",
    "type": "error",
    "date": "2023-05-19T16:14:31.000Z",
    "severity": "notice",
    "client": "80.3.238.45:0] WordPress database error Duplicate entry '[email protected]' 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 ('wp_developer', '$2y$10$PF6KFE0zdEIAIlZ1hvTKn.EYlTuWg79gFpycN119B62gsjUQG8npq', '[email protected]', '2023-05-19 16:14:31', '0', '2023-05-19 16:14:31', NULL, NULL) /* From [footprint.no/wp-admin/user-new.php] in [/nas/content/live/footprintas/wp-content/plugins/matomo/classes/WpMatomo/Db/WordPress.php:459",
    "message": "*/ made by edit_user, wp_insert_user, WP_User->set_role, do_action('add_user_role'), WP_Hook->do_action, WP_Hook->apply_filters, WpMatomo\\User\\Sync->sync_current_users_1000, WpMatomo\\User\\Sync->sync_users, WpMatomo\\User\\Sync->ensure_user_exists, Piwik\\Plugins\\UsersManager\\Model->addUser, Piwik\\Db\\Adapter\\WordPress->insert, referer: https://footprint.no/wp-admin/user-new.php",
    "uuid": "2718a7fe-251e-4b35-ab2d-90f7cdaddba9"
    }
    • This reply was modified 1 year, 9 months ago by webdevwalton.
    Plugin Support emermatomo

    (@emermatomo)

    Hello @webdevwalton can you please confirm if:
    1. this user “[email protected]” previously had an existing account on this instance?
    2. Are you trying to recreate it?

    If you do not expect to already have an existing account for this person in you Matomo, the easiest way to solve it is to delete this account from the your Matomo DB.

    Thread Starter webdevwalton

    (@webdevwalton)

    Hi @emermatomo ,

    The?[email protected] user did not have any existing account previously. This happens for any new user that is created.

    Any ideas?

    Plugin Support emermatomo

    (@emermatomo)

    Hi again @webdevwalton based on this error “WordPress database error Duplicate entry '[email protected]' for key 'uniq_email' for query INSERT INTO wp_matomo_user” the email address already exist in the database. To fix this, you’ll have to remove this email in your database to be able to create this user. Sorry for the inconvenience if we can’t do much but that troubleshooting step should fix the issue.

    Thread Starter webdevwalton

    (@webdevwalton)

    Hi @emermatomo,

    This error occurs when attempting to create any new user, no matter if the user has previously had an account on the site or not. I’ve attempted to clear the database previously, and that didn’t resolve the issue.

    Appreciate it’s a tough one as you don’t have access to the codebase or server access ??

    Is there any more support/other suggestions we could try?

    Thank you,

    Alex

    Plugin Support emermatomo

    (@emermatomo)

    Hi @webdevwalton Sorry for the inconvenience but I have already exhausted my resources and provided all the troubleshooting steps. I have also tried to create a user in my own WordPress account and it’s working fine. What I can suggest is submit a bug report by going to this link so our team can investigate further: https://github.com/matomo-org/matomo-for-wordpress/issues

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘WordPress Critical Error – Duplicate entry’ is closed to new replies.