music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.34k stars 49 forks source link

Sonos Arc failing to setup #1534

Closed OzGav closed 11 months ago

OzGav commented 1 year ago

Found this. Does it help?

2023-09-19 16:03:55.582 ERROR (MainThread) [music_assistant.webserver] [547344517840] Error handling message: CommandMessage(message_id=8, command='config/providers/reload', args={'instance_id': 'sonos'})
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/webserver.py", line 372, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/config.py", line 292, in reload_provider
    await self._load_provider_config(config)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/config.py", line 699, in _load_provider_config
    await self.mass.load_provider(config)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/server.py", line 359, in load_provider
    await self.unload_provider(conf.instance_id)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/server.py", line 427, in unload_provider
    await provider.unload()
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/sonos/__init__.py", line 258, in unload
    player.soco.end_direct_control_session()
  File "/usr/local/lib/python3.11/site-packages/soco/core.py", line 148, in inner_function
    return function(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/soco/core.py", line 846, in end_direct_control_session
    self.avTransport.EndDirectControlSession([("InstanceID", 0)])
  File "/usr/local/lib/python3.11/site-packages/soco/services.py", line 206, in _dispatcher
    return self.send_command(action, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/soco/services.py", line 514, in send_command
    self.handle_upnp_error(response.text)
  File "/usr/local/lib/python3.11/site-packages/soco/services.py", line 567, in handle_upnp_error
    raise SoCoUPnPException(
soco.exceptions.SoCoUPnPException: UPnP Error 718 received: Invalid InstanceID from 192.168.6.17

2023-09-19 16:05:43.765 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-77965' coro=<SonosPlayerProvider._run_discovery() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/providers/sonos/init.py:414> exception=AttributeError("'NoneType' object has no attribute 'keys'")>
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/sonos/init.py", line 427, in _run_discovery
cur_player_ids = set(self.sonosplayers.keys())
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'keys'

Originally posted by @midunker in https://github.com/music-assistant/hass-music-assistant/discussions/1171#discussioncomment-7046900

wuast94 commented 1 year ago

have the same issue with a sonos roam

OzGav commented 1 year ago

Have you got EXACTLY the same error message?

wuast94 commented 1 year ago

i think yes, but i removed this project because of horrible delay between action and response when starting or seeking through music no matter if i used air play or other variants. sadly

midunker commented 1 year ago

Any news on this? Is there a chance that it get fixed in the near future?

OzGav commented 1 year ago

Most people do not have a problem. Have you anything unusual about your network setup? VLANs, firewalls, anything that could be interfering with the mdns broadcasts that are used to setup the devices?

bennir commented 11 months ago

I also had 'UPnP Error 718 received' I'm using Unifi AP and it startet working after activating Multicast DNS and IGMP Snooping in Global Network Settings Also had errors like 2023-10-23 17:59:47.214 WARNING (MainThread) [music_assistant.players] Error while requesting latest state from player Sonos: 'RINCON_B8Exxx'

Maybe this helps

OzGav commented 11 months ago

@midunker please let us know if you have Unifi gear and if so check the settings suggested above. Even if you don’t have Unifi gear check if you have anything in your network settings which is interfering with mdns broadcasts. If we don’t hear back soon we close this one.

midunker commented 11 months ago

I'll check and let you know. Please give me at least until monday to reply.

OzGav commented 11 months ago

Please let us know how you went