I found this http://gallery.menalto.com/node/32741 and I think my error might be similar. My system froze while running build thumbnails/resizes. Now when I try to build thumbnails it fails partway through. The images themselves seem to be fine. I don't have a ton on there yet and I looked through most of them. What do you suggest?
Thanks for any help.
Last Run Details:
Error (ERROR_MISSING_OBJECT)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\GalleryStorage\DatabaseStorage.class at line 378 (MySqlDatabaseStorage::error)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\GalleryStorage.class at line 118 (MySqlDatabaseStorage::loadEntities)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\helpers\GalleryEntityHelper_simple.class at line 82 (GalleryStorage::loadEntities)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\GalleryCoreApi.class at line 2186 (BuildDerivativesTask::loadEntitiesById)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\helpers\GalleryDerivativeHelper_simple.class at line 54 (BuildDerivativesTask::loadEntitiesById)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\GalleryCoreApi.class at line 830 (BuildDerivativesTask::rebuildCacheIfNotCurrent)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\BuildDerivativesTask.class at line 92 (BuildDerivativesTask::rebuildDerivativeCacheIfNotCurrent)
in C:\Inetpub\wwwroot\gallery2\modules\core\AdminMaintenance.inc at line 104 (BuildDerivativesTask::run)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\GalleryTemplateAdapter.class at line 762 (AdminMaintenanceController::runTask)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\GalleryTemplateAdapter.class at line 762
in C:\g2data\smarty\templates_c\%%3811383360\%%3A^3A8^3A818B59%%theme.tpl.php at line 75 (GalleryTemplateAdapter::trailer)
in C:\Inetpub\wwwroot\gallery2\lib\smarty\Smarty.class.php at line 1251
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\GallerySmarty.class at line 90 (GallerySmarty::fetch)
in C:\Inetpub\wwwroot\gallery2\modules\core\classes\GalleryTemplate.class at line 228 (GallerySmarty::fetch)
in C:\Inetpub\wwwroot\gallery2\main.php at line 318 (GalleryTemplate::display)
in C:\Inetpub\wwwroot\gallery2\main.php at line 87
in C:\Inetpub\wwwroot\gallery2\main.php at line 80
Gallery version = 2.0.1 core 1.0.0.1
PHP version = 5.0.4 isapi
Webserver = Microsoft-IIS/5.1
Database = mysql 4.1.15-nt
Toolkits = Exif, Thumbnail, NetPBM, ImageMagick
Operating system = Windows NT LIVINGROOM 5.1 build 2600
Browser = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Posts: 31958
i can only give you the same canned response...
enable buffered debug mode and start fixing your database entries.
FAQ: How to set/use Gallery in debug mode?
Error (ERROR_MISSING_OBJECT) : Missing object for ...
some part of your g2 database isn't 100% ok, the data integrity is a little corrupted.
reason: unknown. fix: it's not easy, but you can fix the database manually, someone else had the same problem and i gave a few instructions:
http://gallery.menalto.com/node/32741
first you gotta find out what object ID is missing, from the debug output. and then read the other topic about how to fix it.
Posts: 49
I found the debug output pointed me to item 2851. Then I followed the procedure in that thread.
mysql> select * from g2_entity where g2_Entity.g_id = 2851;
+------+---------------------+--------------+----------+------------------------
-+----------------+------------------------+------------------+
| g_id | g_creationTimestamp | g_isLinkable | g_linkId | g_modificationTimestamp
| g_serialNumber | g_entityType | g_onLoadHandlers |
+------+---------------------+--------------+----------+------------------------
-+----------------+------------------------+------------------+
| 2851 | 1130117390 | 0 | NULL | 1130130458
| 2 | GalleryDerivativeImage | NULL |
+------+---------------------+--------------+----------+------------------------
-+----------------+------------------------+------------------+
1 row in set (0.01 sec)
*********
That big select statement you had in the other thread returns the empty set for me also.
I checked each of those tables you listed for g_id = 2851 and it was missing in g2_FileSystemEntity, g2_Item, g2_DataItem, and g2_PhotoItem.
I backed up my database like you said. Then I tried this:
mysql> select * from g2_Derivative where g_derivativeSourceId = 2851;
Empty set (0.01 sec)
I tried it for a bunch of other smaller g_derivativeSourceId's that seemed reasonable and usually got the same answer. They seem scattered around when I just select *.
I could use more help from here.
Posts: 49
I did select * from g2_derivativeImage and I notice that up to item 2425, all the images are 640x480 and 150x113 or similar. Items 2425-2429 are 1536x2048 size, not right, correct? Then the next item is number 2851. It has 640x479 so that seems ok but the next one is 0x0 and then after that they alternate between 150x112 and 0x0. There is no g_id = 2851 in g2_derivative but it is in g2_derivativeImage.
2851 is not in g2_derivative, g2_fileSystemEntity, g2_item, g2_dataItem, g2_photoItem.
It is in g2_entity, g2_childEntity, g2_derivativeImage.
can I fix this by deleting certain tables like the derivative tables? Would that cause build thumbnails/resizes to start over? What of the other tables it is missing from? Should I delete the 2851 entry from every table and then try to find which photo it was and just re-upload it?
Thanks for any help.
Posts: 31958
actually, that could be fine.
either you have set a resize size to 1536x2048 or these are derivative images of type "preferred derivative" which are generated automatically for some types of images. i guess that's fine.
Posts: 49
I translated this to sql to get:
select distinct D.g_derivativeSourceId, E.g_entityType from g2_derivative D, g2_entity E, g2_childEntity C where D.g_derivativeSourceId = E.g_id and C.g_id = D.g_derivativeSourceId;
This gives the Ids and entityTypes of entries in g2_derivative that also have a corresponding entry in g2_entity and g2_childEntity.
I also just did:
select distinct g_derivativeSourceId from g2_derivative;
and they both had 636 rows as a result so this shows that for each derivative table entry, the same Id exists in the entity table and childEntity table.
Sooooo now what you say I need to do is to... for every entry I got in the first query I did, I need to check its particular entityType and depending on that, trace down the related tables checking to see if they also have this specific Id? Does that sound right?
ok, if I do this, what am I looking for? Will one of those tables be missing a row for an Id that it should have? Would it maybe just be missing a single bit of data instead of the entire row?
I can see that I have a lot of work left. There should be a tool for this
What happens when other people get this problem? Do they just zap their entire gallery? How about commercial sites? or am I just the lucky one?
Posts: 31958
no, you should identify the itemId in question easier. with activated buffered or logged debug mode, you should do the same actions required to get the error. then in the debug output, you should see which itemId or which short range of ids are candidates.
Posts: 49
ok, easier is better. The error occurs during building thumbnails/resizes in site admin. Here is a link to a copy of the build thumbnails page, and the debug output shows so see for yourself.
http://mkatich.hopto.org/debug.htm
The error output that shows up on the System Maintenance page under the plus is what I pasted in my first post above.
This line is like what was singled out in the other thread:
(mysql): SELECT g_id, g_entityType FROM g2_Entity WHERE g_id IN ('2851')
Is that it, 2851? now what? You said it was ok that it wasn't in g2_derivative. The debug output shows a long query right after the one above that has the empty set as a result since 2851 isn't in g2_derivative.
..need more help
Posts: 31958
what do you get?
also, in the derivativeImage table, what sourceId does the item 2851 have?
then look in the entity table what entity type the row with g_id = sourceId from the derivativeImage table has.
then look at the class tree and check that there's an entry in all requires tables for this id (=sourceId).
i guess the initial query doesn't even return a result. that's your problem.
look in
g2_Entity.g_id
g2_ChildEntity.g_id
g2_Derivative.g_id
g2_DerivativeImage.g_id
there must be in all of the above tables an row with g_id = 2851. in what tables is a row with this id and in what tables is it missing?
Posts: 49
Yes, the large query returns the empty set.
You lost me here. There is no sourceId column in the derivativeImage table, just g_id.
mysql> select * from g2_derivativeImage where g_id = 2851;
+------+---------+----------+
| g_id | g_width | g_height |
+------+---------+----------+
| 2851 | 640 | 479 |
+------+---------+----------+
I found the entity type above, I'll paste it here.
mysql> select g_id, g_entityType from g2_entity where g_id = 2851;
+------+------------------------+
| g_id | g_entityType |
+------+------------------------+
| 2851 | GalleryDerivativeImage |
+------+------------------------+
Aha, now you said it must be in g2_derivative. Before you said that was ok. That was throwing me.
2851 does not exist in g2_derivative as either a g_id or a g_derivativeSourceId.
It does exist in g2_entity, g2_childEntity (it says parentId is 2849), and g2_derivativeImage.
Posts: 31958
that's the problem. 2851 must exist in g2_derivative as g_id.
you can manually insert a new row in g2_derivative... the go to lib/support/ and clear the db cache. and try the maintenance task again.
Posts: 49
ok you should have told me that 7 posts ago, argh
Ok, now how can I decide what should be the inputs?
First is g_derivativeSourceId. I guess this means the g_id of the original image (if this is a photo)? In g2_childEntity, the g_parentId for g_id=2851 is 2849. Am I on the right track? 2849 is not in g2_entity much less g2_photoItem or g2_movieItem.
The other fields I need to figure out to input are g_derivativeOperations, g_derivativeOrder, g_derivativeSize, g_derivativeType, g_mimeType, g_postFilterOperations, g_isBroken. Some of those I could guess but not all. Can I just create a row for 2851 with null for the rest?
By clearing the db cache, can I just do that in the gallery interface? I don't know what lib/support/ is, maybe that's apache.
Posts: 31958
yeah, sorry for that. missed the derivative one.
- g_derivativeSourceId: must be the original of the derivative. a derivative is a thumbnail, a resized version or a prefered derivative of another image. (prefered derivatives are used for non-web viewable types as .tiff).
but how should you know which sourceId should be used. no idea.
thus my suggestion:
delete
the 2851 row from all tables.
then clear the db cache.
that should be fine.
Posts: 49
oh, I just found the cache.php and support page. I had no idea about that, pretty cool.
I deleted those rows with 2851. I cleared the cache, then ran build thumbnails/resizes again and it stuck on 1135 of 1234. There are a TON more of the same it looks like. I will work on it some more.
Thanks for the help valiant, I'll report back.
Posts: 49
Booyeah, it works.
When you run build thumbnails the second time (when it doesn't really rebuild them) it comes out with different debug output. I did that and came up with another single g_id (2854) problem again so I deleted the rows for that one, cleared the cache, and it was fixed. Build finished successfully. All seems well.
Thanks for all your help valiant. Maybe you can add this one to your canned response eh
Posts: 55
my g2_Derivative database had an error... i have not been able to use gallery for weeks.. my webhost was unable to repair the database nor even open it... I had to delete that database and i tried reinstalling a fresh version of gallery2 and reusing database... but "g2_Derivative" sdoes not exist... is there a way to manualy fix this? or do i need to reinstall with new databases? and if i do this do i have to reload all my albums over? my url is: http://www.scottnemiro.com/gallery if you want to see the debug info
Posts: 31958
scottnemiro
you're already discussing your issue in another topic. this topic here is unrelated and marked as SOLVED.
thanks for contuining your issue in your own topic.