Gallery3 import Gallery2 hangs @ 478 of 4572 images...

sdolgy

Joined: 2009-06-24
Posts: 12
Posted: Wed, 2009-06-24 17:01

Hi there,

Just grabbed gallery v3 using git and i see the import from gallery2 works much better then the zip file provided on slashdot! Anyways, trying the import and it hangs consistently at image 478 ... now, there is no debug logs or any information, so it's a little difficult to trouble shoot. looked in http logs, nothing...

Any suggestions? is there a flag i can enable debug with to see what it's doing?

thanks in advance
-sd

 
sdolgy

Joined: 2009-06-24
Posts: 12
Posted: Wed, 2009-06-24 17:30

Right, so I figured out how to enable debug. Guess I'm not reading the right places....

modify: gallery3/application/config/config.php

orig:

$config["log_threshold"] = 3;

modified:

$config["log_threshold"] = 4;

Now, unfortunately, debug isn't really giving me any good information about why the import is hanging. if i pause it and try and resume, it just sits and does nothing. if i cancel, and start again, it will start at "importing photo 175" and just hang...this is what i get in the gallery3/var/logs directory:

2009-06-24 17:44:48 +00:00 --- debug: Global GET, POST and COOKIE data sanitized
2009-06-24 17:44:48 +00:00 --- debug: MySQLi Database Driver Initialized
2009-06-24 17:44:48 +00:00 --- debug: Database Library initialized
2009-06-24 17:44:48 +00:00 --- debug: Session Database Driver Initialized
2009-06-24 17:44:48 +00:00 --- debug: Session Library initialized
2009-06-24 17:44:48 +00:00 --- debug: Global GET, POST and COOKIE data sanitized
2009-06-24 17:44:48 +00:00 --- debug: MySQLi Database Driver Initialized
2009-06-24 17:44:48 +00:00 --- debug: Database Library initialized
2009-06-24 17:44:48 +00:00 --- debug: Session Database Driver Initialized
2009-06-24 17:44:48 +00:00 --- debug: Session Library initialized
2009-06-24 17:44:51 +00:00 --- debug: Global GET, POST and COOKIE data sanitized
2009-06-24 17:44:51 +00:00 --- debug: MySQLi Database Driver Initialized
2009-06-24 17:44:51 +00:00 --- debug: Database Library initialized
2009-06-24 17:44:51 +00:00 --- debug: Session Database Driver Initialized
2009-06-24 17:44:51 +00:00 --- debug: Session Library initialized
 
sdolgy

Joined: 2009-06-24
Posts: 12
Posted: Wed, 2009-06-24 17:35

Actually, I like replying to myself. On the maintenance screen I get this:

Rebuild Images You have 4 out of date photos

This number increases with each attempt to migrate/resume.

How do I find out which photo(s) are out of date? Maybe that's the culprit. When I try and rebuild images, that hangs...Disk space isn't an issue, so I'm at a loss now...

Thanks in advance
-sd

 
sdolgy

Joined: 2009-06-24
Posts: 12
Posted: Fri, 2009-06-26 11:22

anyone? bueller?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2009-06-28 04:35

I took a couple of days off from the forums, sorry. You don't need to change the log threshold.. as you noticed, that just fills your logs with junk. Usually when we get to a problem like this there's *something* in the logs. :-/ If you turn the threshold back down again, clean out your gallery3 logs and try resuming the import is there anything in your logs?

How PHP savvy are you? It would really help if you could start putting log messages into modules/g2_import/helpers/g2_import.php in the import_item() function to try to figure out where it's failing.

Oh and also create a file called "local.php" in your gallery3 dir and put this in it:

<?
define('IN_PRODUCTION', false);
error_reporting(E_ALL);
ini_set('display_errors', true);

that'll enable more error output.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
sdolgy

Joined: 2009-06-24
Posts: 12
Posted: Sun, 2009-06-28 17:47

hi bharat, no worries ... was kinda hoping you weren't the single point of failure here ... and others in the community may be able to help!

So, let's see. In the following order:

Removed gallery3
Re-Added using git
Added one addition to the g2_import.php for logging in the import_item static function.
Added local.php to the root gallery3 dir and have already removed the threshold by re-acquiring all the newest code through git

Gallery version 2.2-rc-1 detected
Your Gallery 2 has the following importable data in it
5 users
4 groups
155 albums
4571 photos
1 movie
25 comments
0 tagged photos/movies/albums

i run the import and am starting to see debug info. i only added one debug line, to tell me the id of what gallery was trying to import...hopefully that will give me a bigger hint...hangs at the following .. no errors or anything else in the log file : (

2009-06-28 18:02:26 +00:00 --- alert: Attempting to load Gallery 2 item with id: 1670

I'll assume that these match up to the gallery v2 db id's ... the hunt continues.

thanks
-sd

 
sdolgy

Joined: 2009-06-24
Posts: 12
Posted: Sun, 2009-06-28 17:58

Right, so the item it hangs on ... i can load that image fine in my browser if i go to gallery3/var/albums ...

it has an entry in the database:

"635";NULL;NULL;"1246212147";;"2128";"904";"4";"image/jpeg";"DSCF0001_001.jpg";"2";"23";"0.881015";"Switzerland/album94/DSCF0001_001.jpg";"1";NULL;NULL;"905";"weight";"ASC";"0";"150";"150";"DSCF0001";"photo";"1246212147";"0";"635";"2832";"1";"1";"0"

so i'm a little confused and stuck again. perhaps someone should add some general "good" debug messages in the import, so its easy to turn on debug to see exactly what it is doing....working or not...saves a few forums posts maybe?

still, any suggestions would be appreciated. the only debug code i added was:

  static function import_item(&$queue) {
    $g2_item_id = array_shift($queue);

        g2_import::log(t("Attempting to load Gallery 2 item with id: %id", array("id" => $g2_item_id)));

    if (self::map($g2_item_id)) {
      return;
    }
 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2009-06-28 18:59

The problem with adding more debugging code is that we wind up leaving it all over the place and it fills up your logs with junk that's hard to decipher. Your logging is good so far.. keep adding more every few lines to try to narrow down exactly which line of code is failing. Add a line before every return statement so that you know how the function returned. Add some in g2_import_task.php also (in the same directory). Basically, add debugging lines *everywhere* so that you can trace the execution. You'll be able to narrow down the error to a small set of lines, and we can start digging in there.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
sdolgy

Joined: 2009-06-24
Posts: 12
Posted: Mon, 2009-06-29 06:48

Ok, will give it a shot today. A little concerned that anywhere there is a throw, it isn't actually throwing an error or writing it to the logs.