error sending data to last.fm: BADSESSION

Bug #567173 reported by JasonBoissiere
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MTP-Lastfm
Fix Committed
Medium
Daniel Woodhouse

Bug Description

Running Lucid Lynx Kubuntu. Installed today's update and the app connected happily to my c905 SE phone. Scrobbling from this device has worked before. My 40 recent plays are found and listed as pending in the details pop-up. However scrobbling fails like this:
Scrobbling started 2.0 hours ago
Preparing 40 tracks for scrobbling
Sending tracks, waiting for reply...
There was an error sending data to last.fm:
BADSESSION
I'm listening on Amarok right now and those tracks are scrobbling in real-time. Bulk pushing plays from my rockbox-enabled ipod with the command-line last.fm tool worked in parallel with Amarok, staggering the scrobble times to now in the same way mtp-lastfm does, so the problem appears to be mtp-lastfm specific. I tried pushing the scrobble time back manually and apart from the timestamp in the message changing, no difference.
There's no errors.log file under ~/.mtp-lastfm and the db.log contains only the warnings about invalid files (locally-created video recordings) that the information button pops-up. Nothing on the command-line.

Revision history for this message
Daniel Woodhouse (wodemoneke) wrote :

From Last.fm:
BADSESSION
This indicates that the Session ID sent was somehow invalid, possibly because another client has performed a handshake for this user. On receiving this, the client should re-handshake with the server before continuing.

At the moment MTP-Lastfm only does a handshake at startup so if amarok or another media player did a handshake it would be rendered invalid. This is an easy enough fix.

Changed in mtp-lastfm:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Daniel Woodhouse (wodemoneke)
Revision history for this message
JasonBoissiere (jason-boissiere-gmail) wrote : Re: [Bug 567173] Re: error sending data to last.fm: BADSESSION

To confirm, if I time both the startup and scrobbling to fall between
amarok's scrobbling, it completes as expected, so your analysis seems
spot-on.

Jason

On 20 April 2010 12:00, Daniel Woodhouse <email address hidden> wrote:

> >From Last.fm:
> BADSESSION
> This indicates that the Session ID sent was somehow invalid, possibly
> because another client has performed a handshake for this user. On receiving
> this, the client should re-handshake with the server before continuing.
>
> At the moment MTP-Lastfm only does a handshake at startup so if amarok
> or another media player did a handshake it would be rendered invalid.
> This is an easy enough fix.
>
> ** Changed in: mtp-lastfm
> Importance: Undecided => Medium
>
> ** Changed in: mtp-lastfm
> Status: New => In Progress
>
> ** Changed in: mtp-lastfm
> Assignee: (unassigned) => Daniel Woodhouse (wodemoneke)
>
> --
> error sending data to last.fm: BADSESSION
> https://bugs.launchpad.net/bugs/567173
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Daniel Woodhouse (wodemoneke) wrote :

I'm having trouble reproducing this, using Amarok 1.4 I can scrobble from both programs simultaneously with no issues, it may be related to Amarok 2. I have however fixed it (I think). Can I ask you to copy the attached file into the MTP-Lastfm install directory (probably /usr/share/pyshared/mtplastfm) and confirm that this works.

Revision history for this message
JasonBoissiere (jason-boissiere-gmail) wrote :

I'm afraid not. I copied that file over the extant version and tested the previously-broken behaviour; start mtp-lastfm while amarok is playing tracks, make sure amarok has scrobbled something after mtp-lastfm started, try and scrobble the mtp tracks. Still failed with the badsession message. I am running amarok 2.3.0. I'll note that Amarok grabs my mtp device as soon as it's connected, so I have to disconnect it before mtp-lastfm can do anything, but once amarok has disconnected, mtp-lastfm doesn't have any problems getting access.

Revision history for this message
Daniel Woodhouse (wodemoneke) wrote :

Sorry about that, this version should work.

Revision history for this message
Daniel Woodhouse (wodemoneke) wrote :

Disregard that last attachment, it contains a failing test and wont work. This one should.

Revision history for this message
JasonBoissiere (jason-boissiere-gmail) wrote :

Tested both attachments and the second one seems to work as expected. Amarok scrobbling post-startup no longer blocks mtp-lastfm and amarok can subsequently scrobble further tracks after mtp-lastfm is done. I think this is resolved by the most recent scrobbler.py.

Revision history for this message
Daniel Woodhouse (wodemoneke) wrote :

Great, It'll be in the next release.

Changed in mtp-lastfm:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.