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.32k stars 48 forks source link

Port disappearing from Integration URL #2333

Open GekoCH opened 4 months ago

GekoCH commented 4 months ago

What version of Music Assistant has the issue?

2.0.0b141

What version of the Home Assistant Integration have you got installed?

2024.5.4

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

I'm running a docker version of the MA Server: docker run -d --name=music_assistant --network host --privileged -v /home/music-assistant:/data ghcr.io/music-assistant/server Now I used the Adresse: http://192.168.1.123:8095 to integrate this server as a new device in HA withe the MA integration. The URL is accesible from HA.

But I get the Error: "Failed setup, will retry"

In the log I see:

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:147
First occurred: 4:04:17 PM (42 occurrences)
Last logged: 4:29:59 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/music_assistant/client/client.py", line 297, in fetch_initial_state
    await self._player_queues.fetch_state()
  File "/usr/local/lib/python3.12/site-packages/music_assistant/client/player_queues.py", line 228, in fetch_state
    for queue in await self._get_player_queues():
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/music_assistant/client/player_queues.py", line 223, in _get_player_queues
    for item in await self.client.send_command("player_queues/all")
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/music_assistant/client/client.py", line 254, in send_command
    return await future
           ^^^^^^^^^^^^
music_assistant.common.models.errors.InvalidCommand: Invalid command: player_queues/all

How to reproduce

as described above

Music Providers

*

Player Providers

Chromecast Player

Full log output

No response

Additional information

No response

What version of Home Assistant Core are your running

2024.5.4

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Linux

OzGav commented 4 months ago

Confirm the server is running and you are able to access the UI?

GekoCH commented 4 months ago

Confirm the server is running and you are able to access the UI?

Yes of course i can access the server form any device in my network and also play the music over the UI to my audio device, but HA gives me the above error...

Here the log from the MA Server:

2024-05-20 04:58:53.394 WARNING (MainThread) [music_assistant.webserver] Invalid command: player_queues/all
2024-05-20 04:58:55.175 WARNING (MainThread) [music_assistant.webserver] Invalid command: player_queues/all
2024-05-20 04:59:43.851 WARNING (MainThread) [music_assistant.webserver] Invalid command: player_queues/all
OzGav commented 4 months ago

That normally occurs when the frontend hasn't started yet which is why I asked. I would remove the integration from HA, remove from HACS, restart HA, then re-add from HACS, re-add the integration.

GekoCH commented 4 months ago

That normally occurs when the frontend hasn't started yet which is why I asked. I would remove the integration from HA, remove from HACS, restart HA, then re-add from HACS, re-add the integration.

hmm still no success but in the mean time I get this error as well:

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/mass/config_flow.py", line 245, in async_step_manual
    await self.async_set_unique_id(self.server_info.server_id)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2182, in async_set_unique_id
    raise data_entry_flow.AbortFlow("already_in_progress")
homeassistant.data_entry_flow.AbortFlow: Flow aborted: already_in_progress
GekoCH commented 4 months ago

ah interesting now it seems to work. I first added the Integration with this url: http://192.168.1.123:8095 however I get the error: "Failed setup, will retry" I then hit the configuration Icon (the gear) and saw that the "URL of Music Assistant Server:" was only: http://192.168.1.123 Without the port. so I added the port and now it seems to work... lets see how long this last..

GekoCH commented 4 months ago

aaarg now its back again

image

When I add :8095 again it works for a few minutes even an hour maybe... why is set back to only the url without port automatically?

OzGav commented 4 months ago

Yes good question. I think I have heard of another person with this problem but as I recall it is after a restart. Are you rebooting or restarting anything?

GekoCH commented 4 months ago

Yes good question. I think I have heard of another person with this problem but as I recall it is after a restart. Are you rebooting or restarting anything?

no I'm not it just randomly puts it back that's so weird...

OzGav commented 4 months ago

Ok I will change the title and add this to be looked at.

D3LZ-D3LZ-D3LZ commented 3 months ago

I have the same issue, Music assistant shows failed setup, click configure, port is missing, add the port and it works again for an hour or so. I'm running Music assistant on Unraid.

marcelveldt commented 3 months ago

See this duplicated issue: https://github.com/music-assistant/hass-music-assistant/issues/2310

Most important is that you need to check the base URL in the webserver settings

D3LZ-D3LZ-D3LZ commented 3 months ago

See this duplicated issue: #2310

Most important is that you need to check the base URL in the webserver settings

I have checked and the IP and Port are in there and correct, I even tried adding the port to the end of the Base URL with the same result.

image

katsaplias commented 1 month ago

I have the same problem the integration keeps resetting to the default URL of my docker installation and when I replace it with the URL:port format it connects again for a while

iw1gfv commented 2 weeks ago

also I have the same problem. The integration keeps losing the port and when I replace it with the URL:port format it connects again for a while