mass_queue icon indicating copy to clipboard operation
mass_queue copied to clipboard

Bug Report: Authentication fails with Music Assistant 2.7+ on HAOS

Open miroslavfikar opened this issue 7 months ago • 3 comments

mass_queue version: 1.10.1 Music Assistant version: 2.8.5 Installation type: Music Assistant installed as a HAOS App (not Docker) Home Assistant version: 2026.4.3

Problem

Unable to complete the mass_queue integration setup due to authentication failure with Music Assistant 2.7+ which introduced mandatory authentication.

Steps to reproduce

  1. Install mass_queue via HACS on a HAOS setup where Music Assistant runs as a HAOS App.
  2. Go to Settings → Devices & Services → Add Integration → Music Assistant Queue Actions.
  3. Enter the MA server URL: http://<HA_IP>:8095.
  4. The Music Assistant External Client Authentication screen appears.
  5. Clicking Sign in with Home Assistant opens a Connect dialog.
  6. Clicking Connect results in a connection timeout — the flow never completes and returns to the login screen.

What I tried

  • Entering HA username + password in the login form → Invalid username or password
  • Creating a long-lived token in MA Profile settings and using it as password → Invalid username or password
  • Using http://localhost:8095, http://homeassistant.local:8095, http://d5369777-music-assistant:8095 → Server not found
  • Only http://<HA_IP>:8095 reaches the server, but authentication cannot be completed

Root cause (suspected)

The OAuth callback redirect from MA back to HA times out. When MA is running as a HAOS App, the "Sign in with Home Assistant" SSO flow appears to use an internal address for the callback that HA cannot reach from the browser context.

Expected behavior

Either:

  • The "Sign in with Home Assistant" OAuth flow completes successfully, or
  • A token field is exposed in the config flow so that a MA long-lived access token can be used directly (as supported by the music-assistant-client Python library)

Additional context

  • MA works perfectly via HA sidebar (Ingress)
  • The official MA HA integration is installed and working (4 devices, 8 entities)
  • http://<HA_IP>:8095/info returns valid JSON confirming the MA API is accessible
  • The mass-player-card is installed and shows basic playback controls, but queue and local artwork are unavailable without mass_queue

miroslavfikar avatar Apr 19 '26 17:04 miroslavfikar

There are no functional differences between the authentication between this and the Music Assistant integration. If you had any issues setting it up there, you will be having the same issue here. Whatever process you followed to make it work for MA, just repeat it with this integration.

droans avatar Apr 20 '26 13:04 droans

I had the same problem, added the card yesterday and tried the mass_queue procedure, but it failed every time. I did some AI searching, fixed it, and asked it to summarize:

Fix for OAuth callback failing with "site cannot be reached" on homeassistant.local:8123

If you're getting a "site cannot be reached" error when linking Music Assistant Queue Actions, the issue is that the OAuth callback hardcodes homeassistant.local:8123 as the redirect URL. Even if you have your HA internal URL set to your IP address (e.g. 192.168.1.55:8123), the callback will still try to resolve homeassistant.local:8123.

Fix: Simply start the entire integration setup from http://homeassistant.local:8123 in your browser instead of your IP address. Navigate to Settings → Devices & Services → + Add Integration → Music Assistant Queue Actions from that address. When MA redirects back after login, your browser will already be able to resolve homeassistant.local:8123 and the flow completes successfully.

harryfine avatar May 03 '26 14:05 harryfine

Generally the issue is due to a mismatch of the OAuth settings. Both MA and HA often require the internal IP addresses.

If you are still having this issue, the usual fix is to open the OAuth dialog and change the address in the window from whatever MA is using to the IP/Port of Music Assistant. Log in through that.

If it does not automatically redirect back to HA, perform the same step there. After logging in, change the address from whatever is being used for HA to your Home Assistant IP/Port.

droans avatar May 15 '26 19:05 droans