arkq / cmusfm

Last.fm standalone scrobbler for the cmus music player
GNU General Public License v3.0
232 stars 5 forks source link

Connected but not scrobbling (Invalid method signature supplied error) #43

Closed bnsv closed 3 years ago

bnsv commented 3 years ago

DEBUG ../../src/libscrobbler2.c:117: Check: status: 28, body: (null)

status 28 => CURLE_OPERATION_TIMEDOUT

It seems that you've got some kind of network related issue. Please check if https://ws.audioscrobbler.com/2.0/ (or whichever service you've got defined in the cmusfm.conf file) is reachable from your host.

EDIT: Also, please report this issue as a separate one, because it's not related to "missing required parameter" topic.

Originally posted by @Arkq in https://github.com/Arkq/cmusfm/issues/40#issuecomment-851670971

Hello again. My scrobbling is stopped for a couple day, now with "Invalid method signature" error.

cmusfm init
Checking previous session (user: bensisva) ...DEBUG ../../src/libscrobbler2.c:348: Session validation wrap
DEBUG ../../src/libscrobbler2.c:310: Now playing: 0
DEBUG ../../src/libscrobbler2.c:313: Payload:  - (null) ((null)) - 0.  (0s)
DEBUG ../../src/libscrobbler2.c:174: Signature data: api_key670820e45dab1f6433da72a00e3bc037aartistmethodtr
36e3ae
DEBUG ../../src/libscrobbler2.c:218: Request: api_key=670820e45dab1f6433da72a00e3bc037a&artist=&method=trac
8f0267c28e0582a6d
DEBUG ../../src/libscrobbler2.c:57: Read: size: 129, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="13">Invalid method signature supplied</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:117: Check: status: 0, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="13">Invalid method signature supplied</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:330: Now playing status: 3
failed.
Fetch new session key [yes/NO]: no
arkq commented 3 years ago

Could you post full output log? The one you've posted seems to be truncated on the right edge... With the newest master code (release v0.4.0) there suppose to be a string "xxxxxxxxxxxxxxx" somewhere.

bnsv commented 3 years ago

Oh.. You're right, I am sorry. Here it is:

Checking previous session (user: bensisva) ...DEBUG ../../src/libscrobbler2.c:348: Session validation wrapper
DEBUG ../../src/libscrobbler2.c:310: Now playing: 0
DEBUG ../../src/libscrobbler2.c:313: Payload:  - (null) ((null)) - 0.  (0s)
DEBUG ../../src/libscrobbler2.c:174: Signature data: api_key670820e45dab1f6433da72a00e3bc037aartistmethodtrack.updateNowPlayingskxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtrack02fcbc90341a01f21c3bfc05b636e3ae
DEBUG ../../src/libscrobbler2.c:218: Request: api_key=670820e45dab1f6433da72a00e3bc037a&artist=&method=track.updateNowPlaying&sk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&track=&api_sig=f5f6a4ebcfca0b18f0267c28e0582a6d
DEBUG ../../src/libscrobbler2.c:57: Read: size: 129, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="13">Invalid method signature supplied</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:117: Check: status: 0, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="13">Invalid method signature supplied</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:330: Now playing status: 3
failed.
Fetch new session key [yes/NO]:
agalloch commented 3 years ago

Hello, I've got the same issue - using latest v0.4.0 with debug enabled, I'm unable to scrobble successfully:

DEBUG ../../src/libscrobbler2.c:276: Scrobble status: 3
DEBUG ../../src/cache.c:121: Cache update: 1626726698
DEBUG ../../src/cache.c:124: Payload: Nightstalker - Dead Rock Commandos (Nightstalker) - 2. Soma (215s)
DEBUG ../../src/server.c:230: Notification not enabled
DEBUG ../../src/server.c:365: New client accepted: 8
DEBUG ../../src/server.c:365: New client accepted: 8
DEBUG ../../src/server.c:142: Payload: Nightstalker - Use - 14. Galactic Revolution (Live Version) (421s)
DEBUG ../../src/server.c:143: Location: /Users/user/Music/Nightstalker/1996 Use/14. Galactic Revolution (Live Version).mp3
DEBUG ../../src/server.c:147: Server hiccup test (5s)
DEBUG ../../src/libscrobbler2.c:348: Session validation wrapper
DEBUG ../../src/libscrobbler2.c:310: Now playing: 0
DEBUG ../../src/libscrobbler2.c:313: Payload:  - (null) ((null)) - 0.  (0s)
DEBUG ../../src/libscrobbler2.c:174: Signature data: api_key<some-api-key>artistmethodtrack.updateNowPlayingskxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtrack02fcbc90341a01f21c3bfc05b636e3ae
DEBUG ../../src/libscrobbler2.c:218: Request: api_key=<some-api-key>&artist=&method=track.updateNowPlaying&sk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&track=&api_sig=<some-api-signature>
DEBUG ../../src/libscrobbler2.c:57: Read: size: 160, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:117: Check: status: 0, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>

Any idea how to fix this? Lastfm's own scrobbler works fine so it's not a connectivity issue.

catalli commented 3 years ago

Also have this error, here's the output when initializing after installing with debug on:

$ > cmusfm init
Checking previous session (user: ${lastfm_username}) ...DEBUG ../../src/libscrobbler2.c:348: Session validation wrapper
DEBUG ../../src/libscrobbler2.c:310: Now playing: 0
DEBUG ../../src/libscrobbler2.c:313: Payload:  - (null) ((null)) - 0.  (0s)
DEBUG ../../src/libscrobbler2.c:174: Signature data: api_key${api_key}artistmethodtrack.updateNowPlayingskxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtrack02fcbc90341a01f21c3bfc05b636e3ae
DEBUG ../../src/libscrobbler2.c:218: Request: api_key=${api_key}&artist=&method=track.updateNowPlaying&sk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&track=&api_sig=cf9b1ec076311a3c29ee4d63596be362
DEBUG ../../src/libscrobbler2.c:57: Read: size: 160, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:117: Check: status: 0, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:330: Now playing status: 3
OK.
Fetch new session key [yes/NO]:

And here's some output when running cmusfm server:

DEBUG ../../src/server.c:365: New client accepted: 10
DEBUG ../../src/server.c:365: New client accepted: 11
DEBUG ../../src/server.c:142: Payload: ${track_info_string} (${time}s)
DEBUG ../../src/server.c:143: Location: ${track_path}
DEBUG ../../src/server.c:147: Server hiccup test (5s)
DEBUG ../../src/libscrobbler2.c:348: Session validation wrapper
DEBUG ../../src/libscrobbler2.c:310: Now playing: 0
DEBUG ../../src/libscrobbler2.c:313: Payload:  - (null) ((null)) - 0.  (0s)
DEBUG ../../src/libscrobbler2.c:174: Signature data: api_key${api_key}artistmethodtrack.updateNowPlayingskxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtrack02fcbc90341a01f21c3bfc05b636e3ae
DEBUG ../../src/libscrobbler2.c:218: Request: api_key=${api_key}&artist=&method=track.updateNowPlaying&sk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&track=&api_sig=9bbaad62103b4a81628eb1f48f664100
DEBUG ../../src/libscrobbler2.c:57: Read: size: 160, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:117: Check: status: 0, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>

This also showed up when running cmusfm server after reinstalling:

DEBUG ../../src/libscrobbler2.c:276: Scrobble status: 3
DEBUG ../../src/server.c:365: New client accepted: 6
DEBUG ../../src/server.c:365: New client accepted: 7
DEBUG ../../src/server.c:142: Payload:  -  - 0.  (180s)
DEBUG ../../src/server.c:143: Location: 
DEBUG ../../src/server.c:147: Server hiccup test (5s)
DEBUG ../../src/server.c:365: New client accepted: 7
DEBUG ../../src/server.c:365: New client accepted: 8
DEBUG ../../src/server.c:142: Payload: ${artist_name} - ${album_name} - 2. ${track_name} (295s)
DEBUG ../../src/server.c:143: Location: /path/to/track.opus
DEBUG ../../src/server.c:147: Server hiccup test (5s)
DEBUG ../../src/libscrobbler2.c:339: Now playing wrapper
DEBUG ../../src/libscrobbler2.c:310: Now playing: 0
DEBUG ../../src/libscrobbler2.c:313: Payload: ${artist_name} - ${album_name} ((null)) - 2. ${track_name} (295s)
DEBUG ../../src/libscrobbler2.c:174: Signature data: album${album_name}api_key67082e45dab1f6433da72a00e3bc037aartist${artist_name}duration295methodtrack.updateNowPlayingskxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtrack${track_name}trackNumber202fcbc90341a01f21c3bfc05b636e3ae
DEBUG ../../src/libscrobbler2.c:218: Request: album=${album_name}&api_key=67082e45dab1f6433da72a00e3bc037a&artist=${artist_name}&duration=295&method=track.updateNowPlaying&sk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&track=${track_name}&trackNumber=2&api_sig=78412a5d5df6b36eb6636d1603ecf374
DEBUG ../../src/libscrobbler2.c:57: Read: size: 129, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="13">Invalid method signature supplied</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:117: Check: status: 0, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="13">Invalid method signature supplied</error>
</lfm>

So now I guess it's fallen into the Invalid method signature supplied error?

arkq commented 3 years ago

OK, indeed something is not right. At first I was not able to reproduce this issue, but after full re-initialization with last.fm API I can see it as well. I'll try to fix it as soon as possible.

arkq commented 3 years ago

I think that I've fixed it. This bug has popped up only for cmusfm with debug enabled (with --enable-debug).

agalloch commented 3 years ago

I think that I've fixed it. This bug has popped up only for cmusfm with debug enabled (with --enable-debug).

I've just tested with latest master (8f98d06d7343778591bb663cfef6250546400645) and scrobbling is working once again, thank you sooo much, @Arkq! 😃

For the sake of truth, only for cmusfm with debug enabled is incorrect. I've never used --enable-debug until cmusfm stopped scrobbling some ~2 months~ 1 month ago (circa Jul 12). I could see the ~/.config/cmus/cache file get updated correctly but nothing was sent to Last.fm. It was only then that I've reinstalled with --enable-debug to figure out what went wrong.

Again, for completeness' sake, I can still see <error code="6">Invalid parameters - Your request is missing a required parameter</error> errors when doing cmusfm init:

$ cmusfm init
Checking previous session (user: npoTybepaHc) ...DEBUG ../../src/libscrobbler2.c:352: Session validation wrapper
DEBUG ../../src/libscrobbler2.c:313: Now playing: 0
DEBUG ../../src/libscrobbler2.c:316: Payload:  - (null) ((null)) - 0.  (0s)
DEBUG ../../src/libscrobbler2.c:174: Signature data: api_key${api_key}artistmethodtrack.updateNowPlayingskxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtrack02fcbc90341a01f21c3bfc05b636e3ae
DEBUG ../../src/libscrobbler2.c:220: Request: api_key=${api_key}&artist=&method=track.updateNowPlaying&sk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&track=&api_sig=${api_sig_1}
DEBUG ../../src/libscrobbler2.c:57: Read: size: 160, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:117: Check: status: 0, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>

DEBUG ../../src/libscrobbler2.c:334: Now playing status: 3
OK.
Fetch new session key [yes/NO]: yes
DEBUG ../../src/libscrobbler2.c:174: Signature data: api_key${api_key}methodauth.getToken02fcbc90341a01f21c3bfc05b636e3ae
DEBUG ../../src/libscrobbler2.c:220: Request: api_key=${api_key}&method=auth.getToken&api_sig=${api_sig_2}
DEBUG ../../src/libscrobbler2.c:57: Read: size: 114, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="ok">
  <token>${token}</token>
</lfm>

DEBUG ../../src/libscrobbler2.c:117: Check: status: 0, body: <?xml version="1.0" encoding="UTF-8"?>
<lfm status="ok">
  <token>${token}</token>
</lfm>

Grant access to your Last.fm account using the link below, then press ENTER:
  https://www.last.fm/api/auth?api_key=${api_key}&token=${token}

but I guess it does not prevent scrobbling.

arkq commented 3 years ago

For the sake of truth, only for cmusfm with debug enabled is incorrect. I've never used --enable-debug until cmusfm stopped scrobbling some 2 months 1 month ago (circa Jul 12).

That is really strange... Because, I've modified only the code which is wrapped with DEBUG "ifdef"s.

I can still see Invalid parameters - Your request is missing a required parameter errors when doing cmusfm init:

This error message is a correct behavior. By providing incorrect parameters I'm checking whether session key is valid. In case of invalid session key, I've got other error message. And in case of correct session key, I'm not scrobbling anything, because there are invalid parameters :)

bnsv commented 2 years ago

Thank you all for the responds. Actually I was give up for a while on this. Today i give another try to make and reinstalling cmusfm from scratch. Thankfully it is now scrobbling normaly again.