After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 354621 - Export to PicasaWeb crash
Export to PicasaWeb crash
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
CVS
Other Linux
: Normal major
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2006-09-06 13:43 UTC by Michael Monreal
Modified: 2006-09-25 18:43 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Patch to avoid the NullReferenceException (already in mono svn) (1.52 KB, patch)
2006-09-06 18:04 UTC, Gonzalo Paniagua Javier
committed Details | Review
try this (3.65 KB, patch)
2006-09-07 09:08 UTC, Stephane Delcroix
none Details | Review
a patch (13.99 KB, patch)
2006-09-17 06:44 UTC, Stephane Delcroix
accepted-commit_now Details | Review
oops, use this one instead (13.98 KB, patch)
2006-09-17 07:22 UTC, Stephane Delcroix
committed Details | Review

Description Michael Monreal 2006-09-06 13:43:44 UTC
I first thought this was releated to bug 354295 but i'm running on en_US so it is probably not...

I try to upload my fist picture to picasaweb, his is what I get on the console:

---
GoogleAccount.Connect()
System.NullReferenceException: Object reference not set to an instance of an obj ect
  at Mono.Google.MultipartRequest..ctor (System.String url) [0x00000]
  at Mono.Google.Picasa.PicasaWeb.CreateAlbum (System.String title, System.Strin g description, AlbumAccess access, DateTime pubDate) [0x00000]
  at Mono.Google.Picasa.PicasaWeb.CreateAlbum (System.String title, System.Strin g description, AlbumAccess access) [0x00000]
  at FSpot.GoogleAddAlbum.HandleAddResponse (System.Object sender, Gtk.ResponseA rgs args) [0x00000]
  at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_Respo nseArgs (object,Gtk.ResponseArgs)
  at Gtk.Dialog.ResponseSignalCallback (IntPtr arg0, Int32 arg1, IntPtr gch) [0x 00000]
  at (wrapper native-to-managed) Gtk.Dialog:ResponseSignalCallback (intptr,int,i ntptr)
  at <0x00000> <unknown method>
  at (wrapper managed-to-native) Gtk.Application:gtk_main ()
  at Gtk.Application.Run () [0x00000]
  at Gnome.Program.Run () [0x00000]
  at FSpot.Driver.Main (System.String[] args) [0x00000]
---

Followed by an error dialog saying:

---
An unhandled exception was thrown: Object reference not set to an instance of an object

  at Mono.Google.MultipartRequest..ctor (System.String url) [0x00000] 
  at Mono.Google.Picasa.PicasaWeb.CreateAlbum (System.String title, System.String description, AlbumAccess access, DateTime pubDate) [0x00000] 
  at Mono.Google.Picasa.PicasaWeb.CreateAlbum (System.String title, System.String description, AlbumAccess access) [0x00000] 
  at FSpot.GoogleAddAlbum.HandleAddResponse (System.Object sender, Gtk.ResponseArgs args) [0x00000] 
  at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_ResponseArgs (object,Gtk.ResponseArgs)
  at Gtk.Dialog.ResponseSignalCallback (IntPtr arg0, Int32 arg1, IntPtr gch) [0x00000] 
  at (wrapper native-to-managed) Gtk.Dialog:ResponseSignalCallback (intptr,int,intptr)
  at <0x00000> <unknown method>
  at (wrapper managed-to-native) Gtk.Application:gtk_main ()
  at Gtk.Application.Run () [0x00000] 
  at Gnome.Program.Run () [0x00000] 
  at FSpot.Driver.Main (System.String[] args) [0x00000] 
.NET Version: 1.1.4322.2032

Assembly Version Information:

Mono.Security (1.0.5000.0)
System.Xml (1.0.5000.0)
gnome-keyring-sharp (0.0.0.0)
FlickrNet (1.1.0.0)
google-sharp (0.0.0.0)
gconf-sharp (2.16.0.0)
pango-sharp (2.10.0.0)
SemWeb (0.5.0.2)
glade-sharp (2.10.0.0)
gtkhtml-sharp (2.16.0.0)
System.Data (1.0.5000.0)
Mono.Data.SqliteClient (1.0.5000.0)
gdk-sharp (2.10.0.0)
gnome-vfs-sharp (2.16.0.0)
dbus-sharp (0.62.0.0)
System (1.0.5000.0)
Mono.Posix (1.0.5000.0)
atk-sharp (2.10.0.0)
gtk-sharp (2.10.0.0)
glib-sharp (2.10.0.0)
gnome-sharp (2.16.0.0)
f-spot (0.2.0.0)
mscorlib (1.0.5000.0)

Platform Information: Linux 2.6.15-23-k7 i686 unknown GNU/Linux

Disribution Information:

[/etc/debian_version]
testing/unstable

[/etc/lsb-release]
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=6.06
DISTRIB_CODENAME=dapper
DISTRIB_DESCRIPTION="Ubuntu 6.06 LTS"
---

Note, this is when I try to add a *new* album for export. I also tried to export to a public album I set up using the web, but then I get

---
(f-spot:15963): libf-WARNING **: adding marker: 225, Exif
System.UnauthorizedAccessException: You are not authorized to upload to this album.
  at Mono.Google.Picasa.PicasaAlbum.UploadPicture (System.String title, System.String description, System.IO.Stream input) [0x00000]
  at Mono.Google.Picasa.PicasaAlbum.UploadPicture (System.String filename, System.String description) [0x00000]
  at FSpot.GoogleExport.Upload () [0x00000]
---
Comment 1 Michael Monreal 2006-09-06 13:49:30 UTC
Just to make it clear, I think f-spot logs in to picasaweb just fine, it takes some seconds to open the export dialog and it shows the "Test" gallery I created using the web interface. Also, I marked this gallery as "public" and I don't really see why I shouldn't be authorized to export to that gallery...
Comment 2 Gonzalo Paniagua Javier 2006-09-06 18:02:10 UTC
The problem is that you're not using an authorized connection.
I fixed the nullref and it will now tell you that you're not authorized to create/delete an album if you're not properly authenticated.
Comment 3 Gonzalo Paniagua Javier 2006-09-06 18:03:24 UTC
Oops. Hit enter to soon...

So, the fix to prevent the nullref in Mono.Google will be attached. It's up to f-spot to keep authorized GoogleConnection around.
Comment 4 Gonzalo Paniagua Javier 2006-09-06 18:04:23 UTC
Created attachment 72323 [details] [review]
Patch to avoid the NullReferenceException (already in mono svn)
Comment 5 Michael Monreal 2006-09-06 18:17:19 UTC
hmm so can I theoretically build google-sharp from svn and drop the dll into f-spot?

but then... why am I not properly authenticated in the first place? I got username/pass right...
Comment 6 Gonzalo Paniagua Javier 2006-09-06 18:42:46 UTC
If you know how to use tcpdump or ethereal, perhaps you can take a look at what goes on the wire and see what's going on... May be a redirect that removes the cookies?

Comment 7 Tomasz Adamski 2006-09-06 19:09:55 UTC
I have the same problem with Picasa export, but few days ago IT WAS WORKING. I could not create a new album from f-spot then, but I could upload photos to my albums.
Comment 8 Michael Monreal 2006-09-06 20:51:43 UTC
@Gonzalo

I just had a look at ethereal, not knowing how the communication *should* work I can't see anything suspicious here... I filtered for picasaweb.google.com, is there anything going on outside that that I miss now?

Also, I first checked picasa support when it was checked in and it never works for me...
Comment 9 Stephane Delcroix 2006-09-07 09:08:52 UTC
Created attachment 72367 [details] [review]
try this

The patch for F-Spot, including the google-sharp one + catching the exception.

I still can't reproduce this, so test it and report...
Comment 10 Michael Monreal 2006-09-07 12:05:49 UTC
So I just tested that last patch and I still have the same problem (no crash dialog of cause). On the console I get:

---
System.UnauthorizedAccessException: You are not authorized to upload to this album.
  at Mono.Google.Picasa.PicasaAlbum.UploadPicture (System.String title, System.String description, System.IO.Stream input) [0x00000]
  at Mono.Google.Picasa.PicasaAlbum.UploadPicture (System.String filename, System.String description) [0x00000]
  at Mono.Google.Picasa.PicasaAlbum.UploadPicture (System.String filename) [0x00000]
  at FSpot.GoogleExport.Upload () [0x00000]
---

when I try to export to my "Test" gallery. When I try to make a new gallery it also doesn't crash anymore but it doesn't show anything gui-wise and just the following on the command line:

---
You are not authorized to create albums.
---

I have now created a second gallery on http://picasaweb.google.com/michael.monreal and manually uploaded one picture to each using the web. This works without a problem. Starting f-spot again after that it directly showd the second gallery in the gallery dropdown, so I supposed it logged in correctly... but why does it thing it is not authenticated?
Comment 11 Stephane Delcroix 2006-09-07 19:19:15 UTC
That helps a lot !!!

I thought that your issue was only when "creating" albums, but you can't upload neither !!!
But you can logon...

Apparently, you can logon with an null or empty password (e.g. to someone else gallery) and view public albums and pictures. That's probably what you're doing...

Can you please check (e.g. in gnome-keyring) that your password is not empty ?

If this still happens, please send me or gonzalo by email the output of this:
tcpdump -w out.cap -s 1500 tcp port 80
Comment 12 Stephane Delcroix 2006-09-12 11:35:31 UTC
Michael, Tomasz, thanks for the dump files...
Comment 13 Michael Monreal 2006-09-12 12:55:30 UTC
No problem.

Do you have a clue now what's the problem or do you need further data?
Comment 14 Gonzalo Paniagua Javier 2006-09-13 16:18:43 UTC
I just checked the 2 dumps.

They both have in common that they get a "GoogleAccountsLocale_session=de" (or =pl) and then, when querying for the URLs they don't get the 'post' URL, which is the one used to upload pictures and send create/delete/... commands to the server.

I don't get that cookie when using my account and I also noticed that we're sending cookies that are not supposed to be sent (for example, one has a /accounts path and it's sent to /api). I'm going to fix that in mono and will get back to you with instructions on how to test if that fixes the issue.

Thanks.
Comment 15 Gonzalo Paniagua Javier 2006-09-13 18:12:51 UTC
Can you guys try http://gonzalo.name/tmp/Mono.Google.dll.gz ?
You have un gunzip it and copy it over the one installed by f-spot. Let me know if that one makes any difference.
Comment 16 Tomasz Adamski 2006-09-13 18:29:18 UTC
I replaced this file with /usr/local/lib/f-spot/google-sharp.dll [cause I didn't find Mono.Google.dll file]. I don't see any change.
Comment 17 Michael Monreal 2006-09-13 20:19:09 UTC
For me there's actually a change:

when opening the export dialog now it crashes before completly opening the dialog (it is open in the background but before I can do something I get this error:

---
Can not connect to Picasa. Bad username ? password ? network connection ?
System.Net.WebException: The remote server returned an error: (404) Not Found.
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000]
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000]
---
Comment 18 Michael Monreal 2006-09-13 20:29:45 UTC
Just made another tcpdump capture and sent it to you, Gonzalo.

Also, you mentioned the "GoogleAccountsLocale_session=de". I'm located in germany but my google account is set to english (it is one of the pre-@googlemail.com accounts) as well as all of my desktop (en_US). Dunno if this is relevant.
Comment 19 Gonzalo Paniagua Javier 2006-09-15 13:27:20 UTC
I've uploaded a new Mono.Google.dll to http://gonzalo.name/tmp/Mono.Google.dll.gz (MD5 90199ac239141ef4c3389c95555e465b).

This use uses a different authentication mechanism that should fix the issue for you. As a side effect it should also work on windows, but i have not tried it yet.

Let me know if it works fine for you.
Comment 20 Tomasz Adamski 2006-09-15 13:40:23 UTC
Yes, now it works fine ;). All. Thanks for a good job.
Comment 21 Michael Monreal 2006-09-15 13:47:47 UTC
Hmm... not for me. I get a "Error Connecting to Gallery - Please verify that the settings for this gallery are correct" message as soon as I open the export dialog and the following on the console:

---
GoogleAccount.Connect()
Can not connect to Picasa. Bad username ? password ? network connection ?
---

I also tried removing the key from the keryring, in that case the dialog
starts and I can add my account but it pops up the same dialog then. username /
pass are right of cause...

Would you like another tcpdump?
Comment 22 Gonzalo Paniagua Javier 2006-09-15 14:22:46 UTC
I assume you're using current cvs. Can you print the exception around line 680 in PicasaWebExport.cs?

Also make sure that you overwrote the old Mono.Google.dll with the new one I uploaded. The tcpdump that you sent me is not a picasaweb+f-spot session, but gmail (and also the format is not that of tcpdump...?)
Comment 23 Michael Monreal 2006-09-15 15:13:50 UTC
The exception:

System.Net.WebException: The remote server returned an error: (403) Forbidden.
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000]
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000]
Can not connect to Picasa. Bad username ? password ? network connection ?

This is using the new dll and very latest cvs (just rebuild from clean checkout).

The tcpdump... well I used sudo tcpdump -i wlan0 -w out.cap -s 1500 tcp port 80
There may be a gmail session also because my webbrowser was open I think... :/
Comment 24 Michael Monreal 2006-09-15 15:18:18 UTC
Hmm just noticed I don't get any hits at all now using that tcpdump cammand, do you use another port now?
Comment 25 Gonzalo Paniagua Javier 2006-09-15 19:15:16 UTC
The fixes are in google-sharp module in mono svn. They need to be copied over to f-spot. Stephane?
If you want, I can do that too.
Comment 26 Stephane Delcroix 2006-09-16 08:07:58 UTC
Sure, I'll do !
Comment 27 Stephane Delcroix 2006-09-16 11:56:50 UTC
Gonzalo,

apparently, you added some debug on the command line in Mono.Google. I guess we should hide the password on that line (now it's displayed in clear text).
Comment 28 Stephane Delcroix 2006-09-16 16:33:51 UTC
Gonzalo,

the latest google-sharp is not working for me !
The log from the console is below, I just masked my password.

GoogleAccount.Connect()
Email=sdelcroix%40gmail.com&Passwd=XXXXXXXXX&source=f-spot-0.2.1.0&PersistentCookie=0&accountType=HOSTED%5FOR%5FGOOGLE
Can not connect to Picasa. Bad username ? password ? network connection ?
System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.Google.GoogleConnection+CookieParser..ctor (System.String header, Int32 position) [0x00000]
  at Mono.Google.GoogleConnection+CookieParser..ctor (System.String header) [0x00000]
  at Mono.Google.GoogleConnection.AddCookiesFromHeader (System.Uri uri, System.String header) [0x00000]
  at Mono.Google.GoogleConnection.DownloadString (System.String url) [0x00000]
  at Mono.Google.Picasa.PicasaWeb.GetAlbums () [0x00000]
  at FSpot.GoogleExport.PopulateAlbumOptionMenu (Mono.Google.Picasa.PicasaWeb picasa) [0x00000]
  at FSpot.GoogleExport.Connect (FSpot.GoogleAccount selected) [0x00000]
  at FSpot.GoogleExport.Connect () [0x00000]
  at FSpot.GoogleExport.HandleAccountSelected (System.Object sender, System.EventArgs args) [0x00000]
  at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
...
Comment 29 Gonzalo Paniagua Javier 2006-09-16 18:43:27 UTC
Oops. Sorry about that. The problem is fixed in svn and I have successfully used the assembly with f-spot for creating an album and uploading sme pictures.
Comment 30 Stephane Delcroix 2006-09-17 06:44:20 UTC
Created attachment 72925 [details] [review]
a patch

Gonzalo, don't be sorry for that ;)

Here's a patch applying cleanly against f-spot CVS. It adds the latest changes by Gonzalo from google-sharp svn.
Comment 31 Stephane Delcroix 2006-09-17 07:22:55 UTC
Created attachment 72927 [details] [review]
oops, use this one instead

really minor change in the Makefile.am
Comment 32 Michael Monreal 2006-09-19 17:24:10 UTC
This is a nightmare... I changed my google account password (don't know if this is the cause) and now f-spot is *again* unable to connect to picasa. Why am I the only one having these problems? :( My f-spot installation is from HEAD as of 10 minzes ago, so the google-sharp stuff should be the newest available?

[Yes I changed the password in the keyring and I double and tripple checked that it's correct...]
Comment 33 Stephane Delcroix 2006-09-20 07:04:01 UTC
Apparently, the latest google-sharp no longer support your single username but requires your full gmail address.

Can you say a bit more ?

I re-open the bug for your issue
Comment 34 Michael Monreal 2006-09-20 10:54:29 UTC
I just get 

---
GoogleAccount.Connect()
Can not connect to Picasa. Bad username ? password ? network connection ?
---

while loading the export dialog. A password question dialog is opened directly, It has the correct username (gmail adress, I always used the full address) and password (at least in gnome-keyring-manager it's the right one).  

Then I put in the username/pass again and press enter, the same dialog will open again, ultimatly leaving me with many password dialogs open...

I'm really sorry that I'm the one always causing the problems with this but I'm also totally at a loss why it just stops working from one day to another :/
Comment 35 Stephane Delcroix 2006-09-20 11:26:27 UTC
I need to solve the issue of having many dialog open, but your problem do not start at that point...
Comment 36 Michael Monreal 2006-09-20 12:29:50 UTC
As tested with Stephane, the exception thrown is the following:

GoogleAccount.Connect()
Can not connect to Picasa. Bad username ? password ? network connection ?
System.Net.WebException: The remote server returned an error: (403) Forbidden.
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000]
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000]

Also, there is no traffic going to 80 (yet)
Comment 37 Stephane Delcroix 2006-09-20 14:58:47 UTC
apparently, it's working now...

I close it again :/
Comment 38 Michael Monreal 2006-09-25 12:40:50 UTC
Reopening this for the last time ;)

After f-spot started working magically again last week I had a chat with Gonzalo about a possible captcha. I was then away for the weekend and today f-spot failed again to connect to picasa. So I did what Gonzalo told me and I can now confirm that the problem is captcha releated. After unlocking the captcha f-spot connects happyly again.

The WebException thrown while trying to connect:
---
CaptchaToken=UlXmNMBMOQRbPGTxwR6FdwtEhNXQjJdTpxH9-Qc6EYKVKg7Ixw7xbhQlyi8u5ITKs2S-sRW89IIXTU7qJcMxs8gKMolXqb0sv3uCVt6dqk8:rMq2itKqw7lwQHBvikdbOg
CaptchaUrl=Captcha?ctoken=UlXmNMBMOQRbPGTxwR6FdwtEhNXQjJdTpxH9-Qc6EYKVKg7Ixw7xbhQlyi8u5ITKs2S-sRW89IIXTU7qJcMxs8gKMolXqb0sv3uCVt6dqk8%3ArMq2itKqw7lwQHBvikdbOg&email=michael.monreal%40gmail.com&cstyle=0
Error=cr
Url=https://www.google.com/accounts/ErrorMsg?Email=michael.monreal%40gmail.com&id=cr&timeStmp=1159187178&secTok=fb14d11916cd7b84689d3cb9464b7fa2
---
Comment 39 Gonzalo Paniagua Javier 2006-09-25 17:19:18 UTC
Oh, man I love it when my gut feelings are right :)
Should we open a new bug? Because this has nothing to do with the initial crash...

I'll work on providing captcha information in a exception later today.
Comment 40 Stephane Delcroix 2006-09-25 18:43:24 UTC
ok, I opened bug #357661 to follow this latest issue.