Upgradin Error From G2.2 to 2.3

ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Thu, 2007-09-06 14:52

HEllo,

My site is hosted by dreamhost and they offer an automatic upgrade whenever a new version is released.

After I Ugraded, the normal process began as www.example.com/galeri/upgrade/index.php

In the 3rd phase of the setup I got the below module error

I have not changed anything in FTP related to the site(actually while upgrading i put the site to under maintenace through config.php but that's all), the old installation is moved to gallery.old as a backup so the new installation is (should) protecting the table names

Can anyone pls advise the reason and show the way to resolve this?

Thanks in advance
Ilker

Error (ERROR_STORAGE_FAILURE) : Error trying to run query: CREATE TABLE g2_ExternalIdMap( g_externalId varchar(128) NOT NULL, g_entityType varchar(32) NOT NULL, g_entityId int(11) NOT NULL, PRIMARY KEY(g_externalId, g_entityType) ) ENGINE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1723 (gallerycoreapi::error)
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1312 (gallerystorageextras::_executesql)
in modules/core/classes/GalleryStorage.class at line 740 (gallerystorageextras::configurestore)
in modules/core/classes/GalleryModule.class at line 146 (mysqlstorage::configurestore)
in upgrade/steps/UpgradeCoreModuleStep.class at line 85 (coremodule::installorupgrade)
in upgrade/index.php at line 185 (upgradecoremodulestep::processrequest)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-09-06 16:11

- i guess you mean gallery 2.2.3 when you say "2.3", right?
- please post your upgrade log. it's located in your g2data/ folder. please post it as forum file attachement, do _not_ paste its contents here. thanks.
if there are multiple upgrade log files, please post them all.

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Thu, 2007-09-06 16:35

Sorry you are right about the version, should have typed the complete as 2.2.2 to 2.2.3

i found 2 upgrade log files under sualtiavi.com_galeri_g2data and attached them as you have requested

Thanks for the help

Ilker

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-09-06 16:52
2007-09-06 03:09:18 [TMP_SESSION_ID_DI_NOISSES_PMT] <hr />
(mysql): CREATE TABLE g2_ExternalIdMap(
 g_externalId varchar(128) NOT NULL,
 g_entityType varchar(32) NOT NULL,
 g_entityId int(11) NOT NULL,
 PRIMARY KEY(g_externalId, g_entityType)
) ENGINE=MyISAM
/*!40100 DEFAULT CHARACTER SET utf8 */ &nbsp; 
<hr />
1050: Table 'g2_ExternalIdMap' already exists<br>

or in short: Table 'g2_ExternalIdMap' already exists

any idea why gallery thought that this table didn't exist yet?

did you do anything to your gallery database (not the gallery/ files) before trying to upgrade?

i guess your database table g2_Schema is either corrupt or missing some entries that it should have.

and FYI: your previous gallery version was 2.1.2. not 2.2.

maybe the whole issue is related to your confusion about gallery versions. i don't know dreamhost's one-click update feature. maybe it doesn't work for gallery 2.1.2.

can you please post the contents of your g2_Schema table?
SELECT g_name, g_major, g_minor from g2_Schema;

@solution:
i guess the best would be to restore your database backup, if you have one.
then we should check the state of your g2_Schema table contents and if everything's fine, attempt to upgrade again.

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Thu, 2007-09-06 16:59

Actually I wasn't planning on an upgrade today but my users told me that they cannot access the gallery when they input their passwords and have the below error message.

Than I checked and saw the new version and thought it might be a good idea to update

I haven't touched the database at all and it was all working nice uptill yesterday...

I will also put the file you requested in a short while

Ilker

Database Error
An error has occurred while interacting with the database.

The exact nature of database errors is not captured unless Gallery debug mode is enabled in config.php. Before seeking support for this error please enable buffered debug output and retry the operation. Look near the bottom of the lengthy debug output to find error details.
Back to the Gallery

Error Detail -
Error (ERROR_STORAGE_FAILURE)
in modules/core/classes/GalleryStorage.class at line 476 (gallerycoreapi::error)
in modules/core/classes/Gallery.class at line 223 (mysqlstorage::search)
in modules/core/classes/helpers/GalleryChildEntityHelper_simple.class at line 334 (gallery::search)
in modules/core/classes/helpers/GalleryChildEntityHelper_simple.class at line 117 (gallerychildentityhelper_simple::_fetchchilditemids)
in modules/core/classes/GalleryCoreApi.class at line 2477 (gallerychildentityhelper_simple::fetchchilditemids)
in modules/randomhighlight/module.inc at line 232 (gallerycoreapi::fetchchilditemids)
in modules/core/classes/GalleryEntity.class at line 491 (randomhighlightmodule::onload)
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 102 (galleryderivativeimage::onload)
in modules/core/classes/GalleryCoreApi.class at line 2382 (galleryentityhelper_simple::loadentitiesbyid)
in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 213 (gallerycoreapi::loadentitiesbyid)
in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 56 (galleryderivativehelper_medium::_loadderivatives)
in modules/core/classes/GalleryCoreApi.class at line 1015 (galleryderivativehelper_medium::fetchthumbnailsbyitemids)
in modules/core/module.inc at line 93 (gallerycoreapi::fetchthumbnailsbyitemids)
in modules/core/classes/GalleryTheme.class at line 1438 (coremodule::getitemlinks)
in themes/floatrix/theme.inc at line 89 (floatrixtheme::loadcommontemplatedata)
in modules/core/classes/GalleryTheme.class at line 916 (floatrixtheme::showalbumpage)
in modules/core/classes/GalleryView.class at line 325 (floatrixtheme::loadtemplate)
in main.php at line 386 (showitemview::doloadtemplate)
in main.php at line 87
in main.php at line 80
System Information
Gallery version 2.1.2
PHP version 4.4.7 cgi
Webserver Apache/2.0.54 (Unix) PHP/4.4.7 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
Database mysql 5.0.24a-standard-log
Toolkits Gd
Operating system Linux apu 2.6.18.1-grsec+e+f6b+gr219+opt+c4a+gr2b-grsec #1 SMP Thu Oct 19 12:50:29 PDT 2006 i686
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

Ilker

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Fri, 2007-09-07 08:03

Hello Valiant

As you requested

g_name g_major g_minor
Schema 1 0
ExternalIdMap 1 0
AccessMap 1 3
AccessSubscriberMap 1 0
AlbumItem 1 1
AnimationItem 1 0
CacheMap 1 0
ChildEntity 1 0
DataItem 1 0
Derivative 1 1
DerivativeImage 1 0
DerivativePrefsMap 1 0
DescendentCountsMap 1 0
Entity 1 2
FactoryMap 1 0
FileSystemEntity 1 0
Group 1 1
Item 1 1
ItemAttributesMap 1 0
MaintenanceMap 1 0
MimeTypeMap 1 0
MovieItem 1 0
PermissionSetMap 1 0
PhotoItem 1 0
PluginMap 1 1
PluginPackageMap 1 0
PluginParameterMap 1 3
RecoverPasswordMap 1 1
SessionMap 1 0
TkOperatnMap 1 0
TkOperatnMimeTypeMap 1 0
TkOperatnParameterMap 1 0
TkPropertyMap 1 0
TkPropertyMimeTypeMap 1 0
UnknownItem 1 0
User 1 1
UserGroupMap 1 0
Lock 1 0
Comment 1 1
CustomFieldMap 1 1
ExifPropertiesMap 1 0
Getid3PropsMap 1 0
ImageBlockCacheMap 1 1
ImageBlockDisabledMap 1 0
LinkItem 1 0
MultiLangItemMap 1 0
PermalinksMap 1 0
QuotasMap 1 1
RatingCacheMap 1 0
RatingMap 1 0
PendingUser 1 0
RssMap 1 0
ThumbnailImage 1 1
WatermarkImage 1 1

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2007-09-07 12:19

thanks.

ExternalIdMap is actually listed in your Schema table. gallery shouldn't try to create the table during an upgrade if that's the case.

are you running your gallery in Turkish / Greek? Or in another non-English locale?
there are some related php issues when it comes to string conversion methods (and we didn't have workarounds everywhere in g2.2 yet).

@solution:
i suggest we get your old gallery version (gallery 2.1.2) working again and then attempt to diagnose why it wouldn't upgrade.

can you restore your old gallery/ folder?
it looks like you don't have to restore your database at all, the upgrade stopped before it changed anything.

once your old gallery/ folder is back in place, please enable buffered debug mode:
FAQ: How to set/use Gallery in debug mode?

and then we can take a look at what's wrong.

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Sat, 2007-09-08 10:21

I have restored the previous version and deleted the upgrade from the server

Now I am back to my original error which promted me to upgrade

I cannot access my Galeri, www.sualtiavi.com/galeri as when I type the URL this is what I get

Do you have any idea why?

Database Error
An error has occurred while interacting with the database.

The exact nature of database errors is not captured unless Gallery debug mode is enabled in config.php. Before seeking support for this error please enable buffered debug output and retry the operation. Look near the bottom of the lengthy debug output to find error details.
Back to the Gallery

Error Detail -
Error (ERROR_STORAGE_FAILURE)
in modules/core/classes/GalleryStorage.class at line 476 (gallerycoreapi::error)
in modules/core/classes/Gallery.class at line 223 (mysqlstorage::search)
in modules/core/classes/helpers/GalleryChildEntityHelper_simple.class at line 334 (gallery::search)
in modules/core/classes/helpers/GalleryChildEntityHelper_simple.class at line 117 (gallerychildentityhelper_simple::_fetchchilditemids)
in modules/core/classes/GalleryCoreApi.class at line 2477 (gallerychildentityhelper_simple::fetchchilditemids)
in modules/randomhighlight/module.inc at line 232 (gallerycoreapi::fetchchilditemids)
in modules/core/classes/GalleryEntity.class at line 491 (randomhighlightmodule::onload)
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 102 (galleryderivativeimage::onload)
in modules/core/classes/GalleryCoreApi.class at line 2382 (galleryentityhelper_simple::loadentitiesbyid)
in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 213 (gallerycoreapi::loadentitiesbyid)
in modules/core/classes/helpers/GalleryDerivativeHelper_medium.class at line 56 (galleryderivativehelper_medium::_loadderivatives)
in modules/core/classes/GalleryCoreApi.class at line 1015 (galleryderivativehelper_medium::fetchthumbnailsbyitemids)
in modules/core/module.inc at line 93 (gallerycoreapi::fetchthumbnailsbyitemids)
in modules/core/classes/GalleryTheme.class at line 1438 (coremodule::getitemlinks)
in themes/floatrix/theme.inc at line 89 (floatrixtheme::loadcommontemplatedata)
in modules/core/classes/GalleryTheme.class at line 916 (floatrixtheme::showalbumpage)
in modules/core/classes/GalleryView.class at line 325 (floatrixtheme::loadtemplate)
in main.php at line 386 (showitemview::doloadtemplate)
in main.php at line 87
in main.php at line 80
System Information
Gallery version 2.1.2
PHP version 4.4.7 cgi
Webserver Apache/2.0.54 (Unix) PHP/4.4.7 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
Database mysql 5.0.24a-standard-log
Toolkits Gd
Operating system Linux apu 2.6.18.1-grsec+e+f6b+gr219+opt+c4a+gr2b-grsec #1 SMP Thu Oct 19 12:50:29 PDT 2006 i686
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; F-6.0SP2-20041109; InfoPath.1)

Ilker

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-09-08 10:53

> http://www.sualtiavi.com/galeri/main.php

that site works fine for me.

is there a specific album that doesn't work for you?

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Sat, 2007-09-08 10:57

I just tried again (with the link you type and still the same error on my previous post)

Ilker

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-09-08 11:07

please logout / clear your cookies. maybe it's related to some private album / item that the guest users can't see.

if the error is only there for logged in users, please save the page with the error as page.html or page.txt and attach it here as forum file attachement. don't paste the whole contents. attach it as file attachement.thanks.

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Sat, 2007-09-08 11:29

I cleared cookies and temp and re attempted and site came

Then I tried to login

and when I hit the login buton, the attached error message came back

Ilker

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-09-08 11:38

with debug mode enabled and set to "buffered" you'd get much more output. i need to see the debug output for an error page.

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Sat, 2007-09-08 16:41

Debug Error message attached

Ilker

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-09-08 18:36

sorry, that's not what we need. that's the smarty debug console. which is nice for debugging templates / themes, but not for database errors.
please save the page, not the popup, and attach it as forum file attachement.

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Mon, 2007-09-10 07:01

Was my misunderstanding

Now the correct debug output is attached

Ilker

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-09-10 12:37
mysql error: [1064: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax
to use near 'g2_ChildEntity LEFT JOIN g2_RatingCacheMap ON g2_ChildEntity.g_id = g2_RatingCac' at line 4] in
EXECUTE(" SELECT g2_ChildEntity.g_id , IF(g2_AlbumItem.g_id IS NULL, 1, 0), g2_RatingCacheMap.g_averageRating
FROM g2_Item, g2_AccessSubscriberMap, g2_ChildEntity LEFT JOIN g2_AlbumItem ON g2_ChildEntity.g_id = g2_AlbumItem.g_id g2_ChildEntity LEFT JOIN g2_RatingCacheMap ON g2_ChildEntity.g_id = g2_RatingCacheMap.g_itemId
WHERE g2_ChildEntity.g_parentId = 7166 AND g2_ChildEntity.g_id = g2_Item.g_id
AND g2_AccessSubscriberMap.g_itemId = g2_ChildEntity.g_id
AND g2_AccessSubscriberMap.g_accessListId IN
(10,7204,20,19336,5742,11800,70,7131,6697,76,5690,6945,5942,186,5913,5034,407,17022,5705,7321,5028,6451,5919,
5908,7124,6689,6618,6319,2737,6198,7106,6035,6471,6024,6375,6382,5991,5875,5874,4710,4971,4965,7269,4783,
11629,4749,4790,20029,11619,4784,7452,7491,7558,7649,7756,7846,8015,8114,8158,8237,11512,8342,8443,8464,
8481,12343,12019,8602,8678,8881,19710,18071,21468,18179,8974,9108,18231,9241,10955,9554,9579,21173,10887,
9648,10856,19884,10142,10160,10223,10352,20659,10425,10788,10770,13099,20783,13113,13793,13799,19260,
14086,14136,16824,14191,14682,21082,18634,15126,19713,21069,15183,18573,15432,15467,15497,15530,18278,16650,
20891,16386,16656,20155,20795,21934,21716,21658,21645,20536,21950,20364)
ORDER BY 2, g2_RatingCacheMap.g_averageRating , g2_ChildEntity.g_id
LIMIT 18446744073709551615") 

1. please deactivate the rating module. the error seems to stem from a feature of the rating module.
2. as far as i remember, this bug has been fixed in gallery 2.2. so upgrading will get rid of this specific problem.
3. you have another problem: performance. you have too many access-list ids. are you using the user-album module?

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Mon, 2007-09-10 13:17

1- How can I deactivate when I cannot login as an admin?

2- I want to upgrade to latest as you know from the beginning

3- Yes, I have user albums, I also run a PHP forum board and my members from there can ask for their image galleries and I create them one so they can share their pics in the forum

Ilker

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-09-10 13:30

> 1- How can I deactivate when I cannot login as an admin?

maybe there's something about that in the Gallery 2 FAQ.

anyhow, here's a short script that you can place into your gallery folder and then browse to it.

create a text file and name it "deactivate.php" then edit it with wordpad or another text editor.

paste the following contents into the file:

<?php

require_once(dirname(__FILE__) . '/embed.php');

/*
 * Initialize G2 (includes all necessary classes,
 * puts G2 into a state ready to process your calls)
 */
$ret = GalleryEmbed::init(array('fullInit' => true));
check($ret);

/* Here go your G2 API calls */
list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'rating');
check($ret);

list ($ret, $ignored) = $module->deactivate();
check($ret);

print "rating module successfully deactivated!";

/*
 * At the end, commit the transaction by calling ::done()
 * or all changes made above will be rolled back automatically
 */
$ret = GalleryEmbed::done();
check($ret);

function check($ret) {
    if ($ret) die($ret->getAsHtml());
}
?>

put the file into your gallery folder. browse to it with your webbrowser.

and don't forget to delete your script file from the server afterwards.

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Mon, 2007-09-10 14:52

I just can't get this working.. the script you gave creates an ASCII error

www.sualtiavi.com/galeri/deactivate.php

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/.pati/icelikkilinc/sualtiavi.com/galeri/deactivate.php on line 2

Parse error: syntax error, unexpected T_STRING in /home/.pati/icelikkilinc/sualtiavi.com/galeri/deactivate.php on line 2

Anyway my question is, if I delete whatever i have in URL of www.sualtiavi.com/galeri but keeping the database galeridb, can I than re install the latest version by using the old database?

Will that keep all my users?

Ilker

Ilker

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-09-10 15:51

i tried the script on my own g2 and it works.
maybe you made a copy/paste error?

here's the script to download:

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

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Tue, 2007-09-11 09:12

Rating module now deactivated... Thanks for that

Would you recommend to manually upgrade to latest?

Ilker

 
ilker_eko

Joined: 2006-09-30
Posts: 15
Posted: Wed, 2007-09-19 15:34

Hello again,

My upgrade still fails..

http://codex.gallery2.org/Gallery2:Upgrading

I have followed the instructions here to manually upgrade mine.

I have chosen the method of

[edit] Upgrade the Application Files
There are three ways to upgrade:

Replace all files: Download a complete replacement for your Gallery 2. This is slower, but very reliable.

and done that with minimal version.

When I started the Web based upgrader, after file integrity was a success, in the core module update it failed.
I have attached the debug output.

Can you advise what I have done wrong?

ilker

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Sun, 2008-01-27 13:51
valiant wrote:
thanks.

...

are you running your gallery in Turkish / Greek? Or in another non-English locale? there are some related php issues when it comes to string conversion methods (and we didn't have workarounds everywhere in g2.2 yet).

...

I once had that problem too when upgrading From G2.2 to 2.2.4 - our solution shortly: just choose English as language when upgrading! Might help!