• Resolved sitenoob247

    (@sitenoob247)


    Site looks good so far, BUT:
    after updated Mailpoet to 5.2.2 (my WP version is 6.2.2) these error messages are on my dashboard
    (I’m also not able to see settings or email or forms etc. after clicking them):

    MailPoet error: MailPoet\Doctrine\WPDB\Exceptions\QueryException: Duplicate entry ‘0’ for key ‘PRIMARY’ in /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Doctrine/WPDB/Connection.php:132
    Stack trace:
    #0 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Doctrine/WPDB/Connection.php(123): MailPoet\Doctrine\WPDB\Connection->handleQueryError()
    #1 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Doctrine/WPDB/Connection.php(35): MailPoet\Doctrine\WPDB\Connection->runQuery()
    #2 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Doctrine/WPDB/Statement.php(71): MailPoet\Doctrine\WPDB\Connection->query()
    #3 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Connection.php(471): MailPoet\Doctrine\WPDB\Statement->execute()
    #4 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Populator.php(532): MailPoetVendor\Doctrine\DBAL\Connection->executeStatement()
    #5 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Populator.php(169): MailPoet\Config\Populator->populateNewsletterOptionFields()
    #6 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Activator.php(80): MailPoet\Config\Populator->up()
    #7 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Activator.php(60): MailPoet\Config\Activator->processActivate()
    #8 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Initializer.php(431): MailPoet\Config\Activator->activate()
    #9 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-includes/class-wp-hook.php(324): MailPoet\Config\Initializer->maybeRunActivator()
    #10 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #11 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-includes/plugin.php(517): WP_Hook->do_action()
    #12 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-settings.php(700): do_action()
    #13 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-config.php(88): require_once(‘…’)
    #14 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-load.php(50): require_once(‘…’)
    #15 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-admin/admin.php(34): require_once(‘…’)
    #16 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-admin/index.php(10): require_once(‘…’)
    #17 {main}

    Next MailPoetVendor\Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing a query: Duplicate entry ‘0’ for key ‘PRIMARY’ in /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:48
    Stack trace:
    #0 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Connection.php(821): MailPoetVendor\Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()
    #1 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Connection.php(793): MailPoetVendor\Doctrine\DBAL\Connection->handleDriverException()
    #2 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Connection.php(475): MailPoetVendor\Doctrine\DBAL\Connection->convertExceptionDuringQuery()
    #3 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Populator.php(532): MailPoetVendor\Doctrine\DBAL\Connection->executeStatement()
    #4 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Populator.php(169): MailPoet\Config\Populator->populateNewsletterOptionFields()
    #5 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Activator.php(80): MailPoet\Config\Populator->up()
    #6 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Activator.php(60): MailPoet\Config\Activator->processActivate()
    #7 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-content/plugins/mailpoet/lib/Config/Initializer.php(431): MailPoet\Config\Activator->activate()
    #8 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-includes/class-wp-hook.php(324): MailPoet\Config\Initializer->maybeRunActivator()
    #9 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #10 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-includes/plugin.php(517): WP_Hook->do_action()
    #11 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-settings.php(700): do_action()
    #12 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-config.php(88): require_once(‘…’)
    #13 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-load.php(50): require_once(‘…’)
    #14 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-admin/admin.php(34): require_once(‘…’)
    #15 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-admin/index.php(10): require_once(‘…’)
    #16 {main}

    Any ideas, what to do? Can I repair the database perhaps?
    Thx

Viewing 15 replies - 16 through 30 (of 43 total)
  • Thread Starter sitenoob247

    (@sitenoob247)

    5.3.1 not working for me…same error messages in Dashboard, Plugin not accessible.
    Re-installed 5.2.1 via FTP, works, no errors on dashboard.

    Plugin Support Ojoma a11n

    (@geraltrivia)

    Hello there @sitenoob247 ,

    Thank you for getting back to us.

    Have you tried to run a plugin conflict?: https://kb.mailpoet.com/article/258-re-installing-updating-the-plugin-via-ftp

    Looking forward to hearing back from you.

    Thread Starter sitenoob247

    (@sitenoob247)

    I have done this for updating already before, when I tested 5.1.0, 5.1.1, 5.2.0, 5.2.1 and 5.2.2.
    Deleted old folder, copied new folder via ftp and re-activated the plugin.
    Every version above 5.2.1 creates the above mentioned errors / plugin isn’t accessible.

    exatechgroup

    (@exatechgroup)

    And it’s back with the latest version…

    Thread Starter sitenoob247

    (@sitenoob247)

    Same for me, tried 5.3.3 (Update via FTP + re-activating),
    NOT working, same errors in WP dashboard as in my first post.
    Had to fall back again to 5.2.1, that is working fine.

    Plugin Support Lynn J.a11n

    (@lynnjat7)

    Hi there @sitenoob247 and @exatechgroup ,

    From these errors, it looks as though your database tables have become corrupted somehow. A key field either contains duplicates, or is not configured properly and is not updating properly.

    This is a tough issue to fix. Here are two things you can try, but note that both of these involve invasive database interactions, so it is CRITICAL to have a full backup of the site and its database before attempting anything here. It is an even better idea to create a staging site to test this out on before trying it on the live site.

    First thing you can do, if you don’t have too much data that needs to be preserved in MailPoet, is a full wipe of the plugin and a re-install from scratch.

    You’d first want to export all of your subscriber lists.

    Then, go under MailPoet > Settings on the “Advanced” tab and choose “Reinstall from scratch.”

    This will **wipe all database tables for MailPoet** which means you will lose all past statistics, as well as any email templates.

    Once wiped, you can then re-import your subscriber lists and start fresh. It’s a drastic solution but it will definitely work.

    Second, if you have too much data so the full wipe is not an option, then you can try to manually repair your database tables. This should only be done by people with SQL experience. You may be able to get help from your website host.

    You will need direct access to your database – most hosting packages provide this via phpMyAdmin on your hosting account.

    Find the table [wp]_mailpoet_migrations and erase all lines from that table.

    Then, download the latest MailPoet (even if it is already installed) and go under Plugins > Add New and upload the ZIP file for the latest version. If you already have it installed, it will detect this and ask if you want to replace the current version with the new version -> say yes.

    This will re-run the install and all past migrations, i.e. required database changes for past releases.

    This is not a guaranteed fix like the full wipe and re-install, but for some users, it will work.

    If anything goes wrong –> restore your backup!

    Thread Starter sitenoob247

    (@sitenoob247)

    // Hi there @sitenoob247 and @exatechgroup ,
    // From these errors, it looks as though your database tables have become corrupted somehow.

    My question: Why everything works fine until MailPoet 5.2.1???
    Database works fine with this version.
    I can setup my newsletter email, also subscribing works for the customers, all good…

    I will try your suggestions tomorrow.

    Thread Starter sitenoob247

    (@sitenoob247)

    I have tested the 2nd possible workaround, cleaned the _migration table, updated to 5.3.3,
    after that the table has been filled again, but errors on dashboard are the same, plugin not working.
    As I mentioned before: up to 5.2.1 the plugin works fine, no probs with DB etc.
    So newer versions are accessing the DB perhaps in a different manner, causing that violent DB access?

    Plugin Support Lynn J.a11n

    (@lynnjat7)

    Hi @sitenoob247,

    Thanks for trying that database edit and upgrade strategy, I’m sorry that did not clear the issue.

    I had another look at the stack trace you’ve shared here and it seems to be some kind of database connection error, but I’m not sure why this does not happen in 5.2.1, only in more recent releases.

    I’ve reached out to our development team to take a look to see if they have any suggestions on how we can repair the database properly. Please stand by, and if you don’t hear back in a few days please ping to make sure this is still in our queue.

    Thread Starter sitenoob247

    (@sitenoob247)

    I have updated to 5.3.4, not working, same errors as before.
    Again: last working version for me: 5.2.1.

    @support: thx for working on this issue! ??

    Plugin Support Ojoma a11n

    (@geraltrivia)

    Hello again @sitenoob247 ,

    Thank you for reaching out to us.

    I’m taking a look at the error you shared at the beginning of this thread and if it’s still the same error you’re seeing when updating the plugin then here is another thing you can try:

    The error suggests that there might be duplicate entries or issues in the MailPoet-related database tables. You can try to identify and remove any duplicate entries in the MailPoet tables. Be cautious with this, as directly modifying the database can lead to data loss. It’s recommended to consult a developer or use a plugin like WP-Optimize to clean up the database if you’re unsure.

    The error specifically references MailPoet\Doctrine\WPDB\Connection.php, which is part of the MailPoet plugin’s database interaction layer, but it does not directly specify the exact table where the duplicate entry is happening.

    However, based on typical MailPoet database usage, here are some tables where duplicates often occur and could be causing this issue:

    1. wp_mailpoet_newsletters
    2. wp_mailpoet_subscribers
    3. wp_mailpoet_segments
    4. wp_mailpoet_scheduled_tasks

    (Note: Replace wp_ with your database prefix, as it may vary.)

    Since the error mentions a “Duplicate entry ‘0’ for key ‘PRIMARY’,” it likely means that a new record is trying to insert an ID of 0 into a primary key column, where an existing 0 entry already exists. Primary keys should generally be unique and auto-incremented, so this could happen if there’s an inconsistency in how IDs are assigned.

    Check for Duplicate Entries with Primary Key 0:

    • In phpMyAdmin or a similar database management tool, you can run a query to look for rows with a PRIMARY or ID field set to 0.
    • For example:
    SELECT * FROM wp_mailpoet_newsletters WHERE id = 0;
    SELECT * FROM wp_mailpoet_subscribers WHERE id = 0;
    SELECT * FROM wp_mailpoet_segments WHERE id = 0;
    SELECT * FROM wp_mailpoet_scheduled_tasks WHERE id = 0;

    If you find any entries with id = 0 or another conflicting primary key value, you may need to remove or update them to avoid the conflict.

    if you do find entries and you’re unsure of what to do next, kindly send us screenshots and we will guide you further.

    Looking forward to hearing back from you.

    Still getting:

    Erreur MailPoet?:?MailPoet\Doctrine\WPDB\Exceptions\QueryException: Duplicate entry '0' for key 'PRIMARY' in /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Doctrine/WPDB/Connection.php:132
    Stack trace:
    #0 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Doctrine/WPDB/Connection.php(123): MailPoet\Doctrine\WPDB\Connection->handleQueryError()
    #1 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Doctrine/WPDB/Connection.php(35): MailPoet\Doctrine\WPDB\Connection->runQuery()
    #2 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Doctrine/WPDB/Statement.php(71): MailPoet\Doctrine\WPDB\Connection->query()
    #3 /var/www/exatech-group/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Connection.php(471): MailPoet\Doctrine\WPDB\Statement->execute()
    #4 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Populator.php(532): MailPoetVendor\Doctrine\DBAL\Connection->executeStatement()
    #5 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Populator.php(169): MailPoet\Config\Populator->populateNewsletterOptionFields()
    #6 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Activator.php(80): MailPoet\Config\Populator->up()
    #7 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Activator.php(60): MailPoet\Config\Activator->processActivate()
    #8 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Initializer.php(431): MailPoet\Config\Activator->activate()
    #9 /var/www/exatech-group/wp-includes/class-wp-hook.php(324): MailPoet\Config\Initializer->maybeRunActivator()
    #10 /var/www/exatech-group/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #11 /var/www/exatech-group/wp-includes/plugin.php(517): WP_Hook->do_action()
    #12 /var/www/exatech-group/wp-settings.php(700): do_action()
    #13 /var/www/exatech-group/wp-config.php(111): require_once('/var/www/exatec...')
    #14 /var/www/exatech-group/wp-load.php(50): require_once('/var/www/exatec...')
    #15 /var/www/exatech-group/wp-admin/admin.php(34): require_once('/var/www/exatec...')
    #16 /var/www/exatech-group/wp-admin/plugins.php(10): require_once('/var/www/exatec...')
    #17 {main}

    Next MailPoetVendor\Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing a query: Duplicate entry '0' for key 'PRIMARY' in /var/www/exatech-group/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:48
    Stack trace:
    #0 /var/www/exatech-group/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Connection.php(821): MailPoetVendor\Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()
    #1 /var/www/exatech-group/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Connection.php(793): MailPoetVendor\Doctrine\DBAL\Connection->handleDriverException()
    #2 /var/www/exatech-group/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Connection.php(475): MailPoetVendor\Doctrine\DBAL\Connection->convertExceptionDuringQuery()
    #3 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Populator.php(532): MailPoetVendor\Doctrine\DBAL\Connection->executeStatement()
    #4 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Populator.php(169): MailPoet\Config\Populator->populateNewsletterOptionFields()
    #5 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Activator.php(80): MailPoet\Config\Populator->up()
    #6 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Activator.php(60): MailPoet\Config\Activator->processActivate()
    #7 /var/www/exatech-group/wp-content/plugins/mailpoet/lib/Config/Initializer.php(431): MailPoet\Config\Activator->activate()
    #8 /var/www/exatech-group/wp-includes/class-wp-hook.php(324): MailPoet\Config\Initializer->maybeRunActivator()
    #9 /var/www/exatech-group/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #10 /var/www/exatech-group/wp-includes/plugin.php(517): WP_Hook->do_action()
    #11 /var/www/exatech-group/wp-settings.php(700): do_action()
    #12 /var/www/exatech-group/wp-config.php(111): require_once('/var/www/exatec...')
    #13 /var/www/exatech-group/wp-load.php(50): require_once('/var/www/exatec...')
    #14 /var/www/exatech-group/wp-admin/admin.php(34): require_once('/var/www/exatec...')
    #15 /var/www/exatech-group/wp-admin/plugins.php(10): require_once('/var/www/exatec...')
    #16 {main}
    Thread Starter sitenoob247

    (@sitenoob247)

    //or use a plugin like WP-Optimize to clean up the database
    used the Optimize-plugin, no changes concerning my MailPoet errors.

    //

    SELECT * FROM wp_mailpoet_newsletters WHERE id = 0;
    SELECT * FROM wp_mailpoet_subscribers WHERE id = 0;
    SELECT * FROM wp_mailpoet_segments WHERE id = 0;
    SELECT * FROM wp_mailpoet_scheduled_tasks WHERE id = 0;

    I managed this with phpmyadmin, all queries returned nothing, so no duplicate entries.
    ??

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    Thank you for the updates here. Reviewing the stack traces, I see they are going through the populateNewsletterOptionFields function, and breaking with the duplicate entry for the PRIMARY key.

    If you check your site’s database, and check the wp_mailpoet_newsletter_option table, do you see that the id column is set to Auto Increment?

    Thread Starter sitenoob247

    (@sitenoob247)

    The Line ID is NOT set to Auto Increment.
    The other lines are similar to your picture.
    I clicked on edit line “ID” and detected, that the option “A_I” is NOT selected, but I haven’t changed it yet,
    wanted to wait for your feedback.

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