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 585902 - Facebook export "Login" button crashes f-spot
Facebook export "Login" button crashes f-spot
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Export
GIT
Other All
: Normal critical
: 0.6.0
Assigned To: F-spot maintainers
F-spot maintainers
: 589816 592536 594271 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-06-15 19:08 UTC by Jim Ramsay
Modified: 2009-10-18 19:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jim Ramsay 2009-06-15 19:08:57 UTC
Steps to reproduce:
1. Select photos, and do Photos > Export > facebook...

2. Click on the "Login" button.  My browser opens up to the facebook apps page, and I add the App.  However, meanwhile the export has failed with "Error logging into Facebook" and the following on the console (Note, this is non-fatal, if a bit annoying):

FacebookException: Code: 100, Message: Invalid parameter
  at Mono.Facebook.Util.GetResponse[SessionInfo] (System.String method_name, Mono.Facebook.FacebookParam[] parameters) [0x00000] 
  at Mono.Facebook.FacebookSession.GetSessionFromToken (System.String auth_token) [0x00000] 
  at Mono.Facebook.FacebookSession.GetSession () [0x00000] 
  at FSpot.Exporter.Facebook.FacebookAccount.get_Authenticated () [0x00000]

3. From now on when I click the "Login" button of the Facebook export dialog, even after exiting and restarting f-spot, f-spot will crash.

Stack trace:
Marshaling clicked signal
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: There is an error in XML document. ---> System.InvalidOperationException: <friends_get_response xmlns='http://api.facebook.com/1.0/'> was not expected
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot (System.Xml.Serialization.XmlTypeMapping rootMap) [0x00000] 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x00000] 
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] 
  --- End of inner exception stack trace ---
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] 
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader) [0x00000] 
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.Stream stream) [0x00000] 
  at Mono.Facebook.Util.GetResponse[FriendsResponse] (System.String method_name, Mono.Facebook.FacebookParam[] parameters) [0x00000] 
  at Mono.Facebook.FacebookSession.GetFriends () [0x00000] 
  at FSpot.Exporter.Facebook.FacebookExport.HandleLoginClicked (System.Object sender, System.EventArgs args) [0x00000] 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] 
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] 
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at FSpot.Driver.Main(System.String[] args)

Other information:
Running git commit ID fb1385a21ab593d77c894dc8af1e81bd52ac3504

Browser in question is firefox 3.0.10
Comment 1 Jim Ramsay 2009-06-17 15:52:15 UTC
I have tracked down and fixed the error!

Short answer: Mono.Facebook tried to fit all facebook UIDs into a type 'int', when it should have been a type 'long'.  Apparently one of my friends' UIDs is greater than an Int32 can handle.

Patch: http://gitorious.org/f-spot/mainline/merge_requests/692
Comment 2 Ruben Vermeersch 2009-06-17 16:11:32 UTC
Good stuff! Merged! Thanks a lot for this

commit edb2707703b8faf4154a12875edff8644e993325
Merge: 53c12eb... 0311844...
Author: Ruben Vermeersch <ruben@savanne.be>
Date:   Wed Jun 17 18:06:50 2009 +0200

    Merge commit 'lack/facebook'
Comment 3 Andreas Sandberg 2009-07-27 16:04:08 UTC
This still seems to be an issue, there are several other places where IDs are stored as int. At least the following classes should still be affected by this: Album, FriendInfo, Group, Photo

Don't know how many of them are actually used, but it seems like people have run into issues very similar to the one in this report, but with 'photos_getAlbums_response' instead of 'friends_get_response'.

Suggesting that the bug is reopened.
Comment 4 Maxxer 2009-08-03 06:52:45 UTC
*** Bug 589816 has been marked as a duplicate of this bug. ***
Comment 5 Maxxer 2009-08-21 07:57:47 UTC
*** Bug 592536 has been marked as a duplicate of this bug. ***
Comment 6 Jim Ramsay 2009-08-21 13:05:28 UTC
Agreed, there were still some cases where long data from facebook was being represented internall as int.

Fixed in:

http://gitorious.org/f-spot/mainline/merge_requests/1290
Comment 7 Jim Ramsay 2009-08-21 13:24:55 UTC
Update: Fix is actually in:

http://gitorious.org/f-spot/mainline/merge_requests/1291
Comment 8 Maxxer 2009-08-21 14:13:35 UTC
Andreas (comment #3): thanks for your suggestions, now should be fixed.

commit f946dc0972e4d290a7267649e4229432b1849255
Author: Jim Ramsay <i.am@jimramsay.com>
Date:   Fri Aug 21 08:59:18 2009 -0400

    Bug 585902: Updated all elements based on facebook.xsd
    
    There were still many places where UIDs and other longs were represented
    internally is int.  This is now fixed in all the places I could find.
    
    Bumping FacebookExport addin version

commit 6d8726f0b6e742970382a0c3d1ce61b79d62e0d5
Author: Jim Ramsay <i.am@jimramsay.com>
Date:   Fri Aug 21 08:58:30 2009 -0400

    Added facebook.xsd as a reference
    
    All classes here should be checked for type compliance.
Comment 9 Maxxer 2009-10-18 19:16:16 UTC
*** Bug 594271 has been marked as a duplicate of this bug. ***