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

Prevent all errors during auto update #1331

Closed
anonymous-matomo-user opened this issue May 6, 2010 · 19 comments
Closed

Prevent all errors during auto update #1331

anonymous-matomo-user opened this issue May 6, 2010 · 19 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@anonymous-matomo-user
Copy link

I just upgraded two Piwik installations from 0.5.5 to 0.6 and ran into the same issue twice. During the upgrade process, a fatal error occurs:

Fatal error: Call to undefined method Piwik::getLoginPluginName() in /some/path/htdocs/core/View.php on line 129

After reloading the URL http://some.host/index.php?module=CoreUpdater&action=oneClickUpdate where that error is shown, I get the message Your Piwik version 0.6 is up to date. However, accessing http://some.host/ afterward redirects to http://some.host/index.php?module=CoreUpdater again where a Database Upgrade is required.

After doing this upgrade, Piwik seems to be updated.
Keywords: wishlist

@halfdan
Copy link
Member

halfdan commented May 6, 2010

I just got the same error. Additionally I took a look at the SQL that gets executed afterwards:

UPDATE piwik_option SET option_value = "0.6-rc1" WHERE option_name = "version_core";

Doesn't seem right to me as option_value should be set to 0.6 instead of 0.6-rc1..

@robocoder
Copy link
Contributor

halfdan: Under normal situations, Piwik bumps the version number with each each update script applied (core/Updates) and then finally, to the current version number (core/Version.php).

mburger: This error is a side-effect of the auto-update, where an out-of-date file is already loaded in memory but Piwik references new code in the updated file.

AFAIK there is no fix for this (ie to explicitly unload classes from memory). We might (?) be able to mitigate this by:

  • immediately (or soon) after copying the new files to their destination, we force a redirect (ie php closes the session and releases resources)

(That's an oversimplification. The risk here is that the changes to CoreUpdater experiences the same underlying problem as reported in this ticket.)

@anonymous-matomo-user
Copy link
Author

I think you should provide a proper warning / error message, at least. Currently, there is no chance I could figure out whether the shown error message indicates a major issue or it is just a cosmetic issue.

Just My 2 Cents...

@mattab
Copy link
Member

mattab commented May 6, 2010

I think the redirect solution might work. After the files are overwritten, we issue 302 redirect to the coreUpdater with a parameter done=1 and it displays the messages. If an error occurs before the files are copied over (or when the files are copied over), we don't redirect.

@robocoder
Copy link
Contributor

If we could, then yes, I agree a warning would be nice. In this case, it's a non-catchable fatal error.

@robocoder
Copy link
Contributor

Propose to implement the "redirect" solution.

@mattab
Copy link
Member

mattab commented Jul 29, 2010

such a small issue, we can implement such change if it happens again in the future.

@robocoder
Copy link
Contributor

Argh. Happened again with 0.8.

Fatal error: Call to undefined function _glob() in /path/to/piwik/core/AssetManager.php on line 371

@anonymous-matomo-user
Copy link
Author

And it happened again in 1.0.

Fatal error: Call to undefined method Piwik_Updater::getComponentsWithNewVersion() in /var/www/piwik/plugins/CoreUpdater/CoreUpdater.php on line 61 

@robocoder
Copy link
Contributor

(In [3398]) refs #1331 - temporary workaround

@robocoder
Copy link
Contributor

(In [3459]) refs #1331, refs #1897

@robocoder
Copy link
Contributor

[3572] refs #1331 too

@mattab
Copy link
Member

mattab commented Jan 5, 2011

The webtest now catches the errors and we will fix them to prevent any bad update experience.

if we want to implement a different update logic, maybe we can look at how wordpress does it for plugins for example.

@mattab
Copy link
Member

mattab commented Jan 17, 2011

Wont fix for now, since webtest catch all issues and they are easy to fix, but building this 'new feature' is not trivial.

@robocoder
Copy link
Contributor

(In [5955]) refs #1713, refs #1331 - workaround for auto-update

@robocoder
Copy link
Contributor

(In [5980]) refs #1713, refs #1331 - this should fix the one click update

@robocoder
Copy link
Contributor

(In [5988]) refs #1331, refs #3021 - remove #1331 hacks

@robocoder
Copy link
Contributor

(In [5991]) fixes #3021, refs #1331 - adds Piwik_View_OneClickDone

During a Piwik software update, there will be instances of old classes
loaded in memory. This is problematic as we will start to instantiate
new classes which may not be backward compatible. This class provides
a clean bridge/transition by forcing a new request.

This class needs to be self-contained, with no external dependencies.

@mattab
Copy link
Member

mattab commented Mar 8, 2012

Review/questions

  • Did you test auto-updating from 1.7.1 to trunk?
  • Did you test auto-updating from trunk to an imaginative next release?
  • Did you check that errors/warning are reported when there are some?

Thanks!

This issue was closed.
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. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

4 participants