BeachHacks / Spotify-Queue-Web-2023

1 stars 1 forks source link

bug(playback)!: Spotify API - No active device found. #39

Open Jahme opened 1 year ago

Jahme commented 1 year ago
WebapiPlayerError: An error occurred while communicating with Spotify's Web API.
Details: Player command failed: No active device found NO_ACTIVE_DEVICE.
at _toError (/app/node_modules/spotify-web-api-node/src/http-manager.js:35:12)
at /app/node_modules/spotify-web-api-node/src/http-manager.js:71:25
at Request.callback (/app/node_modules/superagent/lib/node/index.js:905:3)
at /app/node_modules/superagent/lib/node/index.js:1127:20
at IncomingMessage.<anonymous> (/app/node_modules/superagent/lib/node/parsers/json.js:22:7)
at Stream.emit (node:events:513:28)
at Unzip.<anonymous> (/app/node_modules/superagent/lib/node/unzip.js:53:12)
at Unzip.emit (node:events:513:28)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
body: {
error: {
status: 404,
message: 'Player command failed: No active device found',
reason: 'NO_ACTIVE_DEVICE'
}
},
headers: {
'content-type': 'application/json; charset=utf-8',
'cache-control': 'private, max-age=0',
'x-robots-tag': 'noindex, nofollow',
'access-control-allow-origin': '*',
'access-control-allow-headers': 'Accept, App-Platform, Authorization, Content-Type, Origin, Retry-After, Spotify-App-Version, X-Cloud-Trace-Context, client-token, content-access-token',
'access-control-allow-methods': 'GET, POST, OPTIONS, PUT, DELETE, PATCH',
'access-control-allow-credentials': 'true',
'access-control-max-age': '604800',
'content-encoding': 'gzip',
'strict-transport-security': 'max-age=31536000',
'x-content-type-options': 'nosniff',
date: 'Tue, 10 Jan 2023 20:12:48 GMT',
server: 'envoy',
via: 'HTTP/2 edgeproxy, 1.1 google',
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
connection: 'close',
'transfer-encoding': 'chunked'
},
statusCode: 404
}

Occurs randomly where the API cannot recognize the active device/host Spotify client, despite songs active. Fixes during runtime when relogging as a host with an active Spotify client. Could be behavior of the Spotify API. We should require handling to notify host when issue arises.

Jahme commented 1 year ago

I've only ever received this error after having used a Windows desktop Spotify client for an extended period of time. I have yet to see if having my phone as the active device raises this error.

Jahme commented 1 year ago

Based on the hours I had left the music playing yesterday, it seems that the desktop Spotify client is not as stable as the mobile client. For today, I will be using the Spotify website as the host client for the music stream and see how it goes.