hassio-addons / addon-spotify-connect

Spotify Connect - Home Assistant Community Add-ons
https://addons.community
MIT License
182 stars 52 forks source link

Addon fails to start with "Login failed with reason: Bad credentials" #267

Open Pomezny opened 4 weeks ago

Pomezny commented 4 weeks ago

Problem/Motivation

Addon fails to start, spotifyd crashes. Error "[2024-08-14T09:25:51Z ERROR librespot] Connection failed: Login failed with reason: Bad credentials" can be observed in the log.

Expected behavior

Start the addon

Actual behavior

Main process crashes.

Steps to reproduce

Add Spotify username and Spotify password to the config and try to run the addon

Proposed changes

This issue is filed only to let other users and maintainer know what is going on. Spotify recently disabled username/password access which librespot uses as an authentication method to for the API. Workaround might me removing credentials, but it was observed that device discovery might not work. Proper solution in this repository is probably not possible, since it relies on librespot and we need to wait for the librespot team to resolve this issue. There already is issue in their repository and its looks like they are already working on solution here https://github.com/librespot-org/librespot/issues/1308 When librespot comes up with the solution addon will probably need some changes and update to latest librespot

rakalex commented 4 weeks ago

same issue, after upgraded to the latest HA Os version.

[2024-08-14T12:29:18Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gue1.spotify.com:443 [2024-08-14T12:29:18Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:80 [2024-08-14T12:29:18Z INFO librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070" [2024-08-14T12:29:18Z ERROR librespot] Connection failed: Login failed with reason: Bad credentials

tjorim commented 4 weeks ago

Spotify disabled the use of username/password last weekend. We can't do anything about it at the moment as we rely on librespot. I can't test right now but the issue should only be auth. If starting without a username/password, it should still be discovered on your local network.

rosicenko commented 4 weeks ago

Yep, same happened to Music Assistant but there it is already fixed.

Rolfvanderplas commented 4 weeks ago

Yep, same for me. Starting without username/password suceeded.

dtap001 commented 3 weeks ago

same here. please fix it

CountOlaf87 commented 3 weeks ago

I'm having the same issue here

mwarchulinski commented 3 weeks ago

Same here. I tried to change my password, add a new connection method to my spotify account and even reinstall the addon. I'm starting to dig around librespot now.

gungam commented 2 weeks ago

same here tried Music Assistant:

Yep, same happened to Music Assistant but there it is already fixed.

but I'm unable to figure out to use the local audio out of the pi... :-( It seems to support only streaming devices as chrome cast oder sonos...

ironcrafter54 commented 2 weeks ago

but I'm unable to figure out to use the local audio out of the pi... :-( It seems to support only streaming devices as chrome cast oder sonos...

FYI I have found the best way to get audio out of the pi, assuming you are running HA is to install the shairport sync addon using this repository https://github.com/v3rm0n/hassio yes it is unmaintained, but for now it still works well, then add airplay as a player in Music assistant and It should automatically discover the shairport sync addon.

PerSterin commented 2 weeks ago

Yep, same for me. Starting without username/password suceeded. Debug logs without username and password and with username and password below. Have reinstalled Add-on: Spotify Connect, and changed the password.

Logger: homeassistant.helpers.config_entry_oauth2_flow Source: helpers/config_entry_oauth2_flow.py:220 First occurred: 22:48:48 (54 occurrences) Last logged: 23:46:33 Token request for spotify_13898cf388a1449885aac2cc99cc4255 failed (invalid_grant): Refresh token revoked

Without username/password.

Add-on: Spotify Connect Play Spotify music on your Home Assistant device

Add-on version: 0.13.0 You are running the latest version of this add-on. System: Home Assistant OS 13.0 (amd64 / generic-x86-64) Home Assistant Core: 2024.8.3 Home Assistant Supervisor: 2024.08.0

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started Log level is set to DEBUG s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting services-up: info: copying legacy longrun spotifyd (no readiness notification) [23:24:02] INFO: Starting the Spotify daemon... s6-rc: info: service legacy-services successfully started [2024-08-25T21:24:02Z INFO librespot] librespot 0.4.2 UNKNOWN (Built on 2024-01-06, Build ID: 8ZfE3H9w, Profile: release) [2024-08-25T21:24:02Z TRACE librespot] Command line argument(s): [2024-08-25T21:24:02Z TRACE librespot] bitrate "320" [2024-08-25T21:24:02Z TRACE librespot] name "Spotify" [2024-08-25T21:24:02Z TRACE librespot] disable-audio-cache [2024-08-25T21:24:02Z TRACE librespot] verbose [2024-08-25T21:24:02Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:36319

With username/password.

Add-on: Spotify Connect Play Spotify music on your Home Assistant device

Add-on version: 0.13.0 You are running the latest version of this add-on. System: Home Assistant OS 13.0 (amd64 / generic-x86-64) Home Assistant Core: 2024.8.3 Home Assistant Supervisor: 2024.08.0

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started Log level is set to DEBUG s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting services-up: info: copying legacy longrun spotifyd (no readiness notification) [23:29:49] INFO: Starting the Spotify daemon... s6-rc: info: service legacy-services successfully started [2024-08-25T21:29:49Z INFO librespot] librespot 0.4.2 UNKNOWN (Built on 2024-01-06, Build ID: 8ZfE3H9w, Profile: release) [2024-08-25T21:29:49Z TRACE librespot] Command line argument(s): [2024-08-25T21:29:49Z TRACE librespot] bitrate "320" [2024-08-25T21:29:49Z TRACE librespot] name "Spotify" [2024-08-25T21:29:49Z TRACE librespot] username "XXXXXXXX" [2024-08-25T21:29:49Z TRACE librespot] password "XXXXXXXX" [2024-08-25T21:29:49Z TRACE librespot] disable-audio-cache [2024-08-25T21:29:49Z TRACE librespot] verbose [2024-08-25T21:29:49Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:40565 [2024-08-25T21:29:49Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:4070 [2024-08-25T21:29:49Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:443 [2024-08-25T21:29:49Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:80 [2024-08-25T21:29:49Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gue1.spotify.com:4070 [2024-08-25T21:29:49Z INFO librespot_core::session] Connecting to AP "ap-gew1.spotify.com:443" [2024-08-25T21:29:50Z ERROR librespot] Connection failed: Login failed with reason: Bad credentials [23:29:50] WARNING: spotifyd crashed, halting add-on s6-rc: info: service legacy-services: stopping [23:29:50] INFO: spotifyd stoped, restarting... s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service base-addon-log-level: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service base-addon-log-level successfully stopped s6-rc: info: service base-addon-banner: stopping s6-rc: info: service base-addon-banner successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

Goodie01 commented 2 weeks ago

After removing my username/password (best done through the "Edit in YAML" option) it seems to work as expected. Maybe with a slow initial connection?

MaxValue commented 1 week ago

Meta Info for anyone following this: