-
Notifications
You must be signed in to change notification settings - Fork 451
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. |
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”. |
i got a similar email too a while a |
anyone know any alternatives that download natively from spotify and actually work since the removed password auth? |
You can use librespot. On the project page you'll find instalation and configuration instructions. |
I'm afraid the only way to finally solve this problem in spotifyd is to switch to OAuth authentication (as librespot already did in dev branch). |
I switched to deemix (no longer maintained but works good), you can convert spotify playlists to deezer then download as FLACs |
Nope, not working. Tried to use provided librespot package, tried build it myself. Spotify app doesn't see any devices, through it only shows other devices with official clients. |
After some time, I remembered that similar issues were due to the firewall. And this was mentioned above. I didn't know which port librespot-auth uses, or is it require something else. So, I just stopped So anyone having problems with missing devices in spotify client, better check firewall setting. Thank you. |
Hello, thank you! I followed the steps, and it finally started working again. |
EDIT: nevermind, I was able to do it with the phone as I’m on the same network. |
I know, and it wasn’t showing up there; I really had to go through my phone to get it. I’m not sure why, at least it worked. :) |
FWIW, |
I simply tried to rebuild spotifyd after changing the "0.4" to "0.5" for librespot dependencies in the Cargo.toml (hey, it was worth a shot), but it does not work...
Which to me sounds like we're on the right track. Meanwhile, I'm affraid the solution won't come from me : I never wrote a single line of Rust and I gave pretty much everything I got on this "search and replace" in the Cargo.toml ;-) |
Just a quick heads up: I'm basically done with bumping librespot to the new version, just some dbus MPRIS stuff is still missing, where I'm working on getting rid of the web API requests completely. I hope to get it done within the next couple of days, however if you'd like to help testing or can't wait (and don't need DBus for your setup), I published the current state here. |
Tried the branch you recommended but I sadly still get the "bad credentials" error. |
Yes, the broken user-password auth is still the one used in that branch (the new OAuth way needs to be adapted from upstream first). |
Hi @eladyn thank you for working on this issue. When do you think the fixed version will come to Arch packages? |
Usually, Arch should be quite fast, once we release the new version. But since that hasn't happened yet, it'll take a couple of days at least before that. |
Bumping this issue. I have tried everything in this thread and still cannot resolve the Bad Credentials error. |
I've never used it before so I don't have a credentials file, and I tried creating one but it does not like the format. Does anyone has an example of the shape of the json file? |
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: