Support » Plugin: SparkPost » Too many keys specified; max 64 keys allowed

  • Hello,

    I’m using your plugin in wordpress multisite, but this plugin is generating a database error in the following query:
    ALTER TABLE wp_sp_email_logs CHANGE COLUMNidid SERIAL

    Error Code: 1069
    Error Message: Too many keys specified; max 64 keys allowed.

    The Call Stack is:

    
        do_action('plugins_loaded')
        wp-includes/plugin.php:453
        WPSparkPost\SparkPost->db_update_check()
        wp-content/plugins/sparkpost/sparkpost.class.php:89
        WPSparkPost\SparkPost->install_db()
        wp-content/plugins/sparkpost/sparkpost.class.php:83
        WPSparkPost\SparkPost->install_email_log_table()
        wp-content/plugins/sparkpost/sparkpost.class.php:75
    

    I think this is happening because you’re calling the install_db function on plugins_loaded hook, and creating the table again and again.
    add_action('plugins_loaded', array($this, 'db_update_check'));

    Please resolve this issue ASAP, this is causing slowdown to my site by creating errors in huge number.

    Thanks

    • This topic was modified 1 year, 9 months ago by edugaurav.
    • This topic was modified 1 year, 9 months ago by edugaurav.
    • This topic was modified 1 year, 9 months ago by edugaurav.
    • This topic was modified 1 year, 9 months ago by edugaurav.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor rajuru

    (@rajuru)

    @edugaurav
    Can you tell me which db server you’re using and other info like engine?

    Yes that runs on load of plugin but should not create table if it already exists.

    Thanks

    Hello,

    I’m using MYSQL server with INNODB engine. And the condition which checks the db version is returning false. That’s why this is creating table again and again.

    Please do something about it.

    Thanks

    Plugin Contributor rajuru

    (@rajuru)

    @edugaurav
    This article explains about the error https://www.safaribooksonline.com/blog/2012/11/06/avoiding-too-many-keys-in-mysql/

    My understanding of the error is like:
    At first the table is created fine but the following line failed
    update_option('sp_db_version', $this->db_version);

    So, it’s trying to install the table each time. But because table already exists dbDelta tries to alter the table which is trying to create index on id column.

    We’ll investigate this more and add a solution.

    However, I guess we should also have done something in the plugin; which is not trying to install db if email logging is enabled. In that case you could just disable that option (as a temporary workaround).

    Solution path:
    – Please use older version for now
    – We’ll make a patch soon to not try to install db if email logging is not enabled
    – Fix the actual problem

    +1 Seeing the same error here. Running WP 4.9.4 and Sparkpost 3.1.0

    Also, just noticed that the error only occurs on my multisite sites, not on normal sites

    • This reply was modified 1 year, 8 months ago by . Reason: More info

    Hello,

    As @mikeharris mentioned that it’s occurring in multisite sites, I’m running a multisite too.

    For now I’ve commented out that line but please fix the issue and release the new version. I’ll update it.

    Thanks

    Plugin Contributor rajuru

    (@rajuru)

    @mikeharris @edugaurav Thanks for that info as it’ll be helpful to reproduce. We’ve released a patch which should not attempt db changes unless you’ve enabled email logging (you may still get same error if you’ve explicitly enabled it from settings page.).

    However, just wanted to point out that, it might have been just working but multisite support is not really implemented/tested. Please track this issue https://github.com/SparkPost/wordpress-sparkpost/issues/99.

    We’ll appreciate any contribution regarding multisite or any other improvements.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Too many keys specified; max 64 keys allowed’ is closed to new replies.