Ticket #1331 (closed Bug: wontfix)

Opened 21 months ago

Last modified 13 months ago

Prevent all errors during auto update

Reported by: mburger Owned by: vipsoft
Priority: normal Milestone: Feature requests
Component: Core Keywords: wishlist
Cc: Sensitive: no

Description

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.

Change History

Changed 21 months ago by halfdan

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..

Changed 21 months ago by vipsoft

  • keywords wishlist added
  • status changed from new to closed
  • resolution set to wontfix
  • milestone set to 1 - Piwik 0.7 - DigitalVibes

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.)

Changed 21 months ago by mburger

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...

Changed 21 months ago by matt

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.

Changed 21 months ago by vipsoft

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

Changed 20 months ago by vipsoft

  • status changed from closed to reopened
  • resolution wontfix deleted
  • milestone changed from Piwik 0.6.1 to 0 - Piwik 0.6.3

Propose to implement the "redirect" solution.

Changed 19 months ago by vipsoft

  • owner set to vipsoft
  • status changed from reopened to new

Changed 19 months ago by matt

  • milestone changed from 0 - Piwik 0.6.5 to Features requests - after Piwik 1.0

Changed 19 months ago by matt

  • status changed from new to closed
  • resolution set to fixed

Changed 19 months ago by matt

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 19 months ago by matt

  • status changed from reopened to closed
  • resolution set to wontfix

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

Changed 19 months ago by vipsoft

  • status changed from closed to reopened
  • resolution wontfix deleted

Argh. Happened again with 0.8.

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

Changed 19 months ago by vipsoft

  • summary changed from Call to undefined method Piwik::getLoginPluginName() while upgrading from 0.5.5 to 0.6 to Auto-update errors out with "Call to undefined method"

Changed 17 months ago by shiki92

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 

Changed 17 months ago by vipsoft

  • priority changed from major to normal
  • status changed from reopened to new
  • milestone changed from Features requests 1.x or 2.x to 1.1 - Piwik 1.1

Changed 15 months ago by vipsoft

  • milestone changed from 1.1 - Piwik 1.1 to 1.2 - Piwik 1.2

Changed 14 months ago by vipsoft

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

Changed 14 months ago by vipsoft

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

Changed 13 months ago by vipsoft

[3572] refs #1331 too

Changed 13 months ago by matt

  • status changed from new to closed
  • summary changed from Auto-update errors out with "Call to undefined method" to Prevent all errors during auto update
  • resolution set to wontfix
  • milestone changed from 1.2 - Piwik 1.2 to Feature requests

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.

Changed 13 months ago by matt

  • status changed from closed to reopened
  • resolution wontfix deleted

Changed 13 months ago by matt

  • status changed from reopened to closed
  • resolution set to wontfix

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

Note: See TracTickets for help on using tickets.