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 707645 - Cannot log into my lastfm account (NullReferenceException in RequestAuthorization)
Cannot log into my lastfm account (NullReferenceException in RequestAuthoriza...
Status: RESOLVED WONTFIX
Product: banshee
Classification: Other
Component: Last.fm
2.6.0
Other Linux
: Normal normal
: ---
Assigned To: Banshee Maintainers
Banshee Maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2013-09-06 17:07 UTC by nico.franza
Modified: 2020-03-17 10:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Debug log of banshee that contains debug info about logging in last.fm account (12.09 KB, text/plain)
2013-09-06 17:07 UTC, nico.franza
  Details
Banshee debug log (12.39 KB, text/plain)
2013-09-11 19:06 UTC, nico.franza
  Details
Correctly handle HTTP request exception during Last.FM authentication (5.53 KB, patch)
2013-09-15 00:44 UTC, Phil Trimble
none Details | Review

Description nico.franza 2013-09-06 17:07:22 UTC
Created attachment 254285 [details]
Debug log of banshee that contains debug info about logging in last.fm account

OS: Linux Mint 15 Cinnamon

After I installed brand new OS on my notebook I opened Banshee player. First to do I went to last.fm scrobbler and tried to log in. I was't transferred to last.fm web page to approve Banshee to scrobble my music as usual. My first thought: "Last time I used Banshee on another PC I already approved Banshee so I think I should delete it at first from my approved apps page". After I deleted it I opened Banshee again and tried to log in again. I opened scrobbler's settings and clicked 'Try again' but nothing happened. Then I clicked on 'Finish logging in' and nothing happened. So I cannot log into my last.fm account and scrobble music.

I attached the debug log that was created while I was fooling around with this two buttons.

Feel free to ask more info, I'll be glad to help.
Comment 1 Andrés G. Aragoneses (IRC: knocte) 2013-09-06 18:09:15 UTC
Can you get debug packages of banshee? It would tell us the exact line where the NRE is happening:

[1 Warn  20:51:02.285] Error in Lastfm.Account.RequestAuthorization - System.NullReferenceException: Object reference not set to an instance of an object (in `Lastfm')
  at Lastfm.Account.RequestAuthorization () [0x00000] in <filename unknown>:0
Comment 2 nico.franza 2013-09-06 22:42:00 UTC
Andrés, what actions should I perform to do this? Thanks.
Comment 3 Andrés G. Aragoneses (IRC: knocte) 2013-09-11 10:15:54 UTC
Sorry for the delay nico. You might find a banshee package that ends with "-dbg", it's called a debug package. If you don't find it, you may need to enable some "debug packages repo", depending on your distribution. Another alternative to get the exact line number of the failure is compiling banshee yourself. If you want to do this, follow this guide (but I recommend you to use the "stable-2.6" branch, not master): http://banshee.fm/download/development/
Comment 4 nico.franza 2013-09-11 19:06:24 UTC
Created attachment 254731 [details]
Banshee debug log
Comment 5 Andrés G. Aragoneses (IRC: knocte) 2013-09-11 19:49:48 UTC
Thanks Niko!

Phil, niko provided a stack trace with line numbers, do you mind looking at it? Take in account that the code corresponds to 2.6.0, not 2.6.1 or master!
Comment 6 Phil Trimble 2013-09-12 03:45:02 UTC
Sure thing! I've looked into the code and I see where the error is occurring. Banshee receives a 'NameResolutionFailure' when it attempts to perform an HTTP request to the 'http://ws.audioscrobbler.com/2.0/' URL. That's the first question: why is Nico receiving this? 

Nico, if you attempt to go to that URL in your browser can you tell us what happens? For reference, I receive an XML response that has an 'Invalid Method - No method with that name in this package' message from the Last.FM service. Do you have some kind of proxy or some perhaps have custom DNS servers that cause that URL to not resolve correctly? You should at least receive something in response, even if it is a similar error.

Second question is: why doesn't Banshee recover gracefully from this error? I am able to recreate the bug by changing the target Last.FM URL to some garbage address. My feeling is that we should display something to the user when the initial contact failed rather than this confusing state where a user is unable to proceed.

I will continue to dig and attempt to come up with a solution on that front.
Comment 7 nico.franza 2013-09-12 18:31:27 UTC
When I go to this URL using browser it says same as yours:

<lfm status="failed">
<error code="3">
Invalid Method - No method with that name in this package
</error>
</lfm>

As far as I can see Banshee was developed using Mono. I have some experience with C# (not Mono, only MS .NET Framework), so maybe I can debug it to see what happens if you teach me how to set up the environment?
Comment 8 Phil Trimble 2013-09-15 00:44:34 UTC
Created attachment 254953 [details] [review]
Correctly handle HTTP request exception during Last.FM authentication

I can definitely help with environment setup for debugging but I'm going to need to think a bit on why only Banshee cannot reach that address. If you want to get started you can follow the instructions here: http://banshee.fm/contribute/write-code/

Can you do another test in the meantime? Can you tell me whether you can access Youtube or the Amazon Store or the eMusic store from within Banshee? Is this Last.fm signup the only network action that is failing?

Also, do you have any kind of special proxy or networking situation on your machine? I did some googling to try to figure out what the 'NameResolutionError' could mean and I found this on stackoverflow: http://stackoverflow.com/questions/12922062/nameresolutionfailure-in-mono-but-not-net

It states that a user was able to use a proxy in their browser but for some reason using a Mono app would throw this error. Are you using any kind of proxy?

On the other front, your issue of only seeing the 'Try again' and 'Finish Logging In' buttons is definitely a bug. I've produced a patch that will at least make for a better user experience in this kind of situation.

Unfortunately I think the rest of this weekend I will be unavailable but before I took off I wanted to post this patch to solicit feedback so we can keep things moving. Andrés, can you please give it a look? I'd be happy to answer questions later this weekend.
Comment 9 nico.franza 2013-09-15 18:25:13 UTC
Thanks for the instructions, I will seek through them when I have free time.

> Can you do another test in the meantime? Can you tell me whether you can access
Youtube or the Amazon Store or the eMusic store from within Banshee? 

When I click on youtube extension in the context pane it says "Loading..." and loading never ends. When I click Wikipedia in the context pane it opens the proper webpage. When I open Amazon MP3 Store in Online Media category it opens Amazon page and I can log in (but I'm not registered in Amazon).

> It states that a user was able to use a proxy in their browser but for some
reason using a Mono app would throw this error. Are you using any kind of
proxy?

I'm not using any proxy, at least I don't know about it.
Comment 10 Phil Trimble 2013-10-24 03:26:20 UTC
Hi again, unfortunately I don't have any good information for you about the actual connection issues. I've not been able to replicate it on my own machines. I've been trying different proxy situations to see if I can't cause the same problem...I know that you said you aren't using a proxy but I'm hoping if I can reliably replicate the problem it might give me some ideas.

I won't be offended if you don't want to dig into it any more considering that I am running blind but could you tell me what version of mono you are using in Mint? You can find that with 'mono --version'.
Comment 11 nico.franza 2013-10-28 15:25:35 UTC
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-5ubuntu1)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            Included Boehm (with typed GC and Parallel Mark)
Comment 12 André Klapper 2020-03-17 10:01:50 UTC
Banshee is not under active development anymore and had its last code changes more than three years ago. Its codebase has been archived.

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Please feel free to reopen this ticket (or rather transfer the project
to GNOME Gitlab, as GNOME Bugzilla is being shut down) if anyone takes the
responsibility for active development again.
See https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/264 for more info.