Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

SDK connects, but with null state. Unclear 403 error when trying to sync.

SDK connects, but with null state. Unclear 403 error when trying to sync.

Been working on a Spotify app in React and have an SDK component that acts as a player. It was working all day, now it connects but returns a null state when I call the 'player_state_changed' listener or getCurrentState() method. I tried playing music in my desktop app and then forcibly changing devices to the web SDK (again, it is successfully connecting) and it just seems to timeout in the desktop app. I then added a function to transfer playback state to the device ID associated with my web SDK using the web API when the player 'ready' listener is called, and got this error back:

 

{status: 403, message: "Player command failed: Restriction violated", reason: "UNKNOWN"}

Reason unknown? Anyone know what is happening here? There are no errors printed with any of the error listeners in the documentation.

 

Reading up on it it could be that the player was orphaned somehow, but I can't seem to fix that in any way with the disconnect() method.

Reply
3 Replies

Which browser and os are you using?

Brave/Chromium on Windows 10

The code is working today. I do suspect there was an instance of the player left in the void reading some other posts. But if that's the case, I only saw one instance of my web SDK in the desktop device selection menu. I also have a cleanup statement  in the useEffect hook I called to instantiate the player (e.g. return () => player.disconnect()), so I'm wondering if anyone knows a way I could have avoided this better. It feels a bit hopeless not being able to reach out to the API in any way.

Suggested posts

Staff
Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

Staff
ModeratorStaff / Moderator/ 4 years ago  in Social & Random

Type a product name