Been running 0.4.1 for a few days now prompted to upgrade db?


(cyberczar) #1

Received the following when logging into my Piwik site:


Database Upgrade Required

Your Piwik database is out-of-date, and must be upgraded before you can continue.

Piwik database will be upgraded from version 0.2.9 to the new version 0.4.1.

The database upgrade process may take a while, so please be patient.

Here’s the catch, everything was working fine this morning and I’ve been running 0.4.1 for a few days.

In fact, version 0.2.9 was never installed on this webhost.

I tried clicking on the Upgrade Piwik button but then received this error:


Critical Error during the update process:

Error trying to create the option table in Mysql: SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘piwik_option’ already exists

Thoughts?!


(vipsoft) #2

Piwik assumes your db version is 0.2.9 if it can’t get the version number from the piwik_option table.

Check your database hasn’t been corrupted; repair if necessary. If you run a select on your piwik_option table, you should see:

+--------------------------------------+--------------+----------+
| option_name                          | option_value | autoload |
+--------------------------------------+--------------+----------+
| version_core                         | 0.4.1        |        1 |
...

Is this problem still happening? We can add more error checking to see why that query may be failing.


(cyberczar) #3

Ok, now I’m a bit concerned. :slight_smile: Could the following be caused by me clicking on “Upgrade Piwik” when prompted?

– phpMyAdmin SQL Dump
– version 2.11.0
http://www.phpmyadmin.net

– Host: [redacted]
– Generation Time: Jun 30, 2009 at 03:43 AM
– Server version: 5.1.26
– PHP Version: 4.4.8

SET SQL_MODE=“NO_AUTO_VALUE_ON_ZERO”;


– Database: [redacted]



– Table structure for table piwik_option

CREATE TABLE piwik_option (
option_name varchar(64) NOT NULL,
option_value longtext NOT NULL,
autoload tinyint(4) NOT NULL DEFAULT ‘1’,
PRIMARY KEY (option_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


– Dumping data for table piwik_option

INSERT INTO piwik_option (option_name, option_value, autoload) VALUES
(‘version_core’, ‘0.2.9’, 1),
(‘version_CoreAdminHome’, ‘0.1’, 1),
(‘version_Login’, ‘0.1’, 1),
(‘version_UsersManager’, ‘0.1’, 1),
(‘version_SitesManager’, ‘0.1’, 1),
(‘version_Installation’, ‘0.1’, 1),
(‘UpdateCheck_LastTimeChecked’, ‘1246246981’, 1),
(‘UpdateCheck_LatestVersion’, ‘’, 0),
(‘version_CorePluginsAdmin’, ‘0.1’, 1),
(‘version_CoreHome’, ‘0.1’, 1),
(‘version_API’, ‘0.1’, 1),
(‘version_Widgetize’, ‘0.1’, 1),
(‘version_LanguagesManager’, ‘0.1’, 1),
(‘version_Actions’, ‘0.1’, 1),
(‘version_Dashboard’, ‘0.1’, 1),
(‘version_Referers’, ‘0.1’, 1),
(‘version_UserSettings’, ‘0.1’, 1),
(‘version_UserCountry’, ‘0.1’, 1),
(‘version_VisitsSummary’, ‘0.1’, 1),
(‘version_VisitFrequency’, ‘0.1’, 1),
(‘version_VisitTime’, ‘0.1’, 1),
(‘version_VisitorInterest’, ‘0.1’, 1),
(‘version_ExampleAPI’, ‘0.1’, 1),
(‘version_ExamplePlugin’, ‘0.1’, 1),
(‘version_ExampleRssWidget’, ‘0.1’, 1),
(‘version_ExampleFeedburner’, ‘0.1’, 1),
(‘version_Provider’, ‘0.1’, 1),
(‘version_Feedback’, ‘0.1’, 1),
(‘version_CoreUpdater’, ‘0.1’, 1),
(‘version_DBStats’, ‘0.1’, 1),
(‘version_Live’, ‘0.1’, 1),
(‘lastPurge_piwik_archive_blob_2009_05’, ‘1245450258’, 0),
(‘lastPurge_piwik_archive_blob_2009_06’, ‘1246185441’, 0),
(‘lastPurge_piwik_archive_blob_2009_01’, ‘1244474200’, 0);


(vipsoft) #4

I didn’t think that codepath existed…

Try setting version_core to 0.4.1 manually.


(cyberczar) #5

[quote=vipsoft @ Jun 30 2009, 11:16 AM]I didn’t think that codepath existed…

Try setting version_core to 0.4.1 manually.[/quote]

That seemed to have done the trick, and there doesn’t appear to be any data loss.

That was wild!

I wonder what, why, or how that field could have gotten changed?

Anyways, it appears to be working now.

Excellent, and thanks a bunch!