-
Notifications
You must be signed in to change notification settings - Fork 449
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
"Bad credentials" error when starting spotifyd #1293
Comments
Same here. It was working fine for months and stopped working this morning. Using configured username & password and have disabled zeroconf. I believe it's an issue with librespot as I get the same error with Raspotify. |
Hi! 🙂 Same thing, but I run
... then I get:
Nothing interesting with the verbose flag. |
Indeed something seems to have changed on the Spotify side, since I found already several reports (on several projects) which report the exact same error (most reports have been published recently). It started happening for me too, the issue persists when using the newest Anyway, for now what still should be working (from my tests) is discovery, so until this is fixed it might be a viable option for you? Issues in other projects: |
Hello all, same problem here too.
What do you mean by "discovery" ? |
Indeed, it still works with discovery.
See here: https://docs.spotifyd.rs/config/File.html#alternatives-to-storing-your-password-in-the-config-file Your device will be visible in spotify app as a player (probably requires same network for devices to work). |
Yeah, thanks for the clarification. For |
I can't get this to work, I've commented out |
It might be some firewall issue? Make sure you expose the ports 5353 UDP and the one that the logs say via TCP. |
I had to use the official Spotify client to first authenticate with zeroconf and then spotifyd became visible to other devices on the network. Just opening the official app was enough. |
FYI, as I mentioned on the librespot issue, The blob obtained via ZeroConf authentication flow is not tied to devices on the same network currently, and so for those wishing to reduce effort or network/mDNS config issues, simply running spotifyd on the same machine as a running official client for initial device registration, and then copying the credentials obtained to a remote machine where spotifyd is to be deployed, should work just fine. At least I tested it with librespot with no issues. |
@dspearson thanks for this, this explained why spotifyd suddenly stoped working today because of Bad Credential errors (?) I cannot find the blob ~/.cache/spotifyd nor ~/.config/spotifyd, is it stored here? |
@casualNavigator unfortunately I'm not a spotifyd user but taking a brief look at the code it uses librespot's crates directly so maybe try find on ~, looking for |
@casualNavigator in my case the credentials.json are stored in the cache_path location specified in config file ~/.config/spotifyd/spotifyd.conf |
Same issue on my end but I'm using raspotify. |
@dspearson and @casio1983 Thanks, found a I've tried to generate the curl -X POST "https://accounts.spotify.com/api/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=my-client-id&client_secret=my-client-secret" And updated the |
same issue here, and also i got an email from Spotify forcing me to change my password because they detected some "suspicious activity". (i really hope they are not killing spotifyd and other third-party clients...) |
Same here. Just migrated from raspotify to spotifyd and got that email. At least zeroconf works better in spotifyd. |
Discovery mode worked for me after I commented 'username' and 'password' out of the config file. |
Discovery works, but then plays via my phone not desktop via spotify-qt. user / password are still not working since yesterday. |
is there a workaround to authenticate with some saved credentials/token automatically? could spotifyd write some tokens to some file after a successful zeroconf authentication, which it could read at startup? the reason im asking is because my spotifyd disconnects after being idle for hours ( bugreported here #903 ) for which my workaround is to monitor/poll my active devices via the API and restart the spotifyd container whenever the API thinks its gone. ( commented here ) but since the username+password auth has been turned off on Spotify's side, whenever my container is restarted it wont belong to my account, so it will essentially get in a "bootloop" and i will need to do the zeroconf authentication each time (which is inconvenient). it would be nice if spotifyd persisted the tokens in some file which could be re-used until they are expired. |
There is a file called credentials.json in cache directory. There is some kind of key inside alongside username. Check if that directory is not wiped out on docker down action. It works for at least couple of hours and it's visible in spotify app after device restart. I compiled Spotifyd from source, it's running a system service under Ubuntu. |
You can use the cached discovery credentials for a long time. I've used mine for weeks now. Like previously mentioned, just make sure they're not deleted in your workflow. |
Same or similar problem here with spotifyd 0.3.5 on Ubuntu 22.04.4:
I also tried discovery mode by commenting out username and password in spotifyd.conf, but it seems to be stuck. I don't think I have a credentials.json anywhere because I've not used spotifyd on this computer before, only at work, where it worked fine (haven't tried these past weeks): Additional question. Do I need a credentials.json for discovery to work and can I create one myself?
and it just stays there (+10 min), nothing happens, and I have to interrupt the process. I've n-ple (n>>2) checked the username and password as well as tried both with conf and CLI (-u, -p) with and without " and/or '. I also changed/updated my spotify password and it has no "problematic" characters such as spaces or ". |
For those that seem to have issues creating the credentials.json file, I have created the following: https://github.com/dspearson/librespot-auth Build with
|
is that using of a manually created credentials.json a workaround to get spotifyd in zeroconf mode running? Has someone positive results in using it? |
It works. After confirming authorization for "Example Speaker" in the spotify client, copy the generated |
@dspearson Worked, flawlessly! Built it in Rust to too, what an absolute Chadman! @Mike-de-bike Confirmed working, was able to use spotifyd and spotify-player again. |
Just wanted to add here #1285 that if you have 2 IP address on your interface you may have issues with discovery. |
Hi guys, |
For raspotify you must enable zeroconf first, there is a key for that in config file. This mode should create credentials itself, the librespot-auth is a fallback when zeroconf does not work as expected. Look for these in
|
MacOS Sonoma 14.4 and spotifyd version 0.3.5. Hey, I used librespot-auth to generate the credentials.json and made sure to place it in the right cache directory. But for some reason, "no usable credentials found" like this:
I've confirmed that the credentials.json file is being read by including syntax erros which were caught like this:
As for the: This made me wonder if the credentials were valid so I copied the credentials.json file over to the cache folder of spotify-player. I was facing the same "Bad credentials" error for spotify-player as well and the new credentials.json file actually ended up solving the error and I'm able to use it like regular. I appreciate any help and also great work building this thread so far. |
Thanks to everyone who is helping to work around this issue! For a
Note: Instead of step 5, you can also use the following very clean solution: Set the option |
After step 4, I don't have a |
Same here, no |
Brilliant sugestion! Now the spotifyd works on last credentials.json for long time.
It is also worth to check the Spotify for developers / get available devices command. It will print all devices that are currently available for your account, so debugging is easier. |
This solved it for me, thanks! |
That worked without any stuff with credentials.json, thanks! |
From one day to another, spotifyd stopped working for me with plain text credentials. You advice helped me. Thank you so much! For those who also are working in a container that does not have 'jq' available, you may want to go the 'grep' way in 'spotifyd.conf': [global]
zeroconf_port = 33797
cache_path = "/var/yourcachedirectory"
username_cmd = "grep -oP '(?<=\"username\":\")[^\"]*' /var/yourcachedirectory/credentials.json"
no_audio_cache = true |
Man, you just saved my life. Thank you so much! Much safer option too... |
After transitioning and capturing a working credentials.json file, my Spotify account had it's password rotated again by Spotify after detecting "suspicious activity". I'm assuming that this may have just been bad timing (I forgot to disable the service and so it would have been trying to connect constantly), but before I jump through the hoops again, I'm guessing that no one else is experiencing this and after cleanly transitioning to a credentials.json file it keeps working (at least for a while until the token eventually expires?). |
There are is no 'credentials.json' file in the cache directory after stopping spotifyd. Is there another way to get the credentials.json file? I'm working on MacOS. |
You can generate a credentials.json file as instructed by this comment. |
Trying to run in discovery mode with the username and password_cmd fields commented out in my config seems to run but also gives me this error: Which seems to be related to ipv6, this error is mentioned in an older issue but it was concluded that it should only be an issue on ipv6 only networks, which I'm not on but Spotifyd isn't showing up on my local network however so I'm not sure how to generate a fresh credentials.json file. |
I'm experiencing the same "Bad credentials" issue when starting spotifyd on Arch Linux. I’ve double-checked my username and password, and they are correct. Here's what I’ve tried so far:
Despite all this, I continue to receive the "Login failed with reason: Bad credentials" error. |
@Isaac-Leonard You can generate a credentials.json file as instructed by this comment.
and then:
|
@SomeoneSomewhereHow I tried running the code at https://github.com/dspearson/librespot-auth but the device still doesn't show up in the webplayer or on my phone as available to connect to. |
Okay, I got it to work, it only shows up in the spotify desk top app |
After creating the credentials file, leaving it where it should be (cache dir) and keeping the username value in spotifyd.conf, everything worked again. Thank you very much, @dspearson |
Oh, I'm sorry totally forgot about that. The latest release |
Setting the zeroconf_port to a higher number allowed this to work for me. |
ohh wow, this was the key for me, i downgraded to v0.3.4 and now the credentials caching works and finally i dont have to manually reauthenticate via zeroconf every time i restart the container! thanks! |
Thanks for the confirmation. Maybe a new release would make sense, especially regarding some other issues. |
I was able to avoid the downgrade by |
For now it works for me, thank you very much! |
I also had this issue. Several hours after, I was signed out of Spotify on all devices, and got an email telling me I need to set a new password “due to detected suspicious activity”. |
Description
I've been using spotifyd for a few years now without issue. Just this morning when trying to connect, I got the following error:
I am able to login just fine on all my other devices, it's only using
spotifyd
where I have this issue. I have also tried restarting my PC, and using my email as username instead of the username string, as suggested by #1269, but neither have worked.To Reproduce
spotifyd --verbose --no-daemon
Expected behavior
spotifyd
should authenticate with spotifyLogs
Click to show logs
Compilation flags
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: