Migration seemed to work, but now new albums are borked?

kittylemew

Joined: 2005-01-31
Posts: 17
Posted: Sat, 2005-12-31 18:50

I installed G2, made a test album, uploaded a photo and all was good in the world. I imported my old gallery and now I can't make new albums. I get this error

Error Detail -
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_advanced.class at line 464 (galleryalbumitem::save)
* in modules/core/classes/GalleryCoreApi.class at line 1475 (galleryitemhelper_advanced::createalbum)
* in modules/core/ItemAddAlbum.inc at line 75 (gallerycoreapi::createalbum)
* in main.php at line 174 (itemaddalbumcontroller::handlerequest)
* in main.php at line 87
* in main.php at line 80

Any help would be appreciated.


G2 URL (optional): kottr.com
G2 version: 2.0.2 core 1.0.0.2
G1 URL (optional):
G1 version:
G1 character set:
PHP memory limit:
--
PHP version (e.g. 4.3.11): 4.4.0 apache
PHPInfo Link (see FAQ):
Webserver (e.g. Apache 1.3.33): Apache
Database (e.g. MySql 4.0.11): mysql 4.0.24-log
Activated toolkits (e.g. NetPbm, GD): ArchiveUpload, Exif, ImageMagick, NetPBM
Operating system (e.g. Linux): FreeBSD web03.fluidhosting.com 5.4-STABLE FreeBSD 5.4-STABLE
Browser (e.g. Firefox 1.0): Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

 
kittylemew

Joined: 2005-01-31
Posts: 17
Posted: Sat, 2005-12-31 20:20

Okay, more information. It appears that when I turn URL_rewrite off I can add albums, but when it is turned on I cannot add albums. Yet all the links work when it is turned on. It appears to error out my permissions as well.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2006-01-01 06:05

please enable buffered debug mode and try again. you'll then see the actual mysql error in your debug output.
maybe also check the g2_SequenceId database table, it should only have a single row.

 
kittylemew

Joined: 2005-01-31
Posts: 17
Posted: Mon, 2006-01-02 04:38

The g2_SquenceID table only has a single row.

This is the debug file I pulled.
http://kottr.com/error.txt

Even more information, even though I get the error all the time, about 60% of the time it appears to create the folder anyway.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2006-01-02 14:43

that's the error:
mysql error: [1062: Duplicate entry '41-0-3' for key 1] in EXECUTE("INSERT INTO g2_AccessMap (g_accessListId, g_userId, g_groupId, g_permission) VALUES (41,0,3,'2147483647')") (mysql): INSERT INTO g2_AccessMap (g_accessListId, g_userId, g_groupId, g_permission) VALUES (41,0,3,'2147483647') 1062: Duplicate entry '41-0-3' for key 1

these are the relevant queries from the debug output:

(mysql): update g2_SequenceId set id=LAST_INSERT_ID(id+1);

(mysql): SELECT g2_AccessMap.g_userId, g2_AccessMap.g_groupId, g2_AccessMap.g_permission FROM g2_AccessMap WHERE g2_AccessMap.g_accessListId = 9

mysql error: [1062: Duplicate entry '41-0-3' for key 1] in EXECUTE("INSERT INTO g2_AccessMap (g_accessListId, g_userId, g_groupId, g_permission) VALUES (41,0,3,'2147483647')") (mysql): INSERT INTO g2_AccessMap (g_accessListId, g_userId, g_groupId, g_permission) VALUES (41,0,3,'2147483647')

1062: Duplicate entry '41-0-3' for key 1

so, i don't see any reason why it should fail. the only reason that it could fail would be that a row with acl id '41' was already in the database before you tried to add an item / album.
and usually the reason for that problem is that you have multiple sequence ids.

also, id 41 is very low. one would think that after you imported even only 100 items from g1 to g2 you should have a sequenceId of 300 or more.

all signs that you actually have multiple sequence ids.

please double and triple check your g2_SequenceId table. please post here the result of
SELECT * from g2_SequenceId;

 
kittylemew

Joined: 2005-01-31
Posts: 17
Posted: Mon, 2006-01-02 15:36

Ok, I'm very new to mysql, but I think I ran the query right.

After running the query, it shows 2 rows.
row1: 20494
row2: 46

It appears your initial assesement was correct (when I said it was only one row, I guess that was the structure, not the actual data).

So delete the second row?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-01-03 09:58

ok, that's quite bad actually. this means that something went wrong during your initial installation of gallery 2 (install core module step).
we can fix your current problem, but consequences of this initial problem could arise at a later time too because there might be some inconsistencies in your database now.

fix:
- delete row2 (value 46)
- change row1: new value: 21000 (i just choose a value that is a little larger than your current value)
- browse to yourGalleryUrl/lib/support/ and click on "cache" and delete the template and database/entity cache.

 
kittylemew

Joined: 2005-01-31
Posts: 17
Posted: Tue, 2006-01-03 16:38

Ok, I have done those things. The gallery will allow me to add new albums and upload photos. Is there anything I can do to advoid future problems, or am I just going to have to tough it out. I notice that when I go to the album drop down box (using when moving albums), it doesn't sort it in the order that albums are actually in, but the order in which they were imported. Is this natural or a complication of the db issues?

 
kittylemew

Joined: 2005-01-31
Posts: 17
Posted: Tue, 2006-01-03 17:59

Or should I just start over? I still have a copy of my old gallery on the server. Let me know what you think is best.