dominik-th / matomo-plugin-LoginOIDC

external authentication services for matomo
https://plugins.matomo.org/LoginOIDC/
GNU General Public License v3.0
41 stars 29 forks source link

Can not activate plugin, Foreign key constraint is incorrectly formed #1

Closed ldelouw closed 5 years ago

ldelouw commented 5 years ago

Hi,

When activating the plugin, I get There was a problem installing the plugin LoginOIDC:

SQLSTATE[HY000]: General error: 1005 Can't create table piwik.piwik_loginoidc_provider (errno: 150 "Foreign key constraint is incorrectly formed")

If you want to hide this message you must remove the following line under the [Plugins] entry in your 'config/config.ini.php' file to disable this plugin. Plugins[] = LoginOIDC

If this plugin has already been installed, you must add the following line under the [PluginsInstalled] entry in your 'config/config.ini.php' file: PluginsInstalled[] = LoginOIDC

Thanks,

Luc

dominik-th commented 5 years ago

Hi Luc,

any chance you are using a very old Piwik installation? In 2014 they switched the default database engine from MyISAM to InnoDB.

If your users table is still using MyISAM you might get the specified error.

You can find infos on how to update your database engine here: https://matomo.org/faq/troubleshooting/faq_25610/

Important is your piwik.piwik_user table.

Please remember to create a backup beforehand.

ldelouw commented 5 years ago

Hi,

It is indeed based on a very old installation subsequently updated. After migration to InnoDB the error disappeared.

Thanks a lot,

Luc