Hi,
I am not quite sure of the steps that lead to this failure, but after trying to upload some files using g3remote script and deleting some albums I am only getting a blank page when trying to open my gallery main page.
When looking at the gallery log file I see this appearing every time when I try to access the main page:
2010-11-09 14:34:13 -08:00 --- error: File not found:
2010-11-09 14:34:14 -08:00 --- error: @todo MISSING_MODEL item:1
#0 /var/www/g3/modules/gallery/helpers/item.php(217): model_cache_Core::get('item', 1)
#1 /var/www/g3/themes/wind/views/page.html.php(82): item_Core::root()
#2 /var/www/g3/system/libraries/View.php(318): include('/var/www/g3/the...')
#3 /var/www/g3/system/libraries/View.php(260): View_Core->load_view('/var/www/g3/the...', Array)
#4 /var/www/g3/modules/gallery/libraries/MY_View.php(69): View_Core->render(false, false, false)
#5 /var/www/g3/system/libraries/View.php(226): View->render()
#6 /var/www/g3/modules/gallery/views/kohana/error.php(40): View_Core->__toString()
#7 /var/www/g3/system/core/Kohana_Exception.php(186): include('/var/www/g3/mod...')
#8 [internal function]: Kohana_Exception_Core::handle(Object(Kohana_404_Exception))
#9 {main}
This error message started appearing right after this:
2010-11-09 14:20:07 -08:00 --- error: Exception [ 0 ]: @todo UNABLE_TO_LOCK_EXCEPTION
/var/www/g3/modules/gallery/libraries/ORM_MPTT.php [ 325 ]
#0 /var/www/g3/modules/gallery/libraries/ORM_MPTT.php(103): ORM_MPTT_Core->lock()
#1 /var/www/g3/modules/gallery/models/item.php(92): ORM_MPTT_Core->delete()
#2 /var/www/g3/modules/gallery/libraries/ORM_MPTT.php(96): Item_Model_Core->delete()
#3 /var/www/g3/modules/gallery/models/item.php(92): ORM_MPTT_Core->delete()
#4 /var/www/g3/modules/gallery/helpers/item_rest.php(195): Item_Model_Core->delete()
#5 [internal function]: item_rest_Core::delete(Object(stdClass))
#6 /var/www/g3/modules/rest/controllers/rest.php(99): call_user_func(Array, Object(stdClass))
#7 [internal function]: Rest_Controller->__call('item', Array)
#8 /var/www/g3/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Rest_Controller), Array)
#9 [internal function]: Kohana_Core::instance(NULL)
#10 /var/www/g3/system/core/Event.php(208): call_user_func_array(Array, Array)
#11 /var/www/g3/application/Bootstrap.php(67): Event_Core::run('system.execute')
#12 /var/www/g3/index.php(97): require('/var/www/g3/app...')
#13 {main}
2010-11-09 14:20:59 -08:00 --- error: @todo MISSING_MODEL item:1
#0 /var/www/g3/modules/gallery/helpers/item.php(217): model_cache_Core::get('item', 1)
#1 /var/www/g3/themes/wind/views/page.html.php(82): item_Core::root()
#2 /var/www/g3/system/libraries/View.php(318): include('/var/www/g3/the...')
#3 /var/www/g3/system/libraries/View.php(260): View_Core->load_view('/var/www/g3/the...', Array)
#4 /var/www/g3/modules/gallery/libraries/MY_View.php(69): View_Core->render(false, false, false)
#5 /var/www/g3/system/libraries/View.php(226): View->render()
#6 /var/www/g3/modules/gallery/controllers/albums.php(79): View_Core->__toString()
#7 [internal function]: Albums_Controller->show(Object(Item_Model))
#8 /var/www/g3/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Albums_Controller), Array)
#9 [internal function]: Kohana_Core::instance(NULL)
#10 /var/www/g3/system/core/Event.php(208): call_user_func_array(Array, Array)
#11 /var/www/g3/application/Bootstrap.php(67): Event_Core::run('system.execute')
#12 /var/www/g3/index.php(97): require('/var/www/g3/app...')
#13 {main}
The whole log file is attached in this post.
Any help or advice how to proceed is appreciated, I don't even know where to start to fix this.
BR,
Julius
Posts: 27300
You are missing your root album.
If you only have a few items, I would just start over.
if not then: Try checking Google for an answer:
http://www.google.com/search?q=site:gallery.menalto.com+MISSING_MODEL+item:1
Google is your friend
I have not seen "UNABLE_TO_LOCK_EXCEPTION" but if you can get to the admin page you might be able to run the fix task.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 7994
Your root album got deleted. There's some kind of race condition going on here; I can't see how this could happen in the code but clearly it's still happening very occasionally. Two things:
1) Let's get your Gallery working again. Follow the SQL isntructions from this thread: http://gallery.menalto.com/node/97321 then immediately afterwards, go into Admin > Maintenance and run the "Fix Gallery" task. That should fix up your hierarchy.
2) Please do your best to give me as much context as possible as to what was going on when the failure happened. *anything* you can provide would be useful -- Apache2 access logs, error logs, Gallery 3 var/logs, etc. I'm trying to piece together exactly how this race can happen such that we accidentally delete the root album.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git
Posts: 11
Thank you guys for your help! My gallery is back online after doing what bharat suggested. The only thing I had to change was adding some columns to the sql because I have view_1 to view_9 in the end of items table instead of just view_1 and view_2:
INSERT INTO items VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,2,0,NULL,'','',1,NULL,NULL,2,NULL,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1','1','1','1','1','1','1','1');
I have some 50000+ pics there and no backup of the db so I am really happy this worked.
I am trying to gather all logs that were created and send them to you.
BR,
Julius
Posts: 1
I had this happen to me yesterday. At that time I tried to delete an album with 2000 photo's in it. After some time went by it looked to me like the process got stuck. I looked at top and saw that neither mysql nor apache was doing anything, I waited another 5 - 10 minutes before clicking on "cancel" and then the error page appeared.
I will try and collect all the logs involved and send it along if you think it may help.
Posts: 11
Yes it was a similar situation in my case. I was trying to delete an album with a few hundred photos and thought the process was stuck because it took so long. Then I tried to click on cancel - no effect. After that I tried to delete the things via the organize album module, but it got also stuck and the gallery was gone.
FWIW, the only thing that I found from the logs was these two lines from apache2 error.log:
[Wed Nov 10 00:09:19 2010] [error] [client 192.168.0.56] request failed: URI too long (longer than 8190)
[Wed Nov 10 00:11:14 2010] [error] [client 192.168.0.56] request failed: URI too long (longer than 8190)
The IP address matches the computer that I was using to access the gallery but I don't know if this is related to the problem.
My system:
# Operating system: Linux 2.6.32-25-generic-pae
# Apache: Apache/2.2.14 (Ubuntu)
# PHP: 5.3.2-1ubuntu4.5
# MySQL: 5.1.41-3ubuntu12.6
# Graphics toolkit: imagemagick
BR,
Julius
Posts: 13
I've also just had this problem. I will try the fix shortly. I was deleting an album 3 levels down from root when it happened. It isn't quite that simple though. I initially tried deleting the album but after a couple of hours it was still there (2000 or so photos in the album). The thing is though that everything for that album in /var/albums was gone. If i browsed the album in gallery3 I could access it and there were blank spaces where the thumbnails should be, and at the top was the error that the album was not writable. The writable error can be fixed by re-creating the physical folder within /var/albums, so I did this and deleted all albums within the 1 I was trying to delete, leaving still around 1100 photos in there loose. I then tried to delete the album again, walked away for a couple of hours and came back to a blank white page. refreshed and got "Dang... Something went wrong!".
bharat, if you'd like a copy of all my logs I'll save them for you before i run the fix you suggested above.