Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrobbler.ScrobbleAsync() sometimes throws "StackOverflowException: Value was either too large or too small for an Int32" #109

Open
Reyth3 opened this issue Oct 6, 2017 · 2 comments

Comments

@Reyth3
Copy link

Reyth3 commented Oct 6, 2017

As I mentioned in the title, sometimes when I'm scrobbling some data to last.FM I get this exception. Here is the stack trace:

 at System.Convert.ToInt32(Double value)
 at IF.Lastfm.Core.Api.Commands.Track.ScrobbleCommand.SetParameters()
 at IF.Lastfm.Core.Api.Commands.PostAsyncCommandBase`1.<ExecuteAsyncInternal>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at IF.Lastfm.Core.Scrobblers.ScrobblerBase.<ScrobbleAsyncInternal>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
 at MusicBoxComponents.BackgroundScrobbler.<Run>d__1.MoveNext()

I'm using the SQLiteScrobbler with an SQLite file to store my cache.

Here's the data I tried to scrobble:

{
    "IgnoredReason":null,
    "Artist":"ALI PROJECT",
    "AlbumArtist":null,
    "Album":"卑弥呼外伝",
    "Track":"卑弥呼外伝",
    "TimePlayed":"2017-10-06T23:17:30.1612461+02:00",
   "ChosenByUser":true,
   "Duration":"00:07:03"
}

Am I setting some value incorrectly?

Thank you!

Edit: Is this because of the ChosenByUser value? It seems to be the only parameter being set directly using Convert.ToInt32.

@rikkit
Copy link
Member

rikkit commented Nov 15, 2017

Thanks for the report @Reyth3 , I will investigate this soon. #105 and #107 is the priority right now however.

@rikkit rikkit added the bug label Nov 15, 2017
@rikkit rikkit added this to the 1.0.1 milestone Nov 15, 2017
@Reyth3
Copy link
Author

Reyth3 commented Nov 16, 2017

@rikkit actually, turned out it was my out-of-process background task having trouble with parsing the JSON into a scrobble object.

Still, it would be great if you could add some sort of an indicator that the scrobble data is incorrect (throw specific exception when the scrobble or any of the required values is null or something to that effect).

Cheers!

@rikkit rikkit modified the milestones: 1.1, 1.1.1 Jul 1, 2018
@rikkit rikkit removed this from the 1.1.1 milestone Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants