My Solution for Empty sequence id and ERROR_STORAGE_FAILURE Issues

nadz

Joined: 2013-09-24
Posts: 2
Posted: Tue, 2013-09-24 16:59

Hi everyone,

I have about 1500 pictures accumulated over the past 10 years which are handled by a Gallery 2.3.2 installation.

Last summer, I had many events and activities that led to me taking about 500 pictures per month.

After sorting and editing, I started to upload these.

Just before the uploads, I had moved my gallery from a BSD to a Linux server.

I checked that the new installation was fine and even uploaded 2 or 3 test photos.

However, when I really started uploading my summer photos, I got an error message from G2.

After three days of googling and analysing, I reached the following conclusions:
- Gallery2 need some diagnostic scripts =)
- Always backu =)

Now, I had two error messages: Empty sequence id and ERROR_STORAGE_FAILURE.

So, how did I fix these?

Turn on debug.
Use mysql:

SELECT * FROM `g2_ChildEntity`
ORDER BY `g_id` DESC ;

Here we see something like:
g_Id g_parentId
8553 8543
8552 8543
Note down the higher "g_Id" number.

SELECT * FROM `g2_DataItem`
ORDER BY `g_id` DESC ;
Note down the higher "g_Id" number.

SELECT * FROM `g2_Entity`
ORDER BY `g_id` DESC ;
Note down the higher "g_Id" number.

SELECT * FROM `g2_FileSystemEntity`
ORDER BY `g_id` DESC ;
Note down the higher "g_Id" number.

SELECT * FROM `g2_Item`
ORDER BY `g_id` DESC ;
Note down the higher "g_Id" number.

SELECT * FROM `g2_ItemAttributesMap`
ORDER BY `g_itemId` DESC
Note down the higher "g_Id" number.

SELECT * FROM `g2_PhotoItem`
ORDER BY `g_id` DESC ;
Note down the higher "g_Id" number.

Compare the numbers from all these queries.
These must be the same.
If not, remove all rows with HIGHER numbers until you get to a situation where the greatest number of all queries are equal.

SELECT * FROM `g2_Derivative`
ORDER BY `g_derivativeSourceId` DESC ;
Note down the higher "g_derivativeSourceId" number.

SELECT * FROM `g2_DerivativeImage`
ORDER BY `g_id` DESC ;
Note down the higher "g_Id" number.

Compare the numbers from all these queries.
These must be the same.
If not, remove all rows with HIGHER numbers until you get to a situation where the greatest number of `g2_Derivative`.`g_derivativeSourceId` is equal to the greatest number of `g2_DerivativeImage`.`g_id`.
Or vice versa =)
We just need both numbers equals.

ALSO!
That number from SELECT * FROM `g2_DerivativeImage` SORT BY `g_Id` must be equal all number from all queries from above.

If you need, try to fix permissions: open www.yourgallery.net/lib/support/index.php?chmod and fix.
After all this manipulation, the ERROR_STORAGE_FAILURE error was solved.

AND!!!
Remember your higher number from the last queries?
Assume it is "1234".

Insert it to `g2_SequenceEventLog` and to `g2_SequenceId` like this:

INSERT INTO `g2_SequenceId` (`id`) VALUES ('1234');
INSERT INTO `g2_SequenceEventLog` (`id`) VALUES ('1234');

Insert number 1235 to `g2_SequenceLock`:
INSERT INTO `g2_SequenceLock` (`id`) VALUES ('1235');

NOTE: g2_SequenceLock is the number plus one

And so I fixed the empty sequence id error.

Thats all. Everything is working well but I think that the Gallery database needs to be better documented.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2013-09-29 05:51

Hi,

Thanks for documenting the steps you took.

I edited the text a bit but must say the last part on fixing the empty sequence id was not very clear as your sql queries do not seem to be inserting and they just select.

--
dakanji.com

 
nadz

Joined: 2013-09-24
Posts: 2
Posted: Mon, 2013-09-30 15:09

Thank you!
I update topic in not-full last part of text