Hi !
I'm trying to use G3 beta (in fact, I'm using b9ee6f7d from git). The installation went nearly fine (strange error message when giving a db prefix name containing '-'). Now, I'm trying to import data from my previous g2 installation. I activated the module from the admin page. When I give the path to the embed.php (as asked by the module), I simply get an empty page (not a single character is sent by the server). I tried to check var/log, but it simply contains lines like:
2009-06-07 14:37:25 +02:00 --- debug: MySQLi Database Driver Initialized
2009-06-07 14:37:25 +02:00 --- debug: Database Library initialized
2009-06-07 14:37:26 +02:00 --- debug: Session Database Driver Initialized
2009-06-07 14:37:26 +02:00 --- debug: Session Library initialized
I tried to activate some debug display, but could not find out how... I set the IN_PRODUCTIOn to false in index.php, but result is the same. Then I tried to enable 'display_error':
ini_set('display_errors', true);
but still no trace of a single debug line. I stopped here before breaking anything.
Any help is welcome
Marc
PS: my g2 installation uses a "multisite" configuration. Maybe this is the source of my problem ?
Posts: 31
Looks like I have something not working correctly: I can't upload any image. The flash uploader fails with error 417. Nothing useful in the logs (always the same line as above).
Posts: 113
I'm having the same problem with the blank page after clicking Save on the import page. I am able to use the Flash uploader to add photos, though.
Ah, I've got a multi-site setup as well ... maybe that's the key?
Posts: 31
In fact, I tried from a different browser, and the flash uploader works. I don't know why it always fails on my laptop...
You still have a diff with me: i get a HTTP 200 (OK) and you get a HTTP 500 (internal server error).
Posts: 12
having the same problem, described in this thread: http://gallery.menalto.com/node/88226 (only realized later that this was the same problem)
Posts: 31
I did try to trace the problem. In my case it looks like the multisite config causes problem. The import process copies some files around to change some names inside, and then require them. In the case of a multisite config, the embed.php is different than what is expected (in fact, it requires the "real" embed.php, the one that contains names to be changed). I'm not sure I can fix this as I don't have only knowledge of gallery2/3 internals... Maybe I'll have a look again later. Any helps from gallery devs is welcome. A fix would be great, but a clue/hint would be fine also... If I can come up with something, I know how to use git and provide a patch ;p
Posts: 7994
Ah yeah that totally makes sense. So the problem is that both Gallery2 and Gallery3 define a PHP class called "gallery" which the interpreter doesn't like. So we dupe the Gallery2 code files and hack on the code so that we can retroactively change the name of the class in G2. Can one of you file a bug against this? I can fix it when I get time to set up a multisite install and try importing it.
---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest zip: http://github.com/gallery/gallery3/zipball/master
Latest git: http://codex.gallery2.org/Gallery:Using_Git
Posts: 31
Done! https://sourceforge.net/tracker/?func=detail&aid=2803348&group_id=7130&atid=107130
Posts: 31
I attach a patch that seems to do its job for multi site config. This is not a *good* patch, as it breaks regular import, does not check for valid args, ... But at least, it looks like it works (currently the progress bar indicates that it has imported 24 photos out of the 2000+ I have). You can have a try to see if it fixes your problem. Then I (or a g2 dev) will clean this patch (if what it does is the correct fix...)
Posts: 31
http://github.com/dkm/gallery3/commit/e77ba1d7512b3d7f4c3cd12bb499e0e296c485ae
This is a better try. I'll let gallery hackers decide wether this is good or not. I have nearly 0 knowledge of php...
Posts: 31
After having imported 702 photos (out of 2000+), the process stopped. The progress bar was not making progress anymore I checked on the server, and there was no active apache process. So I "paused" it, and got a nice blank page (again). If I go the gallery main page, I can see that some albums have been imported correctly. But I can't go to the admin page anymore, I get a blank page now. Nothing in the log. Too bad, I really thought I add done something useful
Posts: 31
In fact, I can go to the admin, but not in the "maintenance" tab.
Is there a way to enable *massive* debug output ? Because currently, I'm using "print" in the code to figure out what is going on, and that's not very friendly
I would really like to make g3 work, as it looks very nice and promising !
Posts: 8
For what its worth I was seeing the same problem originally reported in this thread (not a multi-site config) and I saw something in http://gallery.menalto.com/node/88168 regarding a slightly different issue where a suggested workaround was to log into the G2 gallery and click on all user accounts so see if this generated any crashes etc. I clicked on each user and then click save and though there were no crashes after doing this I was able to configure the G2 Import module in G3.
Don't know if this would work for others too but worth a try if you have only a few users configured.
Posts: 31
Problem solved, I simply did not check hard enough my patch, which was full of crap. Now, it works fine... I was able to resume the import. Maybe there is a timeout somewhere that stoped the first import...
I pushed the fix to my github clone.
Posts: 31
https://apps.sourceforge.net/trac/gallery/ticket/377#comment:1 <= this is the ticket on track...
It's a bit misleading all these different location for tracking code... github, sf, svn, track, etc. Sorry for the mistake.
Posts: 113
I tried applying your new versions of the two php files but now I get a blank screen as soon as I click the "Gallery 2 Import" link on the Admin/Settings menu.
Posts: 31
Strange. Did you try with my latest git version ? http://github.com/dkm/gallery3/tree/master
What you can do is going in index.php, and set the error reporting of php to E_ALL:
error_reporting(E_ALL);
(it is 0 by default)
It helped my *a lot* to trace errors !
Posts: 113
Even after setting error_reporting, just a blank page and nothing in the gallery logs. Just a 500 in my apache log.
xx.xx.xx.xx - - [09/Jun/2009:11:24:28 -0400] "GET /gallery3/index.php/admin/g2_import HTTP/1.1" 500 - "http://www.xxxxx.net/gallery3/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)"
I'll try messing around a bit more later.
Posts: 31
I think you have a different problem than mine, sorry
FYI, the "method" I used is quite simple. I added print statement along the execution path to see where something was going wrong.
I would have thought that having E_ALL set would always give something (syntax error, unhandled exception, ...) instead of the blank page, as it's something going wrong in the php code (the way I understood it...).
Posts: 113
Hmmm ... found this in my error log. Not sure how I missed it before:
[Tue Jun 09 11:24:28 2009] [error] [client xx.xx.xx.xx] PHP Parse error: syntax error, unexpected '{' in /usr/local/gallery3/modules/g2_import/helpers/g2_import.php on line 55, referer: http://www.xxxxx.net/gallery3/
It looks like a close paren is missing on the if line:
Not sure where it's supposed to go though.
Posts: 7994
@marc_p: tip-- you can create "local.php" in your gallery3 dir and put those settings in it and it'll get loaded after index.php is done (so it won't get overwritten when you upgrade).
I'm watching this thread and will work on the multi-site import when I can (and I'll watch the forks to see how your code is progressing). Got a lot of irons in the fire right now so if you guys can help yourselves for a bit that'd let me focus on some other problems for a bit.
---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest zip: http://github.com/gallery/gallery3/zipball/master
Latest git: http://codex.gallery2.org/Gallery:Using_Git
Posts: 31
this means you are not using the latest code I wrote. You should have a try with my git branch. If you use git, you can simply 'pull' my changes, or you can see this fix:
http://github.com/dkm/gallery3/commit/657e17361db19ac1878b2a6d93595a763aef8b15
@bharat : ok thanks for the tip
I finished the import process, it worked well. I see some things are not imported though. Like highlights or restricted albums.
Posts: 113
Ok, I'm still missing something (thanks for your patience).
The import page now loads, but when I put in the path for my master embed.php file, it tells me it's not a Gallery 2 installation. I assume the second path is supposed to be the path to the multisite's embed.php? Or some other file?
Posts: 31
Hmmm... Strange strange. I guess I've screwed something. The second path should be the directory that contains the multisite's embed.php, yes. First, you should clean the files previously copie by the import. They are located in var/modules/g2_import. You should empty this directory before starting the import process. Try again after removing stuff from there, and let me know if it works better or if you have the same problem
Posts: 113
I cleared out the two temp directories I found under var/modules/g2_import and tried again, but the same error (and nothing new was copied in). I'll check permissions, but those should be fine since this is my master site.
Posts: 31
Can you try to apply this patch ? I think I simply messed up with the test. I can't try on my side now.
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 648f380..01e07eb 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -54,7 +54,7 @@ class g2_import_Core {
* Initialize the embedded Gallery2 instance. Call this before any other Gallery2 calls.
*/
static function init_embed($embed_path, $multi_path) {
- if (!is_file($embed_path) || (!empty($multi_path) && !is_dir($multi_path))) {
+ if (!is_file($embed_path) && (empty($multi_path) || is_dir($multi_path))) {
return false;
}
Posts: 113
Bingo! I'm able to start the import now ... here goes!
Thanks for your help!
edit: it's working ... 136 of 5219 photos imported.
Posts: 31
Glad to hear that !
Posts: 113
Well, it stalled after 3,712 images imported. I've tried resuming it, but the progress bar stays empty and goes no where.
Posts: 31
I think you are having a new problem. Some users raised problems when importing some users. Sorry, I won't be able to help with this
Posts: 113
Yeah, no problem ... thanks for all your help with at least getting something imported from multi-site!
Posts: 31
Looks like magically, the highlights have been imported (maybe because of a recent commit ?).
Posts: 12
your changes make importing from my multiste g2 install work! thanks!
Posts: 113
Yeah, I checked all my users (only two: guest and my own) and they're fine. I deleted all the imported albums in G3 (which took a while) and then tried the import again. It froze in the same place so I'm guessing it's one of the photos. Not sure how to figure out which specific one though. I found this in the log:
Posts: 9
I also have the blank page problem with gallery2 importing. I posted my take on the source here: http://gallery.menalto.com/node/88186#comment-310223
Posts: 40
@marc_p Itried with your branch and it solved my problem what is trick here ? We need to have those changes in master copy of gallry3 before it goes public for sure.
-best regards
www.santm.com
Posts: 31
santm: when using regular install, embed.php is in the same directory as the config file (config.php I guess). In multisite, embed.php is in the 'master' directory and the config dir is with the instance. So instead of handling only one path ($embed_path), I add a second path ($multi_path) pointing to the instance. That's all. You can check the changes from my branch, you'll see there not much
Posts: 7994
I checked out the code in your fork superficially.. not sure if that's the approach I'd take but let me think on it a bit. I've got some stuff in the queue ahead of this but it's definitely on my list.
---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest zip: http://github.com/gallery/gallery3/zipball/master
Latest git: http://codex.gallery2.org/Gallery:Using_Git
Posts: 31
I though of things more complicated but easier for the user (like findind master path from the instance's embed.php), but my php skills are too light.
Btw, I won't take it personnaly if you don't use a single line of my diff
Posts: 7994
Ok so the bad news is that I didn't use your approach, but the good news is that reading through your code helped me get it right. I've just submitted a change which allows us to detect the code source from reading the multisite wrapper code and then Do The Right Thing. I've successfully cleanly imported 1 multisite as a sanity check.. want to grab the latest code and try it out? You may need to revert your changes in your fork to get the latest code to apply cleanly, or you can just nuke your fork and start over if you don't have anything else in there that you care about.
---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest zip: http://github.com/gallery/gallery3/zipball/master
Latest git: http://codex.gallery2.org/Gallery:Using_Git
Posts: 9
Unfortunately this does not fix the problem for me. (No Multisite here)
I've also posted the var/modules/g2_import dir in this thread: http://gallery.menalto.com/node/88186
Posts: 113
It worked for me ... it allowed me to start importing one of my multi-sites. Unfortunately, the process still hangs after importing 3,721 photos out of 5,000 plus with the same error I posted earlier above. Any way to figure out what photo is causing the problem?
Posts: 31
There is no bad news That's great I helped a (very little) bit with this issue ! I think I'll simply kill my branch, and maybe resurect it if I find something else to do on gallery 3
Posts: 7994
Considering the high quality of your code, I hope you resurrect your branch and find something else to do soon :-D
---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest zip: http://github.com/gallery/gallery3/zipball/master
Latest git: http://codex.gallery2.org/Gallery:Using_Git