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

Last.fm source showing "Auth Interaction Required" on DNS errors #102

Closed
megatwig opened this issue Oct 27, 2023 · 1 comment
Closed

Last.fm source showing "Auth Interaction Required" on DNS errors #102

megatwig opened this issue Oct 27, 2023 · 1 comment

Comments

@megatwig
Copy link

Describe the bug
multi-scrobbler is treating EAI_AGAIN DNS errors as authentication errors and asking for reauthentication, but a retry is all that's needed.

If my container starts up while my network connection is offline, it hits a DNS error and never retries, and just sits there doing nothing until I realize and go reauthenticate it (or restart the container). I also have a webhook configured that also hit a DNS error so couldn't send out a notification.

To Reproduce

  1. Configure Last.fm as a source
  2. Start the container with no internet connectivity (e.g. internal: true on a Docker network)

Expected behavior
A network (/DNS) error when testing Last.fm authentication should be retried, as other client initialization requests are. Probably also the same for webhooks.

Logs

2023-10-25T20:43:26+01:00 info    : [App] Scheduler started.
2023-10-25T20:43:26+01:00 info    : [Scrobblers] [Maloja - client_maloja] Scrobble processing started
2023-10-25T20:43:26+01:00 info    : [Scrobblers] [Maloja - client_maloja] Server reported database is built and status is healthy
2023-10-25T20:43:26+01:00 error   : [Sources] [Lastfm - source_lastfm] Cannot start polling because user interaction is required for authentication
2023-10-25T20:43:25+01:00 warn    : [Sources] lastfm (source_lastfm) source auth failed.
2023-10-25T20:43:25+01:00 error   : [Sources] [Lastfm - source_lastfm] getaddrinfo EAI_AGAIN ws.audioscrobbler.com {"code":"EAI_AGAIN","errno":-3001,"hostname":"ws.audioscrobbler.com","syscall":"getaddrinfo"}
Error: 
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26)
2023-10-25T20:43:25+01:00 error   : [Sources] [Lastfm - source_lastfm] Could not successfully communicate with Last.fm API
2023-10-25T20:43:25+01:00 error   : [API - Lastfm - source_lastfm] Testing auth failed
2023-10-25T20:43:20+01:00 info    : [Sources] lastfm (source_lastfm) source initialized
2023-10-25T20:43:20+01:00 warn    : [Scrobblers] listenbrainz (client_listenbrainz) client auth failed.
2023-10-25T20:43:15+01:00 info    : [Scrobblers] listenbrainz (client_listenbrainz) client initialized
2023-10-25T20:43:09+01:00 info    : [Scrobblers] maloja (client_maloja) client auth OK
2023-10-25T20:43:09+01:00 info    : [Scrobblers] [Maloja - client_maloja] Auth test passed!
2023-10-25T20:43:09+01:00 info    : [Scrobblers] maloja (client_maloja) client initialized
2023-10-25T20:43:09+01:00 info    : [Scrobblers] [Maloja - client_maloja] Maloja Server Version: 3.1.5
2023-10-25T20:43:09+01:00 info    : [Scrobblers] [Maloja - client_maloja] Communication test succeeded.
2023-10-25T20:43:09+01:00 error   : [Notifiers] [Gotify - Pushbits] Failed to contact server | Error: getaddrinfo EAI_AGAIN notifications.example.com
2023-10-25T20:43:04+01:00 info    : [API] Server started:
---> Local          http://localhost:9078
---> Network        http://172.20.0.9:9078
--- HINT ---
MS is likely being run in a container with BRIDGE networking which means the above addresses are not accessible from outside this container.
To ensure the container is accessible make sure you have mapped the *container* port 9078 to a *host* port. https://foxxmd.github.io/multi-scrobbler/docs/installation#networking
The container will then be accessible at http://HOST_MACHINE_IP:HOST_PORT
--- HINT ---

Versions

  • multi-scrobbler: 0.6.1 on Docker
  • maloja 3.1.5
FoxxMD added a commit that referenced this issue Nov 1, 2023
…nd actual auth errors #102

* Implement type/guard for node network error
* Refactor auth in sources & clients to flag if error is network or api based
* Retry auth on heartbeat if auth failure was caused by network
* Implement initial tests for testing client auth
* Fix tests hanging due to running async functions
@FoxxMD
Copy link
Owner

FoxxMD commented Nov 29, 2023

This should now be fixed in 0.6.2

@FoxxMD FoxxMD closed this as completed Nov 29, 2023
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