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

Cannot enable plugin DeviceDetection #6746

Closed
aureq opened this issue Nov 29, 2014 · 4 comments
Closed

Cannot enable plugin DeviceDetection #6746

aureq opened this issue Nov 29, 2014 · 4 comments
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. worksforme The issue cannot be reproduced and things work as intended.

Comments

@aureq
Copy link

aureq commented Nov 29, 2014

After upgrading from 2.2.0 to 2.9.1, I tried to enable the plugin DeviceDetection.
From the UI, I got presented the upgrade page but it returned

Error trying to execute the query 'ALTER TABLE `piwik_log_visit`
                CHANGE `config_os_version` `config_os_version`  VARCHAR( 100 ) DEFAULT NULL,
                CHANGE `config_device_type` `config_device_type`  VARCHAR( 100 ) DEFAULT NULL'.
The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config_os_version' in 'piwik_log_visit'

The error appears to be related to /usr/share/piwik/plugins/DevicesDetection/Updates/1.14.php and possibly /usr/share/piwik/core/Columns/Updater.php.

Is it compulsory to upgrade one version at a time ?

Looking further at /usr/share/piwik/core/Columns/Updater.php I found the following fields missing

  • config_device_brand
  • config_device_model
  • config_os_version
  • And possible other fields

Finally, despite the UI telling me the plugin was deactivated, when I clicked Return to Piwik I got the message Well done! You have successfully activated DevicesDetection

@mattab @mnapoli if needed, happy to provide a db dump through a private channel ;-)

@aureq aureq added the Bug For errors / faults / flaws / inconsistencies etc. label Nov 29, 2014
@mattab mattab added this to the Short term milestone Dec 1, 2014
@piwik-travis-automation piwik-travis-automation added the Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. label Dec 1, 2014
@mattab
Copy link
Member

mattab commented Dec 18, 2014

Hi @aureq unfortunately nobody else reported the issue and I couldn't reproduce it. I'm closing but if anyone experiences this again please let us know!

@mattab mattab added the worksforme The issue cannot be reproduced and things work as intended. label Dec 18, 2014
@mattab mattab closed this as completed Dec 18, 2014
@akiko-pusu
Copy link

Hi, I've just updated our Piwik from 1.x to 2.10.
In my upgrade instructions I saw the same error and DeviceDetection plugin was disabled automatically.

Thanks for this issue and information, I could manage to activate this plugin.
My workaround was here:

  • Add missing two columns manually, following migration error message.
  • After that, run update (activate) plugin task.
 alter table piwik_log_visit add column config_os_version VARCHAR( 100 ) DEFAULT NULL;
 alter table piwik_log_visit add column config_device_type  VARCHAR( 100 ) DEFAULT NULL;

I hope this will be of some help.

P.S.
To run console archive script, I had to add more column.

alter table piwik_log_visit add column config_device_type  VARCHAR( 100 ) DEFAULT NULL;
alter table piwik_log_visit add column config_os_version VARCHAR( 100 ) DEFAULT NULL;

@atthakorn
Copy link

@mattab

I experienced the issue if upgrade from v1.11 to v2.11.2

Examine the SQL update script in update page, it attempts to change following columns in piwik_log_visit first before it is added.

execute first, two columns are missing so update fails
ALTER TABLE piwik_log_visit
CHANGE config_os_version config_os_version VARCHAR( 100 ) DEFAULT NULL,
CHANGE config_device_type config_device_type VARCHAR( 100 ) DEFAULT NULL;

execute later
ALTER TABLE piwik_log_visit
ADD COLUMN config_device_type TINYINT( 100 ) NULL DEFAULT NULL,
ADD COLUMN config_device_model VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
ADD COLUMN config_os_version VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
ADD COLUMN visit_total_events SMALLINT(5) UNSIGNED NOT NULL,
ADD COLUMN config_device_brand VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
ADD COLUMN user_id VARCHAR(200) NULL,
ADD COLUMN config_browser_engine VARCHAR(10) NOT NULL;

@matm
Copy link

matm commented May 26, 2015

Thanks @atthakorn for the pointers, the following worked great for me while upgrading from 2.0.3 to 2.13.0 :

mysql> delete from piwik_option where option_name like 'version_log\_%';
mysql> ALTER TABLE piwik_log_visit
    -> ADD COLUMN config_device_type TINYINT( 100 ) NULL DEFAULT NULL,
    -> ADD COLUMN config_os_version VARCHAR( 100 ) CHARACTER SET utf8 \
COLLATE utf8_general_ci NULL DEFAULT NULL,
    -> ADD COLUMN config_device_model VARCHAR( 100 ) CHARACTER SET utf8 COLLATE \
utf8_general_ci NULL DEFAULT NULL,
    -> ADD COLUMN config_device_brand VARCHAR( 100 ) CHARACTER SET utf8 COLLATE \
utf8_general_ci NULL DEFAULT NULL;

Then

./console core:clear-caches
./console core:update

Finally, reactivating the DevicesDetection plugin from Administration -> Plugins passed the update successfully.

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. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

6 participants