Error (ERROR_STORAGE_FAILURE)

saladyears

Joined: 2005-09-17
Posts: 3
Posted: Sat, 2005-09-17 23:34

Error (ERROR_STORAGE_FAILURE)

* in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1238 (gallerystatus::error)
* in modules/core/classes/GalleryStorage.class at line 294 (mysqldatabasestorage::addmapentry)
* in modules/core/classes/interfaces/GalleryAccessSubscriberMap.inc at line 95 (gallerystorage::addmapentry)
* in modules/core/classes/GalleryEntity.class at line 272 (galleryaccesssubscribermap::addmapentry)
* in modules/core/classes/GalleryItem.class at line 409 (galleryfilesystementity::save)
* in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 225 (galleryphotoitem::save)
* in modules/core/classes/GalleryCoreApi.class at line 1499 (galleryitemhelper_medium::additemtoalbum)
* in modules/core/ItemAddFromServer.inc at line 168 (gallerycoreapi::additemtoalbum)
* in modules/core/ItemAddFromServer.inc at line 96 (itemaddfromserver::additem)
* in modules/core/ItemAdd.inc at line 94 (itemaddfromserver::handlerequest)
* in main.php at line 174 (itemaddcontroller::handlerequest)
* in main.php at line 87
* in main.php at line 80

Gallery version 2.0
PHP version 4.3.4 cgi
Webserver Apache/1.3.29 (Unix) FrontPage/5.0.2.2623
Database mysqlt 4.0.18
Toolkits ImageMagick, NetPBM, Gd
Operating system FreeBSD guernsey.globat.com 4.8-RELEASE-p13 FreeBSD 4.8-RELEASE-p13 #4: Mon i386
Browser Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

I was uploading batches of pictures to my new Gallery2 install when it just suddenly stopped working with the above error. I added some debug output statements to the PHP to figure out exactly what the error was and it was trying to do this:

INSERT INTO g2_AccessSubscriberMap (g_itemId, g_accessListId) VALUES (42, 0)

I didn't cut and paste this so the syntax might be slightly off, but the problem is that these values already exist in the table and so the query fails. I have no idea how or what causes this, but I don't know how to fix it and haven't seen anyone else say how to fix it in the searches I've done. Any ideas?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-09-18 01:17

globat.com, we've made only bad experiences with users reporting issues running g2 on globat.com. there were a number of users, most issues couldn't be resolved due to a weird webserver behavior.

i've never seen the above problem before, having g2 trying to insert duplicate keys into the accesssubscribermap.

@debugging:
you don't have to add php echo statements, g2 has a built in debugging feature.
open config.php with a texteditor, change the debugging mode from false to 'buffered'.

what value does the row in the g2 db table g2_SequenceId have?. what's the value of select max(g_id) from g2_Entity; ? or select max(g_itemId) from g2_AccessSubscriberMap; ?

 
saladyears

Joined: 2005-09-17
Posts: 3
Posted: Sun, 2005-09-18 02:24

OK, I turned on the debugging information:

mysqlt error: [1062: Duplicate entry '45' for key 1] in EXECUTE("INSERT INTO g2_AccessSubscriberMap (g_itemId, g_accessListId) VALUES (45,0)") (mysqlt): INSERT INTO g2_AccessSubscriberMap (g_itemId, g_accessListId) VALUES (45,0)

g2_SequenceID has two entries in it: 796 and 45

select max(g_id) from g2_Entity: 751
select max(g_itemId) from g2_AccessSubscriberMap: 751

It seems very odd that 796-45 = 751 since I'm assuming there should not be two entries in g2_SequenceID...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-09-18 02:55

g2_SequenceID should only have 1 id.
please delete the row with id 45.
weird stuff!
and that the sequenceId is higher than the largest entity id is also weird. but i guess that doesn't hurt. just delete the row 45.

 
Paul Sherratt

Joined: 2005-09-18
Posts: 6
Posted: Sun, 2005-09-18 12:14

I've just been having the exact same problem...

select max(g_id) from g2_Entity: 4674
select max(g_itemId) from g2_AccessSubscriberMap: 4674

And in g2_SequenceId I had two rows:
4778
102

My host is servage.net

 
saladyears

Joined: 2005-09-17
Posts: 3
Posted: Sun, 2005-09-18 13:10

I deleted the second row and now I get Internal Server Errors :P. Oh well, nothing I can debug there.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-09-18 13:33

Paul Sherratt
thanks for reporting. to fix your g2, please also delete the lower entry from your sequenceId table.

it would help us identifying the problem if you could post some information:
- phpinfo link
- a copy from site admin -> maintenance -> system information
- what action did you last take in G2? something similar to what saladyears did?

 
Paul Sherratt

Joined: 2005-09-18
Posts: 6
Posted: Sun, 2005-09-18 14:40

phpinfo: http://gallery.paults.com/phpinfo.php

system info:
Gallery version = 2.0 core 1.0.0
PHP version = 4.3.11 apache
Webserver = Servage.net Cluster (Enhanced Apache)
Database = mysqlt 4.0.25-standard
Toolkits = ArchiveUpload, Exif, Gd, SquareThumb, ImageMagick
Operating system = Linux node3.c2 2.4.20-28.8smp #1 SMP Thu Dec 18 12:25:21 EST 2003 i686

Last actions:
created a new album
deleted the album
created another album and 3 subalbums inside that
went into latest gallery remote on another computer
tried to upload some photos (which failed)

 
Paul Sherratt

Joined: 2005-09-18
Posts: 6
Posted: Sun, 2005-09-18 14:58

and another problem..

- if you move multiple items between galleries but one of them fails (because it is locked or is missing etc.), items stored on disk up until the one it failed on will be moved to the new location but not updated in the database - I guess because of a rollback transaction

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-09-18 17:29

yep, we have there only one big db transaction and are rolling it back if there's an error.
i guess you're right that we should have a transaction for each item since we can't rollback filesystem moves.

 
meow

Joined: 2006-12-19
Posts: 26
Posted: Wed, 2006-12-27 22:05

Exactly. I'm now facing that problem. I'm getting time-outs while importing about 40 albums from a G1 install (moved the /albums dir to a different server), so each album needs to be deleted before I can import it anew and hope it works..

It's taking me days, but I'm slowly getting there. :-/

Also surprised the G1>G2 migration module does not include the Sub-album structure. It simply imports all albums to the G2 albums-'root'.