ANNOUNCE: galleryadd.pl 2.30
iainlea
Joined: 2004-09-24
Posts: 10 |
Posted: Wed, 2007-04-11 08:18 |
URL: http://freshmeat.net/projects/galleryadd/ galleryadd.pl is a script that recursively adds directories or images to a Gallery installation. Its features include a listing of the albums available in a Gallery, the creation of top-level albums with titles and descriptions, and support for the addition of images and directories to an existing album. Changes in 2.30: Usage: galleryadd.pl [options] [file(s) | dir(s)] Examples: upload image bmw.jpg to album mycars galleryadd.pl -g http://gallery -u admin -p secret123 -c xmas /tmp/* create album xmas and upload images located in /tmp directory NOTE: G2 users need to specify the album ID (not name) when using -a option |
|
Posts: 1
Hello,
I have a problem when using galleryadd.pl :
./galleryadd.pl -g http://bpinf.sytes.net/gallery2 -G2 -u admin -p my_password -c 0004_RRC_2006
System http://bpinf.sytes.net/gallery2/main.php [G2]
Login: admin [ERROR]
http://bpinf.sytes.net/gallery2/main.php
500
<HTML>
<HEAD><TITLE>An Error Occurred</TITLE></HEAD>
<BODY>
<H1>An Error Occurred</H1>
500 Internal Server Error
</BODY>
</HTML>
admin and password are ok
Thanks for your help
Bernard
Posts: 14
I am experiencing the exact same problem, on Gallery 2.2.1 at http://www.snowbombing.com/gallery/
Posts: 14
Does nobody have any clue why this would be happening? It renders this tool completely useless!
My Gallery install is completely standard, apart from I have switched to using the Siriux theme and put an image in the header div.
Can anybody offer any suggestions?
Posts: 2
I'm on a new 2.2.1 install. I originally started out with an old version of galleryadd.pl and then tried 2.30, both without success. I started going through 2.30 line-by-line in gedit and noticed that a good portion of it was pink (ie, string text). I traced the start of the pink to the AddDirectory subroutine which has this line:
$cleanAlbumName =~ s/\\|\/|\*|\?|"|'|<|>|\||\.|\+|#|\s|&|\(|\)/_/g;
Notice that the double and single quotes aren't escaped out with a slash. The AddAlbum subroutine has an identical line. I escaped out the quotes properly (and the #) and the text started looking more like a script than a big string, but it still doesn't work. I'm trying to upload a bunch of directories into the album "2007" on the server. I type the following command:
galleryadd.pl -g http://www.mysite.com -c 2007 -u Me -p pass -G 2 *
where "mysite," "Me" and "pass" are all correctly replaced by my info. The result I receive is:
As you can see, it makes the top-level album but doesn't get through making the first sub-album for the first sub-directory, and it doesn't upload a single picture. This is driving me crazy because I know it's likely a minor error in the code like the one I already found, but I don't have nearly enough experience with galleryadd.pl and GalleryRemote to figure out what's wrong. The Gallery Remote app works just fine so I know my site setup is ok, but since galleryadd.pl seems to be the only way to upload a complete tree structure I'd like to get it working.
Posts: 12
I'm having the exact same problem (failed login followed by error 500). Any ideas iainlea?
P.S. I have emailed the galleryadd authors to let them know of these issues. Hopefully I didn't bug them too much and they will find time to look into this
*EDIT* I've just discovered that I cannot connect with gallery remote either, so my issue, although same symptoms, may be different. All I know is that the galleryadd.pl I have works fine on gallery 2.1.x, but fails on gallery 2.2.x. Supposedly this is due to the new auth_token requirement, but I tried galleryadd.pl 2.30 which is supposed to address that, to no avail. *scratches head*
Posts: 3
My story regarding galleryadd.pl and a Gallery installation of 2.1 upgraded to 2.2.
As others who have posted here, galleryadd.pl stopped working with the very annoying 500 Internal Server Error after otherwise successfully upgrading to Gallery 2.2 - the most annoying part was that for some reason I couldn't even find anything in the apache logs, like you're meant to with 500 errors, I guess this is because the error comes from Gallery and not Apache but gallery doesn't log stuff.
First I upgraded my galleryadd.pl from 2.00 to 2.30, but that didn't help. It was probably a necessary first step, though.
Then I found this post at http://gallery.menalto.com/node/61717 which gave me the hint, and sure enough my Remote module was out of synch - I had version 1.0.6 after the upgrade when the current version (as of this writing) is 1.0.9.1. Even though Gallery 2.2 is supposed to have automatic management of modules via the web interface, there was no upgrade feature/link for me (why? the documentation seems to indicate there should be? maybe because mine is an upgraded installation?), so I manually upgraded the module files on the server. After that I could click "upgrade" in the module view of the admin page, and suddenly everything started working.
So I guess there's nothing wrong with galleryadd.pl 2.30 which I'm now using together with Gallery 2.2.4. If you have this problem, check your Gallery installation, especially the Remote module.
I hope this info helps someone!
Posts: 12
I'm getting a different error than everyone else seems to be getting, at least on my main Gallery install. The install I have on my Debian system gives me the 500 error, but on my Ubuntu server (my main server) I get a very long error after logging in, but with the result of not being able to add the pictures I'm trying to add. The user I'm using to add the album and picture is the site administrator, so there should be no permission problems. Here's the error
galleryadd.pl -g <gallery URL> -u <username> -p <password> -c test DSCF4962.JPG
System http://gallifrey/photos/main.php [G2]
Login: greenleaf [OK]
Album: fetching list [OK]
Check: test [OK]
Create test (Test) (13822) [OK]
Upload DSCF4962.JPG (Dscf4962) [ERROR]
Error: could not upload image - unknown error
200
GalleryStatus Object
(
[_stack] =>
[_errorCode] => 5
[_errorMessage] =>
[_stackTrace] => Array
(
[0] => Array
(
[file] => /var/www/photos/modules/remote/GalleryRemote.inc
[line] => 1216
[function] => error
[class] => GalleryCoreApi
[object] => GalleryRemoteController Object
(
[_optionInstances] =>
)
[type] => ->
[args] => Array
(
[0] => 4
)
)
[1] => Array
(
[file] => /var/www/photos/modules/remote/GalleryRemote.inc
[line] => 516
[function] => _assertHasViewPermission
[class] => GalleryRemoteController
[object] => GalleryRemoteController Object
(
[_optionInstances] =>
)
[type] => ->
[args] => Array
(
[0] => test
)
)
[2] => Array
(
[file] => /var/www/photos/modules/remote/GalleryRemote.inc
[line] => 128
[function] => addDataItem
[class] => GalleryRemoteController
[object] => GalleryRemoteController Object
(
[_optionInstances] =>
)
[type] => ->
[args] => Array
(
[0] => Array
(
[protocol_version] => 2.5
[cmd] => add-item
[set_albumName] => test
[caption] => Dscf4962
)
[1] => GalleryRemoteProperties Object
(
[_map] => Array
(
[status] => 403
[status_text] => Upload failed\: ''.
)
)
)
)
[3] => Array
(
[file] => /var/www/photos/main.php
[line] => 231
[function] => handleRequest
[class] => GalleryRemoteController
[object] => GalleryRemoteController Object
(
[_optionInstances] =>
)
[type] => ->
[args] => Array
(
[0] => Array
(
[protocol_version] => 2.5
[cmd] => add-item
[set_albumName] => test
[caption] => Dscf4962
)
)
)
[4] => Array
(
[file] => /var/www/photos/main.php
[line] => 94
[function] => _GalleryMain
[args] => Array
(
[0] =>
)
)
[5] => Array
(
[file] => /var/www/photos/main.php
[line] => 83
[function] => GalleryMain
[args] => Array
(
)
)
)
)
GalleryStatus Object
(
[_stack] =>
[_errorCode] => 5
[_errorMessage] =>
[_stackTrace] => Array
(
[0] => Array
(
[file] => /var/www/photos/modules/remote/GalleryRemote.inc
[line] => 1216
[function] => error
[class] => GalleryCoreApi
[object] => GalleryRemoteController Object
(
[_optionInstances] =>
)
[type] => ->
[args] => Array
(
[0] => 4
)
)
[1] => Array
(
[file] => /var/www/photos/modules/remote/GalleryRemote.inc
[line] => 516
[function] => _assertHasViewPermission
[class] => GalleryRemoteController
[object] => GalleryRemoteController Object
(
[_optionInstances] =>
)
[type] => ->
[args] => Array
(
[0] => test
)
)
[2] => Array
(
[file] => /var/www/photos/modules/remote/GalleryRemote.inc
[line] => 128
[function] => addDataItem
[class] => GalleryRemoteController
[object] => GalleryRemoteController Object
(
[_optionInstances] =>
)
[type] => ->
[args] => Array
(
[0] => Array
(
[protocol_version] => 2.5
[cmd] => add-item
[set_albumName] => test
[caption] => Dscf4962
)
[1] => GalleryRemoteProperties Object
(
[_map] => Array
(
[status] => 403
[status_text] => Upload failed\: ''.
[status_debug] => 1
)
)
)
)
[3] => Array
(
[file] => /var/www/photos/main.php
[line] => 231
[function] => handleRequest
[class] => GalleryRemoteController
[object] => GalleryRemoteController Object
(
[_optionInstances] =>
)
[type] => ->
[args] => Array
(
[0] => Array
(
[protocol_version] => 2.5
[cmd] => add-item
[set_albumName] => test
[caption] => Dscf4962
)
)
)
[4] => Array
(
[file] => /var/www/photos/main.php
[line] => 94
[function] => _GalleryMain
[args] => Array
(
[0] =>
)
)
[5] => Array
(
[file] => /var/www/photos/main.php
[line] => 83
[function] => GalleryMain
[args] => Array
(
)
)
)
)
#__GR2PROTO__
status=403
status_text=Upload failed\: ''.
status_debug=1
debug_user=<username>
debug_time=0.015s
auth_token=3d8fbd10d923
I'm not any good at programming, and I picked Gallery because I didn't need to know any programming to make it work. I was really hoping this script would let me take the pictures off my digital camera and download them to an album on Gallery, but if I can't make it work, I'm going to be back to trying to find something that will suit my needs.
Gallery version = 2.2.4 core 1.2.0.6
PHP version = 5.2.1 apache2handler
Webserver = Apache/2.2.3 (Ubuntu) PHP/5.2.1
Database = mysqli 5.0.38-Ubuntu_0ubuntu1.2-log, lock.system=database
Toolkits = Dcraw, Exif, Getid3, LinkItemToolkit, Thumbnail, ImageMagick, SquareThumb
Acceleration = none, none
Operating system = Linux Gallifrey 2.6.20-16-generic #2 SMP Tue Dec 18 05:45:12 UTC 2007 i686
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11
Rows in GalleryAccessMap table = 28
Rows in GalleryAccessSubscriberMap table = 4509
Rows in GalleryUser table = 4
Rows in GalleryItem table = 4507
Rows in GalleryAlbumItem table = 44
Rows in GalleryCacheMap table = 0
*EDIT* I Tried again, and the error seems to be in creating the album. I created an album to put the picture into and then tried uploading it (using the album's ID, not the name) and it worked fine. Is there a bug that doesn't let GAllery2 users create albums using the Perl script?
Posts: 12
I am having the exact same problem. If anyone could help me figure this out I would much appreciate it. Here is my full sanitized debug output:
Posts: 3
That bit near the end looks suspiciously like an "authorization required" error (403). If you have access to the web server logs, you could check there if you can see what URL you don't have access to, and what are the access controls to it (web-server level, and for the Gallery user)?
I had a similar problem as this, and as I recall it was a web server side issue (web server did not have read access some file, or something - it's been awhile).
Obviously you should double and triple check that the username/password works, but I assume you've done that.
Posts: 12
Yeah the username and password works, as it does login successfully and gets the list of albums. I checked the web server logs and there are no errors, despite the "403" status code, which Im not sure is the same as the apache 403 forbidden error.
Posts: 3
Another thing to check for (something that bit me at least):
make sure you have the "remote" module installed and configured for your Gallery instance.
It's been awhile (many months) but I think what happened was that after some upgrade or something to a working gallery instance, the remote module was deactivated and I had to go in the modules configuration and (re-)enable it.