MercuryException: status: 403
See original GitHub issueDescribe the bug When trying to connect to my spotify connect device that I set up with librespot autoconf, I get the below exception. The jar doesn’t crash but the connection doesn’t proceed, basically I click the device in the menu and nothing happens.
To Reproduce Download the spotify player jar (on a Windows machine). Run it to generate the config file and then stop it. Open the firewall ports as instructed in the README. Edit the generated config file and add the random port you opened, change nothing else and save. Run the jar again and leave running. Open any spotify client app and in the menu of available devices you see ‘librespot-java’. Click it - nothing happens and you’re not connected. Check the output of the running jar and you’ll see the exception below.
Expected behavior After performing the steps above, I expect me spotify client to be connected to my spotify connect device and when I play music it gets played on the computer running the jar.
Screenshots/Stracktraces/Logs
xyz.gianlu.librespot.mercury.MercuryClient$MercuryException: status: 403
at xyz.gianlu.librespot.mercury.MercuryClient.sendSync(MercuryClient.java:106) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.core.TokenProvider.getToken(TokenProvider.java:68) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.core.TokenProvider.get(TokenProvider.java:79) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.dealer.DealerClient.connect(DealerClient.java:79) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.core.Session.authenticate(Session.java:353) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.core.Session.access$600(Session.java:75) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.core.Session$Builder.create(Session.java:1021) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.ZeroconfServer.handleAddUser(ZeroconfServer.java:367) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.ZeroconfServer.access$200(ZeroconfServer.java:56) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.ZeroconfServer$HttpRunner.handleRequest(ZeroconfServer.java:499) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.ZeroconfServer$HttpRunner.handle(ZeroconfServer.java:574) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.ZeroconfServer$HttpRunner.lambda$run$1(ZeroconfServer.java:482) ~[librespot-player-1.6.0.jar:1.6.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_281]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_281]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_281]
2021-06-01 10:32:59,765 ERROR ZeroconfServer:501 - Failed handling addUser!
java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method) ~[?:1.8.0_281]
at java.net.SocketOutputStream.socketWrite(Unknown Source) ~[?:1.8.0_281]
at java.net.SocketOutputStream.write(Unknown Source) ~[?:1.8.0_281]
at xyz.gianlu.librespot.ZeroconfServer.handleAddUser(ZeroconfServer.java:382) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.ZeroconfServer.access$200(ZeroconfServer.java:56) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.ZeroconfServer$HttpRunner.handleRequest(ZeroconfServer.java:499) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.ZeroconfServer$HttpRunner.handle(ZeroconfServer.java:574) ~[librespot-player-1.6.0.jar:1.6.0]
at xyz.gianlu.librespot.ZeroconfServer$HttpRunner.lambda$run$1(ZeroconfServer.java:482) ~[librespot-player-1.6.0.jar:1.6.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_281]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_281]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_281]
Version/Commit Downloaded jar librespot-player-1.6.0.jar
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
At the top right of the desktop app, select your username, and go to Account. You should be on the “Account overview” page. You will see your Spotify “Username” there, which is a long string of randomized characters. Save that. Now go to the “Set device password” page and set a password for your account.
Now log out of the Spotify desktop app, and log in without using Facebook, by using the (long random characters) username & password you just set.
Now the desktop app will send normal Spotify access tokens over Spotify Connect and it should work fine (no more 403 errors)!
@jcadduono Confirmed working. Thanks! I’m getting rid of Facebook anyway. (I previously have confused this with the user/pass settings in librespot-java config or cmdline options, which is inconvenient: it does not allow 2nd/3rd users with their own accounts.)