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
Unknown column 'use_12_hour_clock' on update from 2.15.0 to 2.15.1-b2 or later #9666
Comments
There should have been a database update (as an update is defined in 2.15.1-b1). The following query should fix it. ALTER TABLE `user_language` ADD COLUMN `use_12_hour_clock` TINYINT(1) NOT NULL DEFAULT 0 AFTER `language` or ALTER TABLE `piwik_user_language` ADD COLUMN `use_12_hour_clock` TINYINT(1) NOT NULL DEFAULT 0 AFTER `language` if your database table prefix is Is there a chance that you skipped the database update or so? |
No, I select "Reuse the existing tables". Turns out that |
I inserted following in https://github.com/piwik/piwik/blob/2.16.0-rc1/core/Updater.php#L482 on 2.15.1-b2:
|
The root cause is that the LanguagesManager plugin is not recognized as "installed" in https://github.com/piwik/piwik/blob/2.16.0-rc1/core/Updater.php#L463. Adding it to https://github.com/piwik/piwik/blob/2.16.0-rc1/config/global.ini.php#L804 makes the update script in the LanguagesManager plugin work. BUT: That breaks installation on an empty DB - the The simplest solution might be reversing 07229d1. I don't know. |
I believe we fixed this in ea30714#diff-9dba5f51c7c7ac664f0bbf968dfbafa2 which should be included in 2.15.1-b2 What I think happened in this case is that it tried to install the plugin LanguagesManager on each request but always failed because the table already existed. Therefore it never got added to Before 2.15.1-b2 we always silently ignored these kinda errors so there was no chance for you to notice this. From 2.15.1-b2, if a plugin fails to install, there should now be an error message shown in the UI. I reckon we can close this issue but want to wait for feedback |
I'm not sure if this is the same issue you describe, but this issue still exists on the latest 2.16.0-rc1. This issue occurs due to the complete wipe of all Piwik files before uploading new ones (step 2 of the test procedure). Specifically, due to the included deletion of "config.ini.php". Because Piwik's list of installed Plugins is in the "config.ini.php", not in the DB. And when that file is gone - the default installed plugins list in "global.ini.php" applies. Since the LanguagesManager plugin is not one of them, its update script does not run. Neither does the The way it is, if "config.ini.php" is deleted on the update, then only plugins which are considered "installed" by default (i.e. which are in the installed plugins list in "global.ini.php") can have an own update script. And the LanguagesManager plugin is not one of them. I had been under impression that deleting "config.ini.php" is a valid action - the official way to trigger a re-installation (see https://piwik.org/faq/how-to-install/#faq_37). When done on updating Piwik though, it causes this issue. (For the first time for me, after many updates the same way.) Summarizing, I guess this is a non-issue and rather my mistake. I'm going to leave "config.ini.php" in place on future updates. The update guide (https://piwik.org/docs/update/#the-manual-three-step-update) mentions the need to back up "config.ini.php". Maybe it could specifically require that one must leave "config.ini.php" in place - that would make it clearer. (Although I hadn't checked it in years assuming that it hadn't changed in a while. So that it wouldn't have prevented this issue for me this time. But maybe for other people.) P.S.: The back-up-and-restore guide (https://piwik.org/faq/how-to-install/#faq_138) already makes clear that "config.ini.php" needs to be kept. I had thought that it's only for the DB login data (and the rest is adjusted automatically), but learned in this lesson that not just for that. So, feel free to close this. |
Actually, I understand the problem fully now and you will also see it from my answers further below. Problem is that one should not delete The LanguagesManager had
That's correct and expected behaviour. Question is: Why is the plugin not added to
Yes that should work. Only information about already installed plugins and about custom activated plugins gets lost. When updating Piwik, the
How are you doing the update? Would we be able to detect it? So far, when Update: I think we could compare version in Piwik with the version recorded in database and in case we notice someone updated the code base, we could show some kind of warning or info. We should recommend to replace the current files with the files of the installed Piwik version and then install updates afterwards. We would still need to allow users to continue this process possibly in case they want to repair their Piwik or something.
We had a discussion about moving plugins list to database a few times but one problem might be for example that someone has different plugins installed on different servers and it may lead to errors. Eg when a plugin needs to install something locally on each server but there can be also other problems. Also you might want to enable some features only on some servers of your Piwik installation. |
Added the following to #5985
|
@mattab what are your thoughts on detecting whether someone is updating Piwik and has no |
Thanks for looking into this!
Yep! :)
The update procedure is in the Test Procedure in the original post. |
if this use case is not fully supported, +1 to fail with a clear explicit error message that invites user to first restore old files, install Piwik, then update to latest. It's kinda similar to the error notification we display when the DB schema is found to be newer than the Piwik version being deployed on server. |
FYI: Another user experienced this issue here: #9708 |
Just upgraded to 2.16 today via a "replace all files except for config/config.ini.php" method and I hit this bug when trying to update my user prefs to use the 12-hour time format. So I didn't delete my prior config.ini.php file, and I did successfully update the database to 2.16 when prompted. |
Issue still exists in 2.17.1. I fixed it using @tsteur's workaround. |
Issue still exists in 3.0.2. Fixes also with @tsteur 's workaround. Is this database change missing in the updater? |
+1 |
Same error in 3.5.1 |
@GJNilsen which version did you update from? |
The latest piwik.. Btw, all visitor stats are zero. Only the live view shows the correct number of visitors. |
Just found it on 3.6.0. |
Possible solution(s) as mentionned above:
|
Thanks for your patience with this issue. We believe this has been resolved in the recent updates of Matomo. To ensure you have the fix, please update to the latest version of Matomo. If the issue persists after the update, don't hesitate to reopen this issue and let us know. Cheers! |
Issue
Following issue appears on saving any user settings (module=UsersManager&action=userSettings) after Piwik has been updated from 2.15.0 to 2.15.1-b2 or later (tested: 2.16.1-b1 and 2.16.1-rc1):
And it indeed does not exist in the
user_language
table when checked with phpMyAdmin. Onlylogin
andlanguage
are there.Test Procedure
Notes
ini_set()
disabled (related check in https://github.com/piwik/piwik/blob/2.16.0-rc1/core/testMinimumPhpVersion.php#L38-L42 needed to be commented out, as with any other Piwik version)Ideas
ADD column
in the update script? There isn't any noticeable error on the update, though.The text was updated successfully, but these errors were encountered: