• 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 13 replies - 31 through 43 (of 43 total)
  • Thread Starter sitenoob247

    (@sitenoob247)

    Update: I activated Auto Increment at line ID, so it looks like your pic above.
    But nothing changed, errors are the same or do I have to do something else?

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there @sitenoob247,

    Thank you for checking that —?I believe that might be what’s causing the issue. It seems the “Populator” may be trying to populate the option fields, but since the ID doesn’t auto increment it results in the duplicate 0 entries for the Primary key.

    As always, before making changes, I’d recommend first ensuring you have a full backup of the site/database, just in case. Alternatively, you could create a staging copy of the site and test there first if possible.

    After that, try switching the ID to Auto Increment, and see if you are able to update the plugin to the latest version again.

    Please let us know how that goes!

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    Apologies it looks like I missed your Update comment, and I was replying to your previous one.

    It would be worth doing another reinstall after making the Auto Increment update, just in case.

    Also, are they the exact same errors you are seeing after making the change, including the stack trace? I’m curious if there might be another table that may be missing an Auto Increment on the ID, so a different migration/populator function might be failing as well.

    Thread Starter sitenoob247

    (@sitenoob247)

    I updated also to 5.3.5, see the screenshot by phpmyadmin
    from the mentioned table to verify that it is ok:

    Here the actual errors in my dashboard:

    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(528): 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(704): do_action()
    #13 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-config.php(88): require_once('/var/www/vhosts...')
    #14 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-load.php(50): require_once('/var/www/vhosts...')
    #15 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-admin/admin.php(34): require_once('/var/www/vhosts...')
    #16 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-admin/index.php(10): require_once('/var/www/vhosts...')
    #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(528): 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(704): do_action()
    #12 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-config.php(88): require_once('/var/www/vhosts...')
    #13 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-load.php(50): require_once('/var/www/vhosts...')
    #14 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-admin/admin.php(34): require_once('/var/www/vhosts...')
    #15 /var/www/vhosts/trackdays.sina.hostkraft.de/html/trackdays/wp-admin/index.php(10): require_once('/var/www/vhosts...')
    #16 {main}

    Again my earlier asked question:
    Why the versions work including 5.2.1 without any errors? It uses the same DB as the newer version.
    With A_I activated or not…I can send newsletters, people are able to subscribe etc. etc.
    So it must be something you changed from 5.2.1 to 5.2.2 ongoing in some php-files or how the plugin is communicating with the database…
    I think your programmers have log files about the version changes etc. so it should be possible to solve the problem somehow and find out what is causing the errors.

    I need to send newsletters for black friday and for christmas etc. and I will do it with 5.2.1 but at some time WordPress will not work anymore with the old version 5.2.1 and then I have a BIG problem…

    Otherwise I need infos how to export my subscribers and my email layouts, then deleting all tables from Mailpoet with de-installing the plugin, re-installing it (that worked for a guy in another thread with almost same problems) and re-importing my exported data.

    Thread Starter sitenoob247

    (@sitenoob247)

    Didn’t hear from you concerning my previous post…
    Could it be an option to delete some issue-related tables and possibly MailPoet would then re-generate the deleted tables with correct settings during re-installing / updating the plugin?

    I too now have this issue and have emailed Paid Support to see if i can get an answer

    Can’t open newsletters to create

    An error of type E_ERROR was caused in line 43 of the file /home/ecoforceglobal/public_html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Types/ConversionException.php. Error message: Uncaught MailPoetVendor\Doctrine\DBAL\Types\ConversionException: Could not convert database value to ‘array’ as an error was triggered by the unserialization: ‘unserialize(): Error at offset 72 of 80 bytes’ in /home/ecoforceglobal/public_html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/src/Types/ConversionException.php:43

    Plugin Author Ján Miklá?

    (@neosinner)

    Hi @sitenoob247,

    Could you please share the content of wp_mailpoet_newsletter_option_fields by running this query SELECT * FROM wp_mailpoet_newsletter_option_fields (note that wp_ is default WordPress table prefix and can differ in your case)? There are no private or personal data in this table, so it’s safe to share it here. It should look something like this:

    Plugin Author Ján Miklá?

    (@neosinner)

    @sitenoob247 one other thing, could you please run

    SELECT AUTO_INCREMENT
    FROM information_schema.TABLES
    WHERE TABLE_SCHEMA = 'wordpress'
    AND TABLE_NAME = 'wp_mailpoet_newsletter_option_fields';

    to see what’s the AUTO_INCREMENT set to (wordpress is the database name, wp_mailpoet_newsletter_option_fields is table name)? It should be greater by one than the largest ID in that table. So, in my case, it’s 32 – this is the value to which the following ID will be automatically assigned. If that value is lower or not set, that will cause issues.

    Thread Starter sitenoob247

    (@sitenoob247)

    //
    SELECT AUTO_INCREMENT
    FROM information_schema.TABLES
    WHERE TABLE_SCHEMA = ‘wordpress’
    AND TABLE_NAME = ‘wp_mailpoet_newsletter_option_fields’;
    //

    MySQL returned an empty result, so no Auto_Increment set, I think…
    ——————————————————————————–
    Here the asked screenshot from your earlier post:

    Awaiting your answer and again thx for the support!! ??

    Plugin Author Ján Miklá?

    (@neosinner)

    @sitenoob247 the missing auto increment is still the issue. On every plugin activation or update, we populate missing data. In case of wp_mailpoet_newsletter_option_fields, there should be 31 rows. When adding new row, we only specify the name and newsletter_type while the rest is filled automatically. However, since the ID column is set as PRIMARY, it needs to have unique values. The uniqueness is guaranteed by using AUTO_INCREMENT, which ensures, that the ID is always bigger than the previous one.

    For some reason, the auto increment is not set on the ID column. My colleagues stated some usual reasons in previous replies (manual change, other plugins, backups, restores…), but that aside, please follow these steps, which I hope will fix that issue for you:

    1. Backup wp_mailpoet_newsletter_option_fields table, as you’ll be altering it.
    2. Deactivate MailPoet plugin.
    3. Change the ID 0 to 14 – this is only to ensure that all IDs have non-zero integer values.
      UPDATE wp_mailpoet_newsletter_option_fields SET id = 14 WHERE id = 0;
    4. Change the ID column to be auto-incremented.
      ALTER TABLE wp_mailpoet_newsletter_option_fields MODIFY id INT NOT NULL AUTO_INCREMENT;
    5. Ensure that the AUTO_INCREMENT is set to 15.
      SELECT AUTO_INCREMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'wordpress' AND TABLE_NAME = 'wp_mailpoet_newsletter_option_fields';
    6. Activate MailPoet plugin. This should run the Populator, which should insert remaining 17 options.
    7. Check wp_mailpoet_newsletter_option_fields table, that it contains 31 rows.
    Plugin Author Ján Miklá?

    (@neosinner)

    @sitenoob247 just to make sure, when checking the value of AUTO_INCREMENT in SELECT AUTO_INCREMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'wordpress' AND TABLE_NAME = 'wp_mailpoet_newsletter_option_fields';
    the 'wordpress' is the name of the database, and likely is different – so don’t forget to change it to whatever your database name is.

    Thread Starter sitenoob247

    (@sitenoob247)

    Hello @neosinner , that fixed the problem. Now the options-table contains 31 rows.
    I activated the plugin, no dashboard errors anymore. Updated it, no errors.
    The plugin is working perfect, all good now!!

    Thx for the ongoing help, don’t know why especially this special mailpoet table has deselected A_I, so the problem with missing rows and an ID=0 existed in the table…

    Again many thx also to all other peeps from support, that tried to fix the problem over the time!!
    ?? ??

    Plugin Author Ján Miklá?

    (@neosinner)

    I’m glad it worked for you, @sitenoob247. I’ve marked the thread as resolved.

    For other folks with this issue, please look at this reply – the values are specific for @sitenoob247 website, so the queries won’t work exactly for you, but steps descriptions should help with debugging and fixing the issue.

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