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

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

Open
Pomezny opened this issue Aug 14, 2024 · 24 comments
Open

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

Pomezny opened this issue Aug 14, 2024 · 24 comments

Comments

@Pomezny
Copy link

Pomezny commented Aug 14, 2024

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 librespot-org/librespot#1308
When librespot comes up with the solution addon will probably need some changes and update to latest librespot

@rakalex
Copy link

rakalex commented Aug 14, 2024

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
Copy link
Contributor

tjorim commented Aug 14, 2024

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
Copy link

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

@Rolfvanderplas
Copy link

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

@dtap001
Copy link

dtap001 commented Aug 17, 2024

same here. please fix it

@CountOlaf87
Copy link

I'm having the same issue here

@mwarchulinski
Copy link

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
Copy link

gungam commented Aug 24, 2024

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
Copy link

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
Copy link

PerSterin commented Aug 25, 2024

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
Copy link

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
Copy link

MaxValue commented Sep 4, 2024

Meta Info for anyone following this:

@brixharlem
Copy link

Has anybody found a workaround yet? Spotify Connect works after removing username and password, but I always need another device (e.g. smartphone) to "authenticate" Home Assistant by handing over the speaker. After HA restart, it has to be repeated. Thank you!

@robertjscooper
Copy link

For referenece; librespot has now merged a PR for handling OAuth2.0 authentication.

@fchaudhri02
Copy link

Is there any update on this? I was using this at my business to automatically play music locally on home assistant which was connected to an AV receiver. Eagerly waiting for this to be fixed.

@brixharlem
Copy link

brixharlem commented Sep 28, 2024

@fchaudhri02 I finally bought an audiocast pro device. This fixed it for me and works much better than before.

@fchaudhri02
Copy link

@fchaudhri02 I finally bought an audiocast pro device. This fixed it for me and works much better than before.

@brixharlem How are you using that with home assistant? Are you using Spotify or Spotify Plus integration?

I had purchased WiiM Mini to try. My theory was if I put WiiM and home assistant on the same network, I should see WiiM as a device on the Spotify integration and should be able to play to it. If that worked, all of my automation should work, but Spotify integration doesn't see the WiiM. However, I am able to play to WiiM from the phone app.

@brixharlem
Copy link

@fchaudhri02 I finally bought an audiocast pro device. This fixed it for me and works much better than before.

@brixharlem How are you using that with home assistant? Are you using Spotify or Spotify Plus integration?

I had purchased WiiM Mini to try. My theory was if I put WiiM and home assistant on the same network, I should see WiiM as a device on the Spotify integration and should be able to play to it. If that worked, all of my automation should work, but Spotify integration doesn't see the WiiM. However, I am able to play to WiiM from the phone app.

Both works fine. After connecting, the "source" is available and never disappeared. The device is running for a week.

@fchaudhri02
Copy link

@fchaudhri02 I finally bought an audiocast pro device. This fixed it for me and works much better than before.

@brixharlem How are you using that with home assistant? Are you using Spotify or Spotify Plus integration?
I had purchased WiiM Mini to try. My theory was if I put WiiM and home assistant on the same network, I should see WiiM as a device on the Spotify integration and should be able to play to it. If that worked, all of my automation should work, but Spotify integration doesn't see the WiiM. However, I am able to play to WiiM from the phone app.

Both works fine. After connecting, the "source" is available and never disappeared. The device is running for a week.

@brixharlem Would you be able to share the steps you took to get it working? I can't figure out what am I missing or doing wrong.

For me, the spotify integration doesn't see Audiocast pro device. However, the spotifyplus integration does see it, but it fails to play on it. It gives me an error about credentials.

@brixharlem
Copy link

@fchaudhri02 Have you initialized the Spotify connection to Audiocast once with your mobile? Is the device available in the Spotify app?

@realGlorix
Copy link

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?

thank you so much.

Copy link

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Nov 30, 2024
@gungam
Copy link

gungam commented Nov 30, 2024

Push

@mwarchulinski
Copy link

Waiting for the plugin update. librespot has a new version where the issue seems to be fixed.

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Dec 1, 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