Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled promise rejection - Cannot read properties of undefined (reading 'members') #170

Open
Dreiviertelblut opened this issue Aug 10, 2022 · 6 comments
Labels

Comments

@Dreiviertelblut
Copy link

I'm switching a pair of Sonos One Speaker (stereo) off on regular base by smart power plug (due to relatively high engergy consumption in standby mode). Whenever swiching this pair ON, though, the adapter creates an error that causes it to stop and restart.

Screenshots & Logfiles

host.IOBroker 2022-08-10 06:16:34.540 info instance system.adapter.sonos.0 started with pid 6361
host.IOBroker 2022-08-10 06:16:04.454 info Restart adapter system.adapter.sonos.0 because enabled
host.IOBroker 2022-08-10 06:16:04.446 error instance system.adapter.sonos.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
sonos.0 2022-08-10 06:16:03.731 error Cannot read properties of undefined (reading 'members')
sonos.0 2022-08-10 06:16:03.729 error TypeError: Cannot read properties of undefined (reading 'members') at Player.recalculateGroupVolume (/opt/iobroker/node_modules/sonos-discovery/lib/prototypes/Player/recalculateGroupVolume.js:4:32) at NotificationListener.notificationHandler (/opt/iobroker/node_modules/sonos-discovery/lib/models/Player.js:370:25) at NotificationListener.emit (node:events:539:35) at /opt/iobroker/node_modules/sonos-discovery/lib/NotificationListener.js:125:17 at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5)
sonos.0 2022-08-10 06:16:03.728 error unhandled promise rejection: Cannot read properties of undefined (reading 'members')
sonos.0 2022-08-10 06:16:03.701 error 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().

Versions:

  • Adapter version: 2.2.3
  • JS-Controller version: 4.0.23
  • Node version: 16.16.0
  • Operating system: linux - buster

I wonder, if anyone else has idenified this problem or knows, how to prevent that.

@gttrmnn
Copy link

gttrmnn commented Oct 25, 2022

Same error here. The plug was pulled and plugged again.

sonos.0 2022-10-25 09:12:10.043 info starting. Version 2.2.3 in /opt/iobroker/node_modules/iobroker.sonos, node: v16.18.0, js-controller: 4.0.23
sonos.0 2022-10-25 09:11:36.821 warn Terminated (UNCAUGHT_EXCEPTION): Without reason
sonos.0 2022-10-25 09:11:36.819 info terminating
sonos.0 2022-10-25 09:11:36.809 info terminating
sonos.0 2022-10-25 09:11:36.801 error Cannot read properties of undefined (reading 'members')
sonos.0 2022-10-25 09:11:36.800 error TypeError: Cannot read properties of undefined (reading 'members') at Player.recalculateGroupVolume (/opt/iobroker/node_modules/sonos-discovery/lib/prototypes/Player/recalculateGroupVolume.js:4:32) at NotificationListener.notificationHandler (/opt/iobroker/node_modules/sonos-discovery/lib/models/Player.js:370:25) at NotificationListener.emit (node:events:525:35) at /opt/iobroker/node_modules/sonos-discovery/lib/NotificationListener.js:125:17 at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5)
sonos.0 2022-10-25 09:11:36.798 error unhandled promise rejection: Cannot read properties of undefined (reading 'members')
sonos.0 2022-10-25 09:11:36.796 error 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().

Adapter version: 2.2.3
JS-Controller version: 4.0.23
Node version: v16.18.0
Operating system: linux, Debian 11 - bullseye (docker)

@mczeus
Copy link

mczeus commented Dec 11, 2022

Here's the same! You should save electricity, so I switch my sounbar completely without power. After switching on again then the error message.
A bug fix would be really great.

@Apollon77
Copy link
Contributor

The probem is that this error comes froma sub library which do not seems to be maintained anymore ... So the "solution" is a bit more effort ... (ok beside a "just catch all errors" solution which I do not like). In fact it is currently "just" n adapter restart in such a case, right?

@Apollon77 Apollon77 added the bug label Dec 12, 2022
@Dreiviertelblut
Copy link
Author

Thanks for looking into this. Correct, just a very unpleasant adapter restart. ;-)

@LuRex9
Copy link

LuRex9 commented Aug 6, 2024

I noticed the same issue with the SONOS Move 2, which triggers an adapter restart when it goes into standby mode or is then switched on again.
Note: The "Alive" status of the Move 2 remains "true" when switched off.

Adapter version: 3.0.0
JS-Controller version: 6.0.9
Node version: v20.16.0
Operating system: Linux, Debian 11

@macpo
Copy link

macpo commented Sep 11, 2024

I have the same issue with SONOS Ones and a Beam, which triggers an adapter restart.

Adapter version: 3.0.0
JS-Controller version: 6.0.11
Node version: v20.17.0
Operating system: Linux, Debian 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants