Closed jrtaaffe closed 5 years ago
Oh good, it isn't just me then! Same error in my logs. It was working a couple of days ago.
TypeError: Cannot read property 'length' of undefined
at XmlEntities.exports.XmlEntities.XmlEntities.decode (/app/node_modules/sonos-discovery/node_modules/html-entities/lib/xml-entities.js:48:14)
at NotificationListener.notificationHandler (/app/node_modules/sonos-discovery/lib/models/Player.js:264:42)
at emitTwo (events.js:111:20)
at NotificationListener.emit (events.js:191:7)
at parseLastChange.then (/app/node_modules/sonos-discovery/lib/NotificationListener.js:125:17)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
The data I'm getting back for all zones looks like this:
{
"uuid":"RINCON_000E58346FD601400",
"coordinator":{
"uuid":"RINCON_000E58346FD601400",
"state":{
"volume":13,
"mute":false,
"equalizer":{
"bass":null,
"treble":null,
"loudness":true
},
"currentTrack":{
"artist":"",
"title":"",
"album":"",
"albumArtUri":"",
"duration":0,
"uri":"",
"trackUri":"",
"type":"track",
"stationName":""
},
"nextTrack":{
"artist":"",
"title":"",
"album":"",
"albumArtUri":"",
"duration":0,
"uri":""
},
"trackNo":null,
"elapsedTime":0,
"elapsedTimeFormatted":"00:00:00",
"playMode":{
"repeat":"none",
"shuffle":false,
"crossfade":false
}
},
"roomName":"Office",
"coordinator":"RINCON_000E58346FD601400",
"groupState":{
"volume":12,
"mute":false
}
},
"members":[
{
"uuid":"RINCON_000E58346FD601400",
"state":{
"volume":13,
"mute":false,
"equalizer":{
"bass":null,
"treble":null,
"loudness":true
},
"currentTrack":{
"artist":"",
"title":"",
"album":"",
"albumArtUri":"",
"duration":0,
"uri":"",
"trackUri":"",
"type":"track",
"stationName":""
},
"nextTrack":{
"artist":"",
"title":"",
"album":"",
"albumArtUri":"",
"duration":0,
"uri":""
},
"trackNo":null,
"elapsedTime":0,
"elapsedTimeFormatted":"00:00:00",
"playMode":{
"repeat":"none",
"shuffle":false,
"crossfade":false
}
},
"roomName":"Office",
"coordinator":"RINCON_000E58346FD601400",
"groupState":{
"volume":12,
"mute":false
}
}
]
},
That's a zone that is currently playing an album from Spotify.
By the way, I have also tried re-installing, and I've tested 3 different environments (including a newly set-up raspberry pi), but they all produce the same error. Any help would be greatly appreciated! Thank you!
Same - I suspect Sonos has changed something. They did just release their Google Home support, maybe it has changed the nature of the data.
Which software version do you guys have on the Sonos players?
never mind, I get the same error now with the latest sonos-discovery
Was a dependency that had a breaking change (sigh..), I don't get that error anymore. An npm install
should revert the dependency, but if you still have issues on latest master, wipe node_modules
and do npm install
again.
I am having the following error when running the api:
(node:2766) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined (the full stack trace is below)
It appears that I get an error block like this for each sonos speaker in my system. I can get some data in the responses, but it is incomplete. For example, /players/kitchen/state returns volume info, but no currentTrack or nextTrack values and the playbackState is incorrect:
{"volume":11,"mute":"mute off","equalizer":{"bass":null,"treble":null,"loudness":true},"currentTrack":{"artist":"","title":"","album":"","albumArtUri":"","duration":0,"uri":"","type":"track","stationName":""},"nextTrack":{"artist":"","title":"","album":"","albumArtUri":"","duration":0,"uri":""},"trackNo":null,"elapsedTime":0,"elapsedTimeFormatted":"00:00:00","playbackState":"pause","playMode":{"repeat":"none","shuffle":"shuffle off","crossfade":"crossfade off"}}
full stack trace
(node:2766) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
at XmlEntities.exports.XmlEntities.XmlEntities.decode (/home/pi/sonos-swagger-api/node_modules/html-entities/lib/xml-entities.js:48:15)
at NotificationListener.notificationHandler (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/models/Player.js:262:42)
at NotificationListener.emit (events.js:203:15)
at NotificationListener.EventEmitter.emit (domain.js:448:20)
at parseLastChange.then (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/NotificationListener.js:125:17)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:2766) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2766) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will termin ate the Node.js process with a non-zero exit code.
(node:2766) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
at XmlEntities.exports.XmlEntities.XmlEntities.decode (/home/pi/sonos-swagger-api/node_modules/html-entities/lib/xml-entities.js:48:15)
at NotificationListener.notificationHandler (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/models/Player.js:262:42)
at NotificationListener.emit (events.js:203:15)
at NotificationListener.EventEmitter.emit (domain.js:448:20)
at parseLastChange.then (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/NotificationListener.js:125:17)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:2766) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:2766) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
at XmlEntities.exports.XmlEntities.XmlEntities.decode (/home/pi/sonos-swagger-api/node_modules/html-entities/lib/xml-entities.js:48:15)
at NotificationListener.notificationHandler (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/models/Player.js:262:42)
at NotificationListener.emit (events.js:203:15)
at NotificationListener.EventEmitter.emit (domain.js:448:20)
at parseLastChange.then (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/NotificationListener.js:125:17)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:2766) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:2766) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
at XmlEntities.exports.XmlEntities.XmlEntities.decode (/home/pi/sonos-swagger-api/node_modules/html-entities/lib/xml-entities.js:48:15)
at NotificationListener.notificationHandler (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/models/Player.js:262:42)
at NotificationListener.emit (events.js:203:15)
at NotificationListener.EventEmitter.emit (domain.js:448:20)
at parseLastChange.then (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/NotificationListener.js:125:17)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:2766) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:2766) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
at XmlEntities.exports.XmlEntities.XmlEntities.decode (/home/pi/sonos-swagger-api/node_modules/html-entities/lib/xml-entities.js:48:15)
at NotificationListener.notificationHandler (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/models/Player.js:262:42)
at NotificationListener.emit (events.js:203:15)
at NotificationListener.EventEmitter.emit (domain.js:448:20)
at parseLastChange.then (/home/pi/sonos-swagger-api/node_modules/sonos-discovery/lib/NotificationListener.js:125:17)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:2766) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)