[Solved] Unable to upgrade to 2.3

Sageth

Joined: 2005-10-10
Posts: 30
Posted: Sun, 2008-10-19 23:50

Trying to upgrade from 2.2.6 to 2.3. No matter what I do, it says that there aren't enough permissions to upgrade. I've recreated users and reassigned ALL PRIVILEGES to each of my users and just can't get it to work. This same user worked fine for the installation of 2.2.6, which I just did a few weeks ago.

It seems to work if I go through the regular install, but it wants me to wipe my database, which I don't want to do.

I've even tried deleting the non-G2DATA folders and reuploading the 2.3 full package. No dice. This post also seems to be similar and has some posts within the past day or so: http://gallery.menalto.com/node/77367

Any suggestions?

Here's the error on "System Checks"
System Checks
PHP Version Success
FILE Directive Success
Safe Mode Success
exec() allowed Success
set_time_limit() allowed Success
Memory limit (32Mb) Success
File uploads allowed Success
Maximum upload size (2Mb) Success
Maximum POST size (8Mb) Success
Translation support Success
Storage Directory Permissions Success
Gallery file integrity Success
Database permissions Failed
Error: The configured database user does not have the required database privileges to perform the upgrade.
Failed to create, alter or drop a database test table. Check the returned error message and README.html for missing privileges and clean up the database.


Gallery version (not just "2"): 2.2.6... trying to get to 2.3
PHP version (e.g. 5.1.6): 5.2.6
PHPInfo Link (see FAQ): http://www.sagerus.com/gallery2/phpinfo.php
Webserver (e.g. Apache 1.3.33): Apache version 2.2.9 (Unix)
Database (e.g. MySql 5.0.32): MySQL version 5.0.45-community-log
Activated toolkits (e.g. NetPbm, GD): At the moment, can't get to them
Operating system (e.g. Linux): Linux
Browser (e.g. Firefox 2.0): Firefox and IE both do the same

My site: http://www.sagerus.com

 
Sageth

Joined: 2005-10-10
Posts: 30
Posted: Mon, 2008-10-20 05:16

No one else is experiencing issues with the upgrade?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2008-10-20 05:30

> This same user worked fine for the installation of 2.2.6,

the database permissions checks in g2.2.6's installer are similar to the checks performed in the g2.3 upgrade wizard.

this is really all about the database user. we added this check because yahoo and some other webhosts don't assign CREATE, ALTER and DROP table permissions to the g2 db user by default (and create sequence, etc.).

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
leto3

Joined: 2008-10-20
Posts: 5
Posted: Mon, 2008-10-20 09:05

Hi,

I'm having the exact same problem. I granted ALL privileges on the database to gallery2 user. And I can't migrate to 2.3 : the upgrader is stuck in step 2.
"Error: The configured database user does not have the required database privileges to perform the upgrade.
Failed to create, alter or drop a database test table. Check the returned error message and README.html for missing privileges and clean up the database."

The upgrade log doesn't seem to show any error.

Regards,
Olivier

 
Sageth

Joined: 2005-10-10
Posts: 30
Posted: Mon, 2008-10-20 12:36

Thanks for the reply, valiant, but I have verified with my host that the database user/pass are set up correctly. They've even gone so far as to create a new user for me and assign rights and we still can't get through it. I'll try creating a new database later tonight when I get home from work with the same user to see where that gets me.

 
Sageth

Joined: 2005-10-10
Posts: 30
Posted: Mon, 2008-10-20 14:14

Actually, I had a chance to do this while I'm at work. I used exactly the same user and credentials on a new install and it worked perfectly. So the question remains: What's different between a fresh install and an upgrade?

I'm using a different database, but the same DB user/pass on the same server. Is there something else I should be looking at?

 
leto3

Joined: 2008-10-20
Posts: 5
Posted: Mon, 2008-10-20 17:50

I think we're having the same problem. I'm using Debian 4.0 with all its default packages (mysql 5, php5).

Actually the installer works (up to the point where it detects by reading version.dat that this is not a fresh install and wants to redirect me to the updater).
It's just the updater that seems to misread the privileges on the database.

 
NoProbs

Joined: 2007-11-18
Posts: 5
Posted: Mon, 2008-10-20 19:24

I have same issues and was going to start a new thread as requested by floridave; however issue is covered here. The only issue is that I have four gallery installations sharing one master source. The master and one other gallery upgarded without issue.

Centos 5.2
PHP 5.1.6
Apache 2.2.3
MySQL 5.0.45
Gallery 2.2.6 upgrading to 2.3

sites http://gallery.hullwyke.org.uk - OK http://gallery.hullwykeladiescircle.org.uk NOT OK

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2008-10-20 19:31

Hmm, looks like our code in the upgrade wizard doesn't properly display the actual errors. that's very unfortunate. we'll have to investigate this further.

for now, please file a bug at http://sf.net/projects/gallery/ -> trackers -> bugs.
please copy and paste the exact warning message you get from g2's upgrade wizard.

as for a solution:
let's hack your upgrade wizard to show the actual error message.

please edit the file gallery2/upgrade/steps/SystemChecksStep.class
towards the end of the file, in function _executeSql, please replace:

		$ret = $storage->execute($query, array());
		if ($ret) {
		    return array(false, _('Check the returned error message and README.html ' .
			'for missing privileges and clean up the database.'));
		}

with

		$gallery->startRecordingDebugSnippet();
		$ret = $storage->execute($query, array());
		$debugSnippet = $gallery->stopRecordingDebugSnippet();
		if ($ret) {
		    return array(false, _("Check the returned error message and README.html "
			. "for missing privileges and clean up the database. Error message: \n"
			. $debugSnippet));
		}

and then run the system checks step again.

what does it show now? (please copy and paste the exact warning / error message.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
Sageth

Joined: 2005-10-10
Posts: 30
Posted: Mon, 2008-10-20 20:16

Here's the result shown after this change. Note that is says that the schema already exists for gtst0Schema. I have both gtst0Schema and gtst1Schema in my database, each with one row. Once deleted, no problems.

Quote:
Error: The configured database user does not have the required database privileges to perform the upgrade.
Failed to create, alter or drop a database test table. Check the returned error message and README.html ' . 'for missing privileges and clean up the database. Error message: (mysqli): BEGIN mysqli error: [1050: Table 'gtst0Schema' already exists] in EXECUTE("CREATE TABLE gtst0Schema( g_name varchar(128) NOT NULL, g_major int(11) NOT NULL, g_minor int(11) NOT NULL, PRIMARY KEY(g_name) ) /*!40100 DEFAULT CHARACTER SET utf8 */") (mysqli): CREATE TABLE gtst0Schema( g_name varchar(128) NOT NULL, g_major int(11) NOT NULL, g_minor int(11) NOT NULL, PRIMARY KEY(g_name) ) /*!40100 DEFAULT CHARACTER SET utf8 */ Query: CREATE TABLE gtst0Schema( g_name varchar(128) NOT NULL, g_major int(11) NOT NULL, g_minor int(11) NOT NULL, PRIMARY KEY(g_name) ) /*!40100 DEFAULT CHARACTER SET utf8 */ failed. Table 'gtst0Schema' already exists
1050: Table 'gtst0Schema' already exists

ADOConnection._Execute(CREATE TABLE gtst0Schema(
g_name varchar(128) NOT NULL,
g_major int(11) NOT NULL,
g_minor int(11) NOT NULL,
PRIMARY KEY(g_na..., false) % line
891, file: adodb.inc.php
ADOConnection.Execute(CREATE TABLE gtst0Schema(
g_name varchar(128) NOT NULL,
g_major int(11) NOT NULL,
g_minor int(11) NOT NULL,
PRIMARY KEY(g_na..., Array[0]) % line
952, file: GalleryStorageExtras.class
GalleryStorageExtras.execute(CREATE TABLE gtst0Schema(
g_name varchar(128) NOT NULL,
g_major int(11) NOT NULL,
g_minor int(11) NOT NULL,
PRIMARY KEY(g_na..., Array[0]) % line
507, file: GalleryStorage.class
GalleryStorage.execute(CREATE TABLE gtst0Schema(
g_name varchar(128) NOT NULL,
g_major int(11) NOT NULL,
g_minor int(11) NOT NULL,
PRIMARY KEY(g_na..., Array[0]) % line
816, file: SystemChecksStep.class
SystemChecksStep._executeSql(CREATE TABLE
DB_TABLE_PREFIXSchema(
DB_COLUMN_PREFIXname varchar(128) NOT NULL,
DB_COLUMN_PREFIXmajor int(11) NOT NULL,
DB_CO..., gtst0) % line 747, file: SystemChecksStep.class

 
NoProbs

Joined: 2007-11-18
Posts: 5
Posted: Mon, 2008-10-20 19:55

Excellent thanks valiant. I have deleted table gtst0Schema from the other two galleries and installation worked fine - table did not exist in the other two galleries

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2008-10-20 19:59

looks like the bug is in the code that tests whether a table name already exists for the chosen test table name. it's checking the array keys instead of array values.
i'll verify this thesis later today / tomorrow.

could you please file a bug to track this issue?
thanks.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
Sageth

Joined: 2005-10-10
Posts: 30
Posted: Mon, 2008-10-20 20:16

Bug report submitted. Thanks, all, for your help.

 
leto3

Joined: 2008-10-20
Posts: 5
Posted: Tue, 2008-10-21 07:24

Dropping table gallery2.gtst0Schema solved it. Thanks everyone.

 
Al-Hala

Joined: 2002-11-18
Posts: 4
Posted: Fri, 2008-12-19 04:17

Dropping the gallery2.gtst0Schema table also solved it for myself. Upgrade from 2.2.4 to current.