"An error occurred while upgrading Gallery Core Module"

KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Sun, 2007-05-06 15:09

I'm moving data from Gallery 2.1.1 to a server with Gallery 2.2.1. I am using the Codex section on moving servers as a guide. I can't upgrade the old Gallery to 2.2.1 (which is part of the reason I'm switching hosts).

I chose to "Reuse Existing Tables" and added the old versions.dat to the new g2data folder. The install routine picked up on the version mismatch and tried to run the upgrader. Here's what I got...

Stack Trace:

Error (ERROR_STORAGE_FAILURE)

    * in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 961 (GalleryCoreApi::error)
    * in modules/core/classes/GalleryStorage.class at line 493 (GalleryStorageExtras::execute)
    * in modules/core/CoreModuleExtras.inc at line 3036 (GalleryStorage::execute)
    * in modules/core/CoreModuleExtras.inc at line 80 (CoreModuleExtras::convertCharacterSetToUtf8)
    * in modules/core/module.inc at line 433 (CoreModuleExtras::upgrade)
    * in modules/core/classes/GalleryModule.class at line 159 (CoreModule::upgrade)
    * in upgrade/steps/UpgradeCoreModuleStep.class at line 85 (GalleryModule::installOrUpgrade)
    * in upgrade/index.php at line 185 (UpgradeCoreModuleStep::processRequest) 

Debug Output: (this was many many many lines, I only included the sections with bold red highlighting)

Query: SELECT g2_User.g_userName, g2_User.g_fullName,
g2_User.g_hashedPassword, g2_User.g_email, g2_User.g_language,
g2_User.g_locked, g2_Entity.g_id, g2_Entity.g_creationTimestamp,
g2_Entity.g_isLinkable, g2_Entity.g_linkId,
g2_Entity.g_modificationTimestamp, g2_Entity.g_serialNumber,
g2_Entity.g_entityType, g2_Entity.g_onLoadHandlers FROM g2_User, g2_Entity
WHERE g2_User.g_id IN (25) AND g2_Entity.g_id=g2_User.g_id failed. Unknown
column 'g2_User.g_locked' in 'field list'

1054: Unknown column 'g2_User.g_locked' in 'field list'

                  ADOConnection._Execute(SELECT
g2_User.g_userName, g2_User.g_fullName, g2_User.g_hashedPassword,
g2_User.g_email, g2_User.g_language, g2_User.g_locked, ...) % line  870, file: adodb.inc.php
               ADOConnection.Execute(SELECT g2_User.g_userName,
g2_User.g_fullName, g2_User.g_hashedPassword, g2_User.g_email,
g2_User.g_language, g2_User.g_locked, ..., Array[1]) % line  165, file: GalleryStorageExtras.class
            GalleryStorageExtras.loadEntities(Array[1]) % line  298, file: GalleryStorage.class
         GalleryStorage.loadEntities(Array[1]) % line   71, file: GalleryEntityHelper_simple.class
      GalleryEntityHelper_simple.loadEntitiesById(25) % line 2251, file: GalleryCoreApi.class


Unable to load admin user. Using in-memory user object as fallback
GalleryModule::installOrUpgrade core module
In bootstrap mode (core module)
Configure store for core module

# # # # # #

Query: ALTER TABLE `g2_Derivative` CHANGE `g_derivativeOperations`
`g_derivativeOperations` varbinary(255) NULL, CHANGE `g_mimeType`
`g_mimeType` varbinary(128) NOT NULL, CHANGE `g_postFilterOperations`
`g_postFilterOperations` varbinary(255) NULL failed. Column 'g_mimeType'
cannot be part of FULLTEXT index

1283: Column 'g_mimeType' cannot be part of FULLTEXT index

                    
ADOConnection._Execute(ALTER TABLE
`g2_Derivative` CHANGE `g_derivativeOperations` `g_derivativeOperations`
varbinary(255) NULL, CHANGE `g_mimeType` `g..., false) % line  889, file: adodb.inc.php
                  ADOConnection.Execute(ALTER TABLE `g2_Derivative` CHANGE
`g_derivativeOperations` `g_derivativeOperations` varbinary(255) NULL,
CHANGE `g_mimeType` `g..., Array[0]) %
line  954, file: GalleryStorageExtras.class
               GalleryStorageExtras.execute(ALTER TABLE `g2_Derivative`
CHANGE `g_derivativeOperations` `g_derivativeOperations` varbinary(255)
NULL, CHANGE `g_mimeType` `g..., Array[0]) % line  493, file: GalleryStorage.class
            GalleryStorage.execute(ALTER TABLE `g2_Derivative` CHANGE
`g_derivativeOperations` `g_derivativeOperations` varbinary(255) NULL,
CHANGE `g_mimeType` `g...) % line 3036,
file: CoreModuleExtras.inc
         CoreModuleExtras.convertCharacterSetToUtf8(Object:CoreModule,
Object:StatusTemplate) % line   80,
file: CoreModuleExtras.inc


realpath(/home/intentionally/obfuscated/path/to/gallery2/modules/core/classes/../../../)
realpath(/home/intentionally/obfuscated/path/to/gallery2/)
Error: Failed to upgrade the core module, this is the error stack trace:
Error (ERROR_STORAGE_FAILURE)in
modules/core/classes/GalleryStorage/GalleryStorageExtras.class at
line 961 (GalleryCoreApi::error) 
in modules/core/classes/GalleryStorage.class at line 493
(GalleryStorageExtras::execute) 
in modules/core/CoreModuleExtras.inc at line 3036
(GalleryStorage::execute) 
in modules/core/CoreModuleExtras.inc at line 80
(CoreModuleExtras::convertCharacterSetToUtf8) 
in modules/core/module.inc at line 433
(CoreModuleExtras::upgrade) 
in modules/core/classes/GalleryModule.class at line 159
(CoreModule::upgrade) 
in upgrade/steps/UpgradeCoreModuleStep.class at line 85
(GalleryModule::installOrUpgrade) 
in upgrade/index.php at line 185
(UpgradeCoreModuleStep::processRequest) 

realpath(/home/intentionally/obfuscated/path/to/gallery2/modules/core/classes/../../../)
realpath(/home/intentionally/obfuscated/path/to/gallery2/)

Any suggestions? Thanks.


Gallery version (not just "2"): 2.1.1 and 2.2.1
PHP version (e.g. 4.3.11): 5.2.1
PHPInfo Link (see FAQ): n/a
Webserver (e.g. Apache 1.3.33): 2.0.54
Database (e.g. MySql 4.0.11): MySql 5.0.16
Activated toolkits (e.g. NetPbm, GD): GD
Browser (e.g. Firefox 1.0): Firefox 2.0.0.3

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-05-06 15:21

> 1283: Column 'g_mimeType' cannot be part of FULLTEXT index

g2 doesn't have any fulltext index.

did you change your database / indices at some point?

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

 
KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Sun, 2007-05-06 15:50

I guess it depends on what you mean by changing my database. I exported from the old host (MySql 4.0.15, Gallery 2.1.1) and imported to the new host (MySql 5.0.16, Gallery 2.2.1).

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-05-06 16:13

i guess it's about changing a column that is part of an index from varchar to varbinary.
i wonder why you got that error and thousands of other g2/mysql users didn't have any problem with this before.

 
KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Sun, 2007-05-06 16:24

Hrm. Not sure- When it comes to MySql I don't know enough to do more than import/export databases via phpMyAdmin. The exported .sql file was about 980kb, could the down- or up-load have hiccuped? Seems like that would have generated serious errors though.

Apologies, but should I be inferring steps to take from this: "it's about changing a column that is part of an index from varchar to varbinary" ??

Thanks

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-05-06 16:32

the good new is that you've got a database backup, since you're moving hosts. :)
so you can try this upgrade again and again.

i don't know why you get this error, but here's what i'd do:
1. restore your database to your backup again.
2. manually convert the tables / columns to unicode / utf8. (change the collation to utf8_general_ci)
3. start the upgrade wizard again

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

 
KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Sun, 2007-05-06 16:44

Cool, thanks, I'll try it later this afternoon. Thanks again

 
KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Mon, 2007-05-07 12:21

Well... Progress, but only to a point. The core upgrade went fine after altering all db tables and columns. The plugin upgrade snagged on a bunch of netpbm errors but I pushed through. Post-installation, all images were broken but captions and everything else were in place.

I was still getting errors when trying to activate netpbm, so GD is now activated (with no errors). Images still broken. I've run every maintenance task successfully except one: rebuild thumbs & resizes. Here's what I get:

Error (ERROR_MISSING_OBJECT) : Missing object for 1991

    * in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1887 (GalleryCoreApi::error)
    * in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 98 (GalleryStorageExtras::_identifyEntities)
    * in modules/core/classes/GalleryStorage.class at line 298 (GalleryStorageExtras::loadEntities)
    * in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 71 (GalleryStorage::loadEntities)
    * in modules/core/classes/GalleryCoreApi.class at line 2251 (GalleryEntityHelper_simple::loadEntitiesById)
    * in modules/core/classes/BuildDerivativesTask.class at line 119 (GalleryCoreApi::loadEntitiesById)
    * in modules/core/AdminMaintenance.inc at line 90 (BuildDerivativesTask::run)
    * in ??? at line 0 (AdminMaintenanceController::runTask)
    * in modules/core/classes/GalleryTemplateAdapter.class at line 915
    * in /obfuscated/path/to/g2data/smarty/templates_c/%%4089808685/%%3A^3A8^3A818B59%%theme.tpl.php at line 69 (GalleryTemplateAdapter::trailer)
    * in lib/smarty/Smarty.class.php at line 1258
    * in modules/core/classes/GallerySmarty.class at line 61 (Smarty::fetch)
    * in modules/core/classes/GalleryTemplate.class at line 209 (GallerySmarty::fetch)
    * in main.php at line 473 (GalleryTemplate::display)
    * in main.php at line 94
    * in main.php at line 83

Any ideas?

@Valiant- Thanks for the help with the database; I have just over a thousand photos, your tips helped immensely.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-05-07 13:06

looks like you have some database inconsistencies. here's the canned response for missing object errors:

DATA INTEGRITY:

Error (ERROR_MISSING_OBJECT) : Missing object for ...

some part of your g2 database isn't 100% ok, the data integrity is a little corrupted.
reason: unknown. fix: it's not easy, but you can fix the database manually, someone else had the same problem and i gave a few instructions:

http://gallery.menalto.com/node/57319#comment-209935

http://gallery.menalto.com/node/32741

http://gallery.menalto.com/node/38916

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-05-07 13:07

@images not shown:
did you uninstall the url rewrite module before moving servers?
it's explained in the move instructions.

@gd / ...:
did you uninstall all graphics toolkit modules before moving servers?
it's explained in the move instructions.

 
KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Tue, 2007-05-08 12:45
valiant wrote:
@images not shown:
did you uninstall the url rewrite module before moving servers?
it's explained in the move instructions.

Well [insert expletive here]. Nope. I remember reading that but thinking, "Gee, I don't use the rewrite module, so..."

valiant wrote:
@gd / ...:
did you uninstall all graphics toolkit modules before moving servers?
it's explained in the move instructions.

I didn't see this in the instructions; just double-checked, still don't see it. Not that it would have made a difference, I probably would have missed it just like the part about url_rewrite.

So, with me neglecting these two steps, are things still possibly salvageable (RE: the post with three links to DB instructions) or is it a lost cause? Comments and images are truly the only two things I need.

Thanks for all your help.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-05-08 12:53

> I didn't see this in the instructions; just double-checked, still don't see it.

see:
FAQ: How can I move my gallery installation from one server to another?

step 10. you can either uninstall the graphics toolkits before moving or after moving. but you need to uninstall those modules and install them again.

you can sure still fix things now.

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

 
KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Tue, 2007-05-08 20:18

Okay. I deactivated/ uninstalled/ reinstalled netpbm, GD, ImageMagick, ffmmpeg, and url_rewrite. Ran through all the maintenance tasks- same results.

So i ran

SELECT g_id, g_derivativeSourceId FROM `g2_Derivative` WHERE g_id = 1911;
SELECT g_id, g_derivativeSourceId FROM `g2_Derivative` WHERE g_derivativeSourceId = 1911;

and got:
MySQL returned an empty result set (i.e. zero rows)

I noticed in one of the other posts, you said one might have to look in other tables. So I hacked a script I found on the web used to provide SQL syntax for dropping tables (to save me the heartache of handpoking each table name), and tried using

SELECT g_id, g_derivativeSourceId FROM `g2_AccessMap` WHERE g_id = 1911;
SELECT g_id, g_derivativeSourceId FROM `g2_AccessSubscriberMap` WHERE g_id = 1911;
<snip...> the script listed all tables </snip>
SELECT g_id, g_derivativeSourceId FROM `g2_User` WHERE g_id = 1911;
SELECT g_id, g_derivativeSourceId FROM `g2_UserGroupMap` WHERE g_id = 1911;

but of course, the first table didn't have a g_id column. :( So I'm stuck again. I didn't even look first to see if each table had a g_id column; do I just want to run these two queries on any tables that have the g_id column in them?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-05-08 20:42

why are you looking for the id 1911? did you see that number in your debug output? it could be another id as well...

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

 
KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Wed, 2007-05-09 13:59
valiant wrote:
why are you looking for the id 1911? did you see that number in your debug output? it could be another id as well...

Yes, my first line is "Error (ERROR_MISSING_OBJECT) : Missing object for 1991"

I'm sorry, but I don't understand the overall concept of what those SQL commands are determining, or what to do from here.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2007-05-09 14:39

1991 or 1911 ?

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

 
KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Mon, 2007-05-14 15:14

I'm a dolt... Reran all commands using 1991 instead of 1911. Still zero results.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-05-14 15:19

according to the error (BuildDerivativesTask.class line 119 Gallery 2.2), there is a row in the g2_DataItem table with id = 1991.

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

 
KnightWolfJK
KnightWolfJK's picture

Joined: 2003-07-31
Posts: 31
Posted: Fri, 2007-07-27 14:48

It's been 2.5 months since I've posted, and I haven't been able to even look at this issue again. I never would have thought I'd abandon my photo album for 3 months, but I guess that's how it goes sometimes.

Now that I'm able to tackle this again, I wonder: Can the captions (and their corresponding filenames) be extracted from MySQL somehow? If so would it just be better to start with a fresh install of 2.2.2, and create the albums and captions again?

 
idezmax

Joined: 2007-07-23
Posts: 2
Posted: Sat, 2007-07-28 12:51

ok. thanks.

-----------------------
http://www.idezmax.com/

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2007-08-01 16:45

There are links in this discussion thread to other discussions that have instructions on how to fix database inconsistencies.
If they don't help, you can start from scratch of course.

As for captions, they're stored in the g2_Item table. You can use any mysql / SQL tool to export the information, but you'll have to write your own custom scripts if you want to use the exported data in a fresh gallery installation.

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