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

LastFM permission errors in log #115

Closed
koehntopp opened this issue Dec 10, 2023 · 3 comments
Closed

LastFM permission errors in log #115

koehntopp opened this issue Dec 10, 2023 · 3 comments

Comments

@koehntopp
Copy link

Please check the FAQ before submitting a bug report.

Describe the bug
Hi,

I'm getting frequent permission errors (see below). Operation continues and recovers, but it would be nice to to get the error in the first place?

2023-12-10T23:09:20+01:00 info : [Scrobblers] [Listenbrainz - brainz] Scrobbled (Backlog) => (Lastfm) Trevor Horn - Swimming Pools (Drank) @ 2023-12-10T23:05:16+01:00
2023-12-10T23:09:15+01:00 info : [Sources] [Lastfm - myLastFm] Discovered => Trevor Horn - Swimming Pools (Drank) @ 2023-12-10T23:05:16+01:00
2023-12-10T14:47:11+01:00 warn : [API - Lastfm - myLastFm] API call was not good but recoverable (operation failed), retrying in 1.5 seconds...
2023-12-10T07:44:11+01:00 info : [Sources] [Lastfm - myLastFm] Polling started
2023-12-10T07:43:56+01:00 info : [Sources] [Lastfm - myLastFm] Poll retries (2) less than max poll retries (5), restarting polling after 15 second delay...
2023-12-10T07:43:56+01:00 error : [Sources] [Lastfm - myLastFm] Authentication Failed - You do not have permissions to access the service

To Reproduce
Normal runtime behaviour

Expected behavior
A clear and concise description of what you expected to happen.

Logs
If possible reproduce the issue with debug logging ON

2023-12-10T07:43:56+01:00 error   : [Sources] [Lastfm - myLastFm] Authentication Failed - You do not have permissions to access the service
Error: 
    at CWD/node_modules/lastfm-node-client/lib/ApiRequest.js:136:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async u.callApi (CWD/build/server.js:1:16787)
    at async l.getRecentlyPlayed (CWD/build/server.js:12:5058)
    at async l.doPolling (CWD/build/server.js:9:14672)
    at async l.startPolling (CWD/build/server.js:9:12562)
    at async l.poll (CWD/build/server.js:9:12202)
2023-12-10T07:43:56+01:00 error   : [Sources] [Lastfm - myLastFm] Error occurred while polling
2023-12-10T07:43:47+01:00 error   : [Sources] [Lastfm - myLastFm] Authentication Failed - You do not have permissions to access the service
Error: 
    at CWD/node_modules/lastfm-node-client/lib/ApiRequest.js:136:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async u.callApi (CWD/build/server.js:1:16787)
    at async l.getRecentlyPlayed (CWD/build/server.js:12:5058)
    at async l.doPolling (CWD/build/server.js:9:14672)
    at async l.startPolling (CWD/build/server.js:9:12562)
    at async l.poll (CWD/build/server.js:9:12202)
2023-12-10T07:43:47+01:00 error   : [Sources] [Lastfm - myLastFm] Error occurred while polling```

**Versions (please complete the following information):**
Provide version information for any related sources/clients.

- multi-scrobbler: [e.g. 0.6.2 on docker]

@FoxxMD
Copy link
Owner

FoxxMD commented Dec 20, 2023

Is this still occurring? The error message you are seeing

Authentication Failed - You do not have permissions to access the service

Is directly from last.fm but is also probably the default message when they return a 403/401 status which could happen if they are having API issues upstream. They do tend to have API reliability issues more often than you'd expect. If MS recovers after some time then it's likely just that, a temporary upstream issue, rather than an actual issue with MS.

@koehntopp
Copy link
Author

Yes, it's still occuring, and I also understand it's not a problem.
I'm just suggesting the error message should be caught, and ignored if a retry is successful.
Makes the log prettier ;)

@FoxxMD
Copy link
Owner

FoxxMD commented Jan 31, 2024

I'm not going to suppress 401/403 responses because it's important those fail fast for actual authentication issues. It's Last.fm's responsibility to return the correct HTTP response if they are having general availability issues from their side (and its not 401/403, its 5xx). In fact their rest spec specifies a list of known errors that multi-scrobbler already uses for retry logic, they just need to actually send them!

I've added additional checks to retry (and suppress errors) if the api call results in a general network issue (unreachable, dns, timeout, etc...). This won't stop logging 401/403 errors but it should cover all other cases.

@FoxxMD FoxxMD closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants