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

Some updates might not be executed in development mode #8687

Closed
tsteur opened this issue Sep 1, 2015 · 4 comments
Closed

Some updates might not be executed in development mode #8687

tsteur opened this issue Sep 1, 2015 · 4 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@tsteur
Copy link
Member

tsteur commented Sep 1, 2015

refs #8654

It looks like some updates might not be executed when being in development mode eg after switching branches. It might be because of this commit: 9037275

Quite a while ago I worked on Piwik 3.0 and since then my Piwik stored current version is 3.0.0-b1. When switching back to 2.X branch (master) the updates from there won't be executed. This is not only a problem with 3.0 branch but in general. Maybe we should remove that check again? I understand that not showing/ignoring this error, that was disabled in this commit, can save time and that it is annoying but it also costs time and can lead to an "invalid" state of Piwik and random issues. I had to execute all updates from the past manually.

@tsteur tsteur added RFC Indicates the issue is a request for comments where the author is looking for feedback. Bug For errors / faults / flaws / inconsistencies etc. and removed RFC Indicates the issue is a request for comments where the author is looking for feedback. labels Sep 1, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Sep 2, 2015

If you revert that commit it will just be back to the old behavior: Piwik will error when the DB is in a newer version. See the next lines of code: https://github.com/piwik/piwik/blob/90372750b039ce0b2150d4d6b1279fecbb245465/core/FrontController.php#L581 and this commit (along with the comments): c93d3e8

There are no DB migration scripts to move from a more recent version to an older one, the problem isn't really related to "development mode" as it applies also in production.

@tsteur
Copy link
Member Author

tsteur commented Sep 2, 2015

I think there is a problem if a branch with a higher version number doesn't contain the updates yet that are already in master or not? Removing that check would force me to change back the version number in option table.

@mattab
Copy link
Member

mattab commented Sep 20, 2015

I think there is a problem if a branch with a higher version number doesn't contain the updates yet that are already in master or not?

yes there should be a problem in this case

Removing that check would force me to change back the version number in option table.

@tsteur Could we maybe detect when this case occurs and when it happens, display a tweaked error message eg We detected that your database has a newer schema version 2.ZZ than code and that you are in development mode. You may need to run the SQL query: 'UPDATE piwik_option set option_value=2.XX WHERE option_name = 'core_version' to ensure the updates to 2.ZZ are all executed.

@mattab mattab added this to the 2.15.1 milestone Sep 20, 2015
@tsteur
Copy link
Member Author

tsteur commented Sep 21, 2015

We should be able to detect it in general as we only have to test for Development::isEnabled(). Showing the query should work as well. Maybe instead of showing the query we could also show a button "fix version" and a click on it would execute the displayed query and reload the page afterwards. Would safe even more time

@mattab mattab modified the milestones: 2.15.1, 3.0.0 Oct 20, 2015
@mattab mattab closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2023
@sgiehl sgiehl added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Dec 11, 2023
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. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

4 participants