Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error piwik_plugin_setting' doesn't exist after upgrade to v3 #11067

Closed
Gruenbaer opened this issue Dec 22, 2016 · 11 comments · Fixed by #11881
Closed

error piwik_plugin_setting' doesn't exist after upgrade to v3 #11067

Gruenbaer opened this issue Dec 22, 2016 · 11 comments · Fixed by #11881
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@Gruenbaer
Copy link

"SQLSTATE[42S02]: Base table or view not found: 1146 Table '[DBNAME].piwik_plugin_setting' doesn't exist"

After automatic upgrade to v3 I receive the above error, I do not know from which version I upgraded.

@tsteur
Copy link
Member

tsteur commented Dec 22, 2016

You may be able to fix this error by executing the following SQL query:

CREATE TABLE piwik_plugin_setting (
                          `plugin_name` VARCHAR(60) NOT NULL,
                          `setting_name` VARCHAR(255) NOT NULL,
                          `setting_value` LONGTEXT NOT NULL,
                          `user_login` VARCHAR(100) NOT NULL DEFAULT '',
                              INDEX(plugin_name, user_login)
                            ) ENGINE=InnoDb DEFAULT CHARSET=utf8

It should have created this table automatically during the update. Was there maybe any error shown?

@mattab mattab closed this as completed Dec 26, 2016
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Dec 26, 2016
@frlan
Copy link

frlan commented Jan 3, 2017

I have seen the same error coming from an ancient version 2.8.3 but no previous error

@FlorentCoppint
Copy link

Same error upgrading from 2.13.1 to 3.0.1.

@Mark-H
Copy link

Mark-H commented Feb 22, 2017

Same error here. After running the above SQL query, the error changed to

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database_name.piwik_site_setting' doesn't exist

No errors were shown prior to the database update step. It does seem to mention file issues, but when I tried to resolve those the setup broke, so I'm doing a manual update now.

@claytondaley
Copy link
Contributor

claytondaley commented Mar 28, 2017

+1 upgrading from 2.14.2

Looks like it blew up after 2.15.0-b12 (if that's any help)

@claytondaley
Copy link
Contributor

I believe this is simple... the upgrade 2.15.0-b16 rerences $pluginManager:

    public function doUpdate(Updater $updater)
    {
        $this->uninstallPlugin('LeftMenu');
        $this->uninstallPlugin('ZenMode');
    }

    private function uninstallPlugin($plugin)
    {
        $pluginManager = Manager::getInstance();

        if ($pluginManager->isPluginInstalled($plugin)) {
            if ($pluginManager->isPluginActivated($plugin)) {
                $pluginManager->deactivatePlugin($plugin);
            }

            $pluginManager->unloadPlugin($plugin);
            $pluginManager->uninstallPlugin($plugin);
        } else {
            $this->makeSurePluginIsRemovedFromFilesystem($plugin);
        }
    }

When the 3.x codebase attempts to run this command, it tries to use the 3.x table. Obviously, the appropriate tables (let alone entries) don't exist yet.

The "fix" is to upgrade to a late 2.x version before going to 3.x. Even 2.16.3-b2 calls activatePlugin on \Piwik\Plugin\Manager so it may be necessary to go all the way to 2.16.5 before jumping to 3.x.

@mattab
Copy link
Member

mattab commented Jun 21, 2017

When the 3.x codebase attempts to run this command, it tries to use the 3.x table. Obviously, the appropriate tables (let alone entries) don't exist yet.

OK we will need to investigate this and make sure 100% that the upgrade from 2.0 to 3.0 should work.

@mattab mattab reopened this Jun 21, 2017
@mattab mattab added this to the 3.0.5 milestone Jun 21, 2017
@mattab mattab added Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. and removed answered For when a question was asked and we referred to forum or answered it. labels Jun 21, 2017
@mattab mattab modified the milestones: Priority Backlog (Help wanted), 3.0.5 Jun 21, 2017
@claytondaley
Copy link
Contributor

Here's what I did:

  • Download and unzip Piwik 2.11.2 into a new subdomain
  • Complete the setup process with a new database
  • Start the upgrade process (I didn't resolve the file integrity issues, but have done so before and it didn't help)

I immediately was prompted with the error:

Critical Error during the update process: 
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'piwik_test.piwik_plugin_setting' doesn't exist

@claytondaley
Copy link
Contributor

I also provided a diagnosis and proposed solution in #11552 (now closed)

@mattab mattab modified the milestones: 3.0.5, Priority Backlog (Help wanted) Jun 22, 2017
@mattab
Copy link
Member

mattab commented Jun 22, 2017

Thank you very much for the steps to reproduce. I can also reproduce it now 👍 we'll investigate in the next few weeks for sure

@mattab mattab added Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. and removed Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. labels Jun 22, 2017
@sgiehl sgiehl self-assigned this Jul 19, 2017
@pcworld
Copy link

pcworld commented Dec 9, 2017

I've still had this happen when trying to upgrade from 2.4.0 to 3.2.1 by replacing the files and then accessing the index which triggers the updater.

First I got:
Mysqli prepare error: Table 'database.piwik_plugin_setting' doesn't exist

As suggested I created it manually. Then I got the same error message about piwik_plugin_setting which I then also created manually. It then stopped with
Mysqli prepare error: Unknown column 'plugin_name' in 'where clause'

The workaround from this forum post that worked was to reset the database, then upgrade to 2.17.0 and finally upgrade to 3.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants