[SOLVED] Stack Trace: Error (ERROR_STORAGE_FAILURE)

BF

Joined: 2005-03-30
Posts: 9
Posted: Wed, 2005-03-30 11:34

Upgrading through the 2.0 Beta Upgrader after a CVS update produces the following error message.

I've looked at:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=124537#124537
and
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=27924&highlight=error+errorstoragefailure

'test.php' produces "stdClass Object ()"

Unfortunately I have no access to php.ini so cannot set 'zend.ze1_compatibility_mode MUST == OFF', if it needs changing.

I've also flushed caches and flushed templates.

This problem has only occured today - 30/03/2005. Other CVS upgrades were OK.

BF

----
Stack Trace:
Error (ERROR_STORAGE_FAILURE) : Error trying to load /home/user/account/Gallery2/modules/core/classes/GalleryStorage/../../../../modules/core/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql/GalleryAccessMap.sql

* in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1720 (gallerystatus::error)
* in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1524 (mysqldatabasestorage::_executesqlfile)
* in modules/core/classes/GalleryStorage.class at line 338 (mysqldatabasestorage::configurestore)
* in modules/core/classes/GalleryModule.class at line 132 (gallerystorage::configurestore)
* in upgrade/steps/UpgradeCoreModuleStep.class at line 72 (coremodule::installorupgrade)
* in upgrade/index.php at line 151 (upgradecoremodulestep::processrequest)

Debug Output:

(mysql): SHOW TABLES

realpath(/home/user/account/Gallery2/modules/core/classes/../../..)
Binding text domain: modules_core ->
/home/user/account/Gallery2/modules/core/locale
file_exists(/home/user/g2data//versions.dat)
file(/home/user/g2data//versions.dat, )
file_exists(/home/user/account/Gallery2/modules/core/classes/GalleryStorage/../../../../modules/core/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql)
opendir(/home/user/account/Gallery2/modules/core/classes/GalleryStorage/../../../../modules/core/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql)
readdir(Resource id #45)
readdir(Resource id #45)
...
...lots of these...
...
readdir(Resource id #45)
closedir(Resource id #45)

(mysql): SHOW TABLES

(mysql): SELECT g_name, g_major, g_minor FROM g2_Schema

fopen(/home/user/account/Gallery2/modules/core/classes/GalleryStorage/../../../../modules/core/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql/GalleryAccessMap.sql,
r, 0)
feof(Resource id #48)
fgets(Resource id #48, 4096)
feof(Resource id #48)
fgets(Resource id #48, 4096)
feof(Resource id #48)
...
...lots of these...
...
fgets(Resource id #48, 4096)
feof(Resource id #48)
fgets(Resource id #48, 4096)
feof(Resource id #48)
fclose(Resource id #48)
mysql error: [1171: All parts of a PRIMARY KEY must be NOT NULL; If you
need NULL in a key, use UNIQUE instead] in EXECUTE("-- This file was
automatically generated from an XSL template, which is
-- why it looks so ugly. Editing it by hand would be a bad idea.
--

CREATE TABLE g2_AccessMap (
g_accessListId
int(11)

NOT NULL

,
g_userId
int(11)

,
g_groupId
int(11)

,
g_permission
int(11)

NOT NULL

,

PRIMARY KEY (g_accessListId
,
g_userId
,
g_groupId)

,

INDEX (g_accessListId)

,

INDEX (g_userId)

,

INDEX (g_groupId)

,

INDEX (g_permission)

) TYPE=MyISAM")

(mysql): -- This file was automatically generated from an XSL template,
which is
-- why it looks so ugly. Editing it by hand would be a bad idea.
--

CREATE TABLE g2_AccessMap (
g_accessListId
int(11)

NOT NULL

,
g_userId
int(11)

,
g_groupId
int(11)

,
g_permission
int(11)

NOT NULL

,

PRIMARY KEY (g_accessListId
,
g_userId
,
g_groupId)

,

INDEX (g_accessListId)

,

INDEX (g_userId)

,

INDEX (g_groupId)

,

INDEX (g_permission)

) TYPE=MyISAM

1171: All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a
key, use UNIQUE instead

adodb_mysql._execute(-- This file was
automatically generated from an XSL template, w..., false) % line 833, file: adodb.inc.php
adodb_mysql.execute(-- This file was automatically generated
from an XSL template, w...) % line
1716, file: DatabaseStorage.class
mysqldatabasestorage._executesqlfile(/home/user/account/Gallery2/modules/core/classes/GalleryS...) % line 1524, file: DatabaseStorage.class
mysqldatabasestorage.configurestore(core) % line 338, file: GalleryStorage.class
gallerystorage.configurestore(core) % line 132, file: GalleryModule.class

realpath(/home/user/account/Gallery2/modules/core/classes/../../../)

----

Gallery URL (optional):
Gallery version: 0.9.5 2.0-beta-1+
Webserver (with version): Apache/1.3.27 (Unix)
Datatabase (with version): MySQL 3.23.58
PHP version (eg 4.2.1): 4.3.10
phpinfo URL (optional):
Graphics Toolkit(s):
Operating system:
Web browser/version:
G1 version (for migration bugs):

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-03-30 16:36

that new table just went into CVS last night.. i haven't even performed this upgrade myself yet. but that does look like a bug.. try again later today from anon CVS or using tomorrow's nightly snapshot.. thanks.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-03-30 17:47

ok, fix in cvs... (you'll have to wait a few hours for anon cvs to get it)
since you were the lucky one to find this problem you may have trouble rerunning this upgrade.. what core version were you upgrading from? after your cvsup when you rerun the upgrader if it says upgrading from core module 0.9.4 or older then check your db and see if you have a non-empty g2_MimeTypeMap table.. if so, delete all rows before clicking to start the core upgrade..

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Thu, 2005-03-31 03:18

in addition to what mindless is saying you may have to delete a line that relates to g2MimeTypeMap from g2_Schema table as well...

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-03-31 03:59

no, the upgrader will skip table creation if it sees the table already exists.

 
BF

Joined: 2005-03-30
Posts: 9
Posted: Thu, 2005-03-31 08:29

Just done a CVS update and the ugrade appears to have gone OK. I didn't look at g2_MimeTypeMap table as I was on 0.9.5.

Everything appears as it was, only better :-)

versions.dat is now saying:
0.9.6
2.0-beta-1+

Cheers,
Brian

 
c4actbe
c4actbe's picture

Joined: 2004-09-01
Posts: 83
Posted: Thu, 2005-03-31 16:22

so what was the fix? which files do i need to replace? i downloaded 03-31-2005 03:36:52 AM build and have the same problem.
thanks!

upgrade: 0.9.3 -->0.9.6

it gives me an error:
(mysql): INSERT INTO 000_MimeTypeMap (000_extension, 000_mimeType,
000_viewable) VALUES ('z', 'application/x-compress', 0)
1062: Duplicate entry 'z' for key 1

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-03-31 17:18
mindless wrote:
after your cvsup when you rerun the upgrader if it says upgrading from core module 0.9.4 or older then check your db and see if you have a non-empty g2_MimeTypeMap table.. if so, delete all rows before clicking to start the core upgrade..

did you try this?

 
c4actbe
c4actbe's picture

Joined: 2004-09-01
Posts: 83
Posted: Thu, 2005-03-31 17:30

yes i did
what else i noticed:

Table GalleryAccessMap: missing entry in Schema table
Table GalleryAccessSubscriberMap: missing entry in Schema table
Table GalleryToolkitOperationMimeTypeMap: missing entry in Schema table
Table GalleryToolkitPropertyMimeTypeMap: missing entry in Schema table
mysql error: [1062: Duplicate entry 'z' for key 1] in EXECUTE("INSERT INTO
000_MimeTypeMap (000_extension, 000_mimeType, 000_viewable) VALUES
('z','application/x-compress',0)")

While "GalleryToolkitOperationMimeTypeMap "and "GalleryToolkitPropertyMimeTypeMap" were deleted by me, i've never seen first two...

Another update:
If after i got this message ( [1062: Duplicate entry 'z' for key 1]) i'd empty "_MimeTypeMap" and then try re-run updater I get Fatal error: Call to a member function on a non-object in .../modules/core/classes/Gallery.class on line 253.
Running updater one more time returns me to the same place i was [1062: Duplicate entry 'z' for key 1]

 
c4actbe
c4actbe's picture

Joined: 2004-09-01
Posts: 83
Posted: Thu, 2005-03-31 20:00

How safe (correct) to bypass installer by creating/populating
TkOperatnMimeTypeMap
TkPropertyMimeTypeMap
MimeTypeMap
In "_Schema"
as well as "_MimeTypeMap", then change 0.9.3 to 0.9.6 in g2data/versions.dat
and after logging as admin update all modules?
or i missed something?

+++
something still triggers updater...what could it be?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2005-04-01 08:54

Oops, you shouldn't have deleted the Tk tables! We can probably recover from that, though. Let's try this. Delete the following tables:

TkOperatnMimeTypeMap
TkPropertyMimeTypeMap
MimeTypeMap
AccessMap
AccessSubscriberMap

Remove their entries from the schema table, too.

Edit your PluginParameterMap and change the version for the core plugin to 0.9.3 (browse around till you find the right row there).

Edit g2data/versions.dat and change the first line to 0.9.3 .. make sure that you leave that file so that it's writeable by your webserver!

Then, browse back to the main page and it should trigger the upgrader. Do the complete upgrade; it should complete successfully.

Then, go to the Site Admin page and deactivate all your toolkit modules (ArchiveUpload, Ffmpeg, Gd, ImageMagick, NetPBM, SquareThumb, Thumbnail) and reactivate them. That should fix your Tk tables.

If that doesn't work, let us know :-)

 
rieder

Joined: 2005-06-09
Posts: 1
Posted: Thu, 2005-06-09 22:55

I tried to fix my g2 installation (after having been stupid enough to delete the AccessMap-table without having made a backup first :oops:) this way. It was partially succesful: I can now again login and access the Administration page, but unfortunately I cannot see *any* albums. I have the Beta 3 version of g2 installed.

Does anyone know how I can fix this?