Unable to import directory tree from command line
nivla
Joined: 2005-03-25
Posts: 5 |
Posted: Fri, 2005-03-25 16:29 |
I've installed gallery-2.0-beta-1 onto my gentoo system with mysql 4.0.24 and perl v5.8.5. Unsuccessfully, I have tried the g2add.pl and galleryadd.pl scripts as well as that within the galleryadd.tar.gz archive downloaded from http://galleryupdates.jpmullan.com/. The first problem seems to be that it can not find the name of the specified album. A little debugging within the g2add.pl script reveals that this is because it is not searching for the album name but instead some number which represents the album. Once that number is substituted, I get the following error: Could not create album 'blah blah blah' : Unknown error 200 The ability to perform this import is essential for my use of gallery as it would be impossible for me to do so outside of gallery. Lastly, I would really, really love a command-line tool or api which would allow me to import the pictures directly without having to tax my already taxed web-server. Thanks in advance for your time, help, and expediance. |
|
Posts: 974
You didn't supply most of the information from the support template:
Please do, and we'll do our best to help you.
<TYPE YOUR MESSAGE HERE, ENTER SYSTEM DETAILS BELOW>
<Please check the G2 FAQ (sticky topic in this forum) before posting!>
----
Gallery URL (optional):
Gallery version:
Webserver (with version):
Datatabase (with version):
PHP version (eg 4.2.1):
phpinfo URL (optional):
Graphics Toolkit(s):
Operating system:
Web browser/version:
G1 version (for migration bugs):
Posts: 974
It's not debugging if it was caused by user error. You entered the wrong arguments for g2add.pl. ;)
galleryadd.pl won't work with g2 at all.
Did you try the "add from local server" option in g2 itself? It should be able to import recursively.
Posts: 5
Sorry....I've included the system info at the end of the message
The arguments listed for the g2add.pl script were the following.
g2add.pl -l url -a album -u username -p password filenames [-c] [-q] files dirs
I initially entered the following:
./g2add.pl -a 'album name' -l http://localurl -u name -p pass /localdir
After receiving, album not found error, I added several print statements to the script, saw "album.name.1=6", and assumed that my album name was, in fact, 6.
After entering the following, I got further and received the could not create error.
./g2add.pl -a 6 -l http://localurl -u name -p pass /localdir
I also just realized that the version of the g2add.pl is Version: .08G2alpha. This was true of the all of the ones that I could find at the website. Could it be that I have the wrong version?
Lastly, I'm unable to use the "add from local server" option in g2 because it does not maintain the directory structure, by adding sub-albums. Is it possible that this option could be added in the future?
gallery-2.0-beta-1
gentoo kernel 2.6.11
mysql 4.0.24
perl v5.8.5.
apache 2.0.52
php 4.3.10
ffmpeg 0.4.7
netpbm 10.20
jhead 2.0
Posts: 974
Hmm. I could have sworn that I had updated the usage. Oh well, it's updated now.
It might help to set
my $gallery_log = 1;
and set
my $gallery_log_filename = '~/g2add.log';
to someplace useful
or, try just setting
my $gallery_log_open = 1;
I think that will direct the detailed output to standard out.
Please paste your full log here or email it to me at
Thanks!
Posts: 5
I downloaded the new g2add.pl script from http://galleryupdates.jpmullan.com/other/g2add.pl that was dated 03-26-2005 01:28:26 AM. I tried using the command unsuccessfully both ways: specifying the album name and "album id." I have included the output from both commands below.
I'm currently using gallery version: 2.0-beta-1. Do I need to use a later version for this to work?
Here's the output when specifying the album name
command:
./g2add.pl -a 'Members' -l http://url -u user -p password /picture-path
output:
Logging In
writing to log file
Logged In successfully
Fetching list of albums (may be slow)
Fetched list of albums.
#__GR2PROTO__
album.name.1=6
album.name.2=10
album.name.3=11
album.name.4=38
album.parent.1=0
album.parent.2=6
album.parent.3=6
album.parent.4=6
album.perms.add.1=false
album.perms.add.2=false
album.perms.add.3=false
album.perms.add.4=false
album.perms.create_sub.1=false
album.perms.create_sub.2=false
album.perms.create_sub.3=false
album.perms.create_sub.4=false
album.perms.del_alb.1=false
album.perms.del_alb.2=false
album.perms.del_alb.3=false
album.perms.del_alb.4=false
album.perms.write.1=false
album.perms.write.2=false
album.perms.write.3=false
album.perms.write.4=false
album.summary.1=
album.summary.2=
album.summary.3=
album.summary.4=
album.title.1=Gallery
album.title.2=Members
album.title.3=Curtis Johnson
album.title.4=Curtis Johnson
album_count=4
can_create_root=true
status=0
Album does not exist: Members
Here's the output when specifying the album id
command:
./g2add.pl -a 6 -l http://url -u user -p password /picture-path
output:
Logging In
writing to log file
Logged In successfully
Fetching list of albums (may be slow)
Fetched list of albums.
#__GR2PROTO__
album.name.1=6
Found album '6'
album.name.2=10
album.name.3=11
album.name.4=38
album.parent.1=0
album.parent.2=6
album.parent.3=6
album.parent.4=6
album.perms.add.1=false
album.perms.add.2=false
album.perms.add.3=false
album.perms.add.4=false
album.perms.create_sub.1=false
album.perms.create_sub.2=false
album.perms.create_sub.3=false
album.perms.create_sub.4=false
album.perms.del_alb.1=false
album.perms.del_alb.2=false
album.perms.del_alb.3=false
album.perms.del_alb.4=false
album.perms.write.1=false
album.perms.write.2=false
album.perms.write.3=false
album.perms.write.4=false
album.summary.1=
album.summary.2=
album.summary.3=
album.summary.4=
album.title.1=Gallery
album.title.2=Members
album.title.3=Curtis Johnson
album.title.4=Curtis Johnson
album_count=4
can_create_root=true
status=0
Ignoring /picture-path
Posts: 5
If needed, I can update the script so that it will recursively add the pictures while maintaining the directory tree. Where could I go to find the latest version of these scripts and the current design documents outlining the (php) class and (mysql) database structure? Additionally, how could I become/apply to become a developer for this project?
Thanks for your help.
Posts: 974
What user are you trying to log in as? Does that user have permission to add to the root album?
Posts: 5
I am using an administrative user who I believe has sufficient permissions as it (the user) can create a sub-album from within the web pages.
Posts: 1
Same thing happened to me. Here is a small patch to fix the "Album not found" problem for g2add.pl version .091G2alpha (the one available on jpmullan.com right now)
Regards,
Pablo Hoffman
Posts: 4
Hello. I'm having a hard time uploading images to my gallery using g2add.pl. Without PabloHoffman's patch, the script complains about the albums not being there. With it, it supposedly succeeds, but after waiting a while for the upload to finish, the images aren't in there at all.
Here's a session log:
Thanks in advance.