jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.85k stars 460 forks source link

Got status 412 #644

Open GICMan opened 6 years ago

GICMan commented 6 years ago

Hello, I get this error every few minutes when running the Node-Sonos-HTTP-API. It causes the system to pause whatever it is playing. Please help!

Error: Got status 412 when invoking /MediaRenderer/GroupRenderingControl/Event at Timeout.subscribe (/Users/gabriel/Documents/Coding/Brackets/node-sonos-http-api-master/node_modules/sonos-discovery/lib/Subscriber.js:49:5)

GICMan commented 6 years ago

Here is the entire error message 2018-09-14T01:43:12.549Z WARN resubscribing to sid uuid:RINCON_000E588FAD0601400_sub0000000025 failed Error: Got status 412 when invoking /MediaServer/ContentDirectory/Event at Timeout.subscribe (/Users/gabriel/Documents/Coding/Brackets/node-sonos-http-api-master/node_modules/sonos-discovery/lib/Subscriber.js:49:5) at ontimeout (timers.js:424:11) at tryOnTimeout (timers.js:288:5) at listOnTimeout (timers.js:251:5) at Timer.processTimers (timers.js:211:10)

jishi commented 5 years ago

Hi, sorry for a very late reply to this!

But, it sounds to me that it's rather your players that are rebooting, not the api that is causing them to pause. That error would definitely occur if the player suddenly restarted (this can even happen internally), because it tries to renew an existing event subscription, but the player has forgotten about it. This would only happen if 1. Player rebooted crashed, or 2. the http-api was suspended for an extended time and then resumed (think, a laptop that goes into sleep mode with the http-api on, and then got woken up again more than 10 minutes later)

If you have a queue loaded in the player, that would have been wiped if it was a reboot/crash. Unfortunately Sonos removed the logs so you can't verify those anymore, but the queue info would be an indication. If this keeps on happening, you might wanna submit a diagnostic to Sonos right after it happened and ask what they think.