[SOLVED] Database Error after upgrade to Beta-1

asdf

Joined: 2005-03-11
Posts: 8
Posted: Fri, 2005-03-11 20:55

Hello,

First of all I would like to thank you for the great job you are doing. I installed your Gallery2 Alpha3 release few months ago and was happy with that since.

Now I decided to upgrade it to Beta1 but I have a little problem with it.

During the upgrade all 5 steps go well, but when I try to browse to my gallery after the upgrade I get following database error:

Database Error

An error has occurred while interacting with the database.

Back to the Gallery

Error Detail -
Error (ERROR_STORAGE_FAILURE) :

    * in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 413 (gallerystatus::error)
    * in modules/core/classes/GalleryStorage.class at line 113 (mysqldatabasestorage::loadentities)
    * in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 82 (gallerystorage::loadentities)
    * in modules/core/classes/GalleryCoreApi.class at line 2042 (galleryentityhelper_simple::loadentitiesbyid)
    * in modules/core/classes/GalleryView.class at line 328 (gallerycoreapi::loadentitiesbyid)
    * in modules/core/ShowItem.inc at line 44 (showitemview::_getitem)
    * in modules/core/classes/GalleryView.class at line 210 (showitemview::getthemename)
    * in main.php at line 286 (showitemview::doloadtemplate)
    * in main.php at line 46
    * in main.php at line 39

Sorry for my english and thanks for help in advance!

----

Gallery version: 2.0-beta-1
Webserver (with version): Apache 2.0.48
Datatabase (with version): MySQL 4.0.18
PHP version (eg 4.2.1): 4.3.4
Graphics Toolkit(s): ImageMagick 5.5.7
Operating system: Mandrake Linux 10.0
Web browser/version: Mozilla Firefox 1.0.1

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-03-12 00:56

turn on buffered debug output in config.php and retry.. look near the bottom of the debug output and find the database error.. post that here.

 
asdf

Joined: 2005-03-11
Posts: 8
Posted: Sat, 2005-03-12 05:07

Problem solved, thank you, mindless, I really appreciate your assistance.

And for anyone who has the same problem:

First the copy-pasted error message I got in debug output together with the query that caused it:

(mysql): SELECT 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, 
g2_ChildEntity.g_parentId,  g2_FileSystemEntity.g_pathComponent, 
g2_Item.g_canContainChildren,  g2_Item.g_description,  g2_Item.g_keywords,
 g2_Item.g_ownerId,  g2_Item.g_summary,  g2_Item.g_title, 
g2_Item.g_viewedSinceTimestamp,  g2_Item.g_originationTimestamp, 
g2_AlbumItem.g_layout,  g2_AlbumItem.g_theme,  g2_AlbumItem.g_orderBy, 
g2_AlbumItem.g_orderDirection FROM g2_Entity,  g2_ChildEntity, 
g2_FileSystemEntity,  g2_Item,  g2_AlbumItem WHERE g2_Entity.g_id IN (6)
AND g2_ChildEntity.g_id=g2_Entity.g_id AND
g2_FileSystemEntity.g_id=g2_Entity.g_id AND g2_Item.g_id=g2_Entity.g_id
AND g2_AlbumItem.g_id=g2_Entity.g_id   

1054: Unknown column 'g2_AlbumItem.g_theme' in 'field list'

                     
     adodb_mysql._execute(SELECT g2_Entity.g_id,
g2_Entity.g_creationTimestamp, g2_Entity....) % line  818, file: adodb.inc.php
                        adodb_mysql.execute(SELECT g2_Entity.g_id,
g2_Entity.g_creationTimestamp, g2_Entity...., Array[1]) % line  375, file: DatabaseStorage.class
                     mysqldatabasestorage.loadentities(Array[1]) % line  113, file: GalleryStorage.class
                  gallerystorage.loadentities(Array[1]) % line   82, file: GalleryEntityHelper_simple.class
               galleryentityhelper_simple.loadentitiesbyid(6) % line 2042, file: GalleryCoreApi.class


realpath(/var/www/html/gallery2/modules/core/classes/../../..)

It is so selfexplaining that even with my little knowledge of MySQL I was able to fix this by manually adding a column 'g_theme' (as well as the colums 'g_orderBy' and 'g_orderDirection') to the 'g2_AlbumItem' table (according to definitions found in modules/core/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql/GalleryAlbumItem.sql) and filling it with default values found in modules/core/CoreModuleExtras.inc.

This solved the Database Error. After that I got yet Error (ERROR_MISSING_OBJECT) message, but with help of another topic in this forum I solved that one too by flushing the cache.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-03-12 07:06

nice work, asdf, you have successfully upgraded from a G2 version before we supported upgrades :-)

 
asdf

Joined: 2005-03-11
Posts: 8
Posted: Mon, 2005-03-14 19:25

One more comment to this issue: After the "unsupported" Alpha3->Beta1 upgrade some of upgraded modules (eg. ImageMagick, Thumbnail Manager) did not work properly and it was necessary to reinstall them (=manually uninstall not just deactivate and then install them again).