Gallery Protocol version 2 and Gallery Remote
ssozonoff
Joined: 2007-01-14
Posts: 14 |
Posted: Mon, 2007-01-15 13:14 |
Hi All, Not sure if this is a Gallery or Gallery remote issue ... here goes. Basically if I login using Gallery Remote (latest version) I don't see any albums being fetched. A tweak to the Gallery code and the albums show up but are Read Only. This basically simulates behavior with Gallery Remote and Gallery version 2.0 I think. Anyway, I trace things a little... Below is the login sequence, request/response POST /gallery/main.php HTTP/1.1 Host: www.jussymodeleclub.ch Connection: Keep-Alive, TE TE: trailers, deflate, gzip, compress User-Agent: Gallery Remote 1.5 Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress Content-type: application/x-www-form-urlencoded Content-length: 151 g2_form%5Bcmd%5D=login&g2_form%5Bprotocol_version%5D=2.3&g2_form%5Buname%5D=test&g2_form%5Bpassword%5D=xxxxxxxxxx&g2_controller=remote.GalleryRemot HTTP/1.1 200 OK Date: Mon, 15 Jan 2007 12:53:34 GMT Server: Apache X-Powered-By: PHP/4.3.11 Set-Cookie: GALLERYSID=0f183be05af40f034c72863684efa03d; expires=Mon, 05 Feb 2007 12:53:35 GMT; path=/gallery/; domain=.jussymodeleclub.ch; HttpOnly=1 Content-Length: 160 Connection: close Content-Type: text/plain; charset=UTF-8 #__GR2PROTO__ server_version=2.8 debug_core_version=7,3 debug_module_version=1.0.6 status=0 status_text=Login successful. debug_user=test debug_time=0,042s OK, great I am logged in. Now lets fetch the albums POST /gallery/main.php HTTP/1.1 Host: www.jussymodeleclub.ch Connection: Keep-Alive, TE TE: trailers, deflate, gzip, compress User-Agent: Gallery Remote 1.5 Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress Content-type: application/x-www-form-urlencoded Content-length: 104 g2_form%5Bcmd%5D=fetch-albums-prune&g2_form%5Bprotocol_version%5D=2.3&g2_controller=remote.GalleryRemot HTTP/1.1 200 OK Date: Mon, 15 Jan 2007 12:53:35 GMT Server: Apache X-Powered-By: PHP/4.3.11 Content-Length: 4336 Connection: close Content-Type: text/plain; charset=UTF-8 #__GR2PROTO__ debug_time_albumids=0,049s debug_time_entities=0,062s debug_time_permissions=0,076s album.name.1=2695 album.title.1=25ans de Versoix album.summary.1= album.parent.1=26 album.perms.add.1=false album.perms.write.1=false album.perms.del_alb.1=false album.perms.create_sub.1=false album.info.extrafields.1=Summary,Description --- cut --- debug_time_generate=0,081s can_create_root=true album_count=17 status=0 status_text=Fetch-albums successful. debug_user=guest debug_time=0,084s
So, what gives.... Now it thinks I am a guest.... obiously the Albums will be Read Only if I am guest, but I just logged in as a registered user. As a first impression.... I would say that Gallery Remote is not returning the session cookie! Thanks,
|
|
Posts: 32509
Before we start diagnosing this problem, please upgrade to Gallery 2.2 RC-1 and the latest Gallery Remote version. There have been some changes and bugfixes related to cookie handling and authentication since G2.1.2.
--------------
Enter the Gallery 2 Theme Contest today!
Posts: 14
Hi,
OK, so I have upgraded to Gallery 2.2 RC1 and Gallery Remote 1.5.1 b30.
Same problem and the protocol trace shows the same thing.
Thanks,
Serge
Posts: 32509
Please post the communication log for the new versions as well.
--------------
Enter the Gallery 2 Theme Contest today!
Posts: 14
Here you go.
login
fetch
Serge
Posts: 32509
Can you please attach the whole log as forum file attachement?
Thanks
--------------
Enter the Gallery 2 Theme Contest today!
Posts: 14
Hi Valiant,
You have lost me now. This is not from a log file, its a trace using a protocol sniffer. This is pretty much all there is to it except that before the login there is the test by Gallery Remote to figure out which protocol to use.
Are you looking for the debug file from Gallery Remote? What sort of info are you looking for?
I tried to check out the source for Gallery Remote to try and debug, but there are so many branches and tags in there that I don't know where to begin. I checked out TRUNK but it does not seem to correspond at all the Gallery Remote 1.5.1 b30
On top of that the java package names are mixed case (which is a real no no)..... guess how that messes with Windows!
Regards,
Serge
Posts: 32509
- you can start Gallery_Remote_Debug instead of Gallery_Remote
- you can set the log level to detailled in your GR -> settings dialog
- GR logs to GalleryRemoteLog.txt in your temp folder, e.g. on Windows XP it's in your c:\documents and settings\username\local settings\temp\
--------------
Enter the Gallery 2 Theme Contest today!
Posts: 14
Here you go.
Regards,
Serge
Posts: 32509
Thanks.
But I can't see why it's not including the cookie in the fetch-album response.
The cookie path / domain seem to match, thus it should include it...but it doesn't. Which explains why you're no longer logged in in the fetch-album request.
Moving the topic to the GR forums. Maybe paour has some more insight.
--------------
Enter the Gallery 2 Theme Contest today!
Posts: 14
I agree and thats why I wanted to get the Gallery Remote code up and running in my dev environment so I could debug this issue.
I will try again with different source.
Thanks,
Serge
Posts: 14
Hey Valiant,
Do you anything about an "auth_token" parameter GR should be (but is not) getting back from Gallery during the login process?
Thanks,
Serge
Posts: 14
OK,
Narrowing this down to what might be a cookie parsing error in GR.
Serge
Posts: 14
OK,
The problem seems to lie around line 427 of Cookie.java (from svn Trunk)
paour, I am not exactly sure what your domain parsing logic is doing but its not working in my case.
The Cookie.domain is being set from the req.getConntection().getHost(). In my case this is www.jussymodeleclub.ch
You then append a "." to this and store it as the cookie domain.
The domain being set for the cookie is jussymodeleclub.ch which gets prefixed with a "." as well.
You then compare these and here is where the problem lies...... I will keep digging.
Thanks,
Serge
Posts: 14
I now have a Gallery Remote working properly with my Albums showing up properly.
paour, I changed line 427 of Cookie.java like follows
since you seem to always (almost) be appending a "." leading to the domain.
see line 384
I am sure this is not a perfect fix but should work fine, I would be happy to discuss this further.
Thanks,
Serge
Posts: 25
I'm seeing the exact same problem. The cookie reads ".www.blackholeofphotography.com", i.e. it has the leading ".". Gallery 2.2 rc 1, Gallery Remote beta 30.
I wonder if this is a Gallery problem though, and not a Gallery Remote problem. Did it used to be that Gallery only sent the domain, without the machine name?
I'm really hoping for a fix soon. I don't have a Java development env. set up, and doing so right now is not acceptable. Pity, since Gallery Remote is why I went with Gallery to begin with, and I've got a bunch of uploads to do.
Posts: 14
Hi,
From what I saw of the code in Gallery Remote I would still flag it as a GR issue.
I have attached my working Jar file to this thread. You should simply be able to unzip it and replace the old Jar file by this new one in your Gallery Install Dir.
Make a backup of the old Jar file of course in case things go bad.
Let me know if this works for you.
Serge
Posts: 25
Hi Serge,
Thanks for the JAR file, but in the intervening hour I found a different solution. Upgrading the Gallery Remote Interface plugin to 1.0.8 fixes it. IIRC, you have to pull down the list of experimental plugins to get this option. (Site Admin-Plugins-Get Updated list and so on) GR still has the leading ".", but it all functions.
At this point, I think both sides were buggy, and fixing either one makes it all work.
Thanks again,
Kevin
Posts: 14
Hi,
Great, in your case this has worked.
In my case I still had the same problem using Gallery Remote Interface plugin to 1.0.8 so I still think there is a bug.
The real bummer about this bug from what I have seen is that it manifests itself as galleries being "Read Only" with older versions of GR and with the latest version of the GR the galleries simply do not show up at all.
This is because dispite correct login you still become a guest user because the cookie is not maintained...
Serge
Posts: 15
I am having this exact problem. I am running 1.5.1b30 and gallery remote plugin 1.0.8 in gallery-2.2-rc-1. I can log in and there are no error messages except that I see in the console output that gr can't see any albums on the url. It also tells me that I am a guest user even though I have successfully logged in as admin.
Posts: 3
I'm getting what I think is the same problem. I can successfully log into Gallery, but am getting no albums back. The debug log clearly shows that the guest user was the one the query was performed with.
I've tried dropping in the .jar from above, but it crashes.
I've attached the log from running Gallery Remote Debug.exe. Really really love remote - makes uploading a large number of pictures really easy, so would be great to get it working again.
If there's anything else I can do or add that would help - please let me know.
Posts: 3
I've removed Gallery Remote and reinstalled the latest version (1.5.1-b36) and everything is now working. Got no idea what was wrong - but the main thing is that things are working again.