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

Login attempt or request with invalid authentication from HEOS-HomeCinema #69489

Closed
leon-volt opened this issue Apr 6, 2022 · 13 comments
Closed

Comments

@leon-volt
Copy link

The problem

I'm getting the following error when I try playing music to my heos soundbar HEOSHCBKE2 via the media browser.
I've tried re adding the integration but no luck.

Login attempt or request with invalid authentication from HEOS-HomeCinema (192.168.1.72). (AvegaMediaServer/2.0 Linux/2.6)

What version of Home Assistant Core has the issue?

core-2022.4.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Integration, heos

Link to integration documentation on our website

https://www.home-assistant.io/integrations/heos

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.http.ban
Source: components/http/ban.py:125
Integration: HTTP (documentation, issues)
First occurred: 22:48:52 (7 occurrences)
Last logged: 22:52:10

Login attempt or request with invalid authentication from HEOS-HomeCinema (192.168.1.72). (AvegaMediaServer/2.0 Linux/2.6)

Additional information

No response

@probot-home-assistant
Copy link

heos documentation
heos source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @andrewsayre, mind taking a look at this issue as it has been labeled with an integration (heos) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@ianfretwell
Copy link

Have you actually used the heos.sign_in service to log it into your Heos account? It'll not work until you do.

@leon-volt
Copy link
Author

Have you actually used the heos.sign_in service to log it into your Heos account? It'll not work until you do.

Yes I've done that. Favorites are working and everything. But the error still occurs. I will try it tomorrow with a clean Hass vm to confirm that there's nothing else in my setup causing it.

@frankvollebregt
Copy link

Since this issue also occurs when playing through the media browser, I feel like it might be the same issue that was reported here. Do you have a similar message in your own logs @ianfretwell ?

@ianfretwell
Copy link

@frankvollebregt No errors at all for me - it just doesn't do anything so I'm pretty sure it's different.

@frankvollebregt
Copy link

frankvollebregt commented Apr 7, 2022

After enabling the logs as per the documentation, I can view the URL that is sent to the Heos to be played. It looks a bit like this (some parts obscured for obvious reasons):

http://192.168.1.xxx:8123/media/local/Firstname%2520Lastname%2520-%2520Album/02%2520-%2520Firstname%2520Lastname%2520-%2520Songtitle.mp3?authSig%3DeyREST_OF_TOKEN

Sure enough, running this URL in Postman returned the same 401 (unauthorized) error.
And I thought, hey, this looks strange. As it turns out, is it encoded twice. When I decode this URL (just using some random online URL decoder), I get a URL that looks much more like a 'normal' encoded URL:

http://192.168.1.xxx:8123/media/local/Firstname%20Lastname%20-%20Album/02%20-%20Firstname%20Lastname%20-%20Songtitle.mp3?authSig=eyREST_OF_TOKEN

When I put this URL in my browser's address bar, it plays as expected.

In conclusion, I suspect that the URL is encoded twice: Once in pyheos, and once in the HA component.

I'm not very experienced with how HA works, so I hope I may have saved someone some time figuring things out :)

Edit

Never mind the above, since it's a URL inside a URL, of course the inner part would have to be encoded twice (otherwise it might break the outer URL...)

I see there have been some changes on the dev channel to the media_player.py file, maybe this somehow helps resolve the issue here?

999e2f3

@frankvollebregt
Copy link

frankvollebregt commented Apr 7, 2022

To supplement to the original issue, here is a part of the debug logs I get:

2022-04-07 15:38:32 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://browse/play_stream?sequence=16&pid=xxx&url=URL_WITH_TOKEN': '{'command': 'browse/play_stream', 'result': 'success', 'message': 'sequence=16&pid=xxx&url=URL_WITH_TOKEN'}'
2022-04-07 15:38:33 DEBUG (MainThread) [pyheos.connection] Event received for player {HEOS HomeCinema (HEOS HomeCinema)}: {'command': 'event/player_queue_changed', 'message': 'pid=xxx'}
2022-04-07 15:38:33 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/get_now_playing_media?sequence=17&pid=xxx': '{'command': 'player/get_now_playing_media', 'result': 'success', 'message': 'sequence=17&pid=xxx'}'
2022-04-07 15:38:33 DEBUG (MainThread) [pyheos.connection] Event received for player {HEOS HomeCinema (HEOS HomeCinema)}: {'command': 'event/player_now_playing_changed', 'message': 'pid=xxx'}
2022-04-07 15:38:34 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from HEOS-HomeCinema (192.168.1.72). (AvegaMediaServer/2.0 Linux/2.6)
2022-04-07 15:38:34 DEBUG (MainThread) [pyheos.connection] Event received for player {HEOS HomeCinema (HEOS HomeCinema)}: {'command': 'event/player_state_changed', 'message': 'pid=xxx&state=stop'}
2022-04-07 15:38:34 DEBUG (MainThread) [pyheos.connection] Event received for player {HEOS HomeCinema (HEOS HomeCinema)}: {'command': 'event/player_playback_error', 'message': 'pid=xxx&error=Unable to play media. Please try again later.'}
2022-04-07 15:38:34 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/get_now_playing_media?sequence=18&pid=xxx': '{'command': 'player/get_now_playing_media', 'result': 'success', 'message': 'sequence=18&pid=xxx'}'

@ianfretwell
Copy link

And yet I'm not having ANY problem playing to my Heos Homecinema through the media browser.

Just for clarity I'm selecting music from a DLNA server.

My original issue still stands that it won't play an album, only individual tracks. Playing an album just causes the previous Heos instigated queue to play instead - as per here.

@haivala
Copy link

haivala commented Apr 13, 2022

I have Marantz amp and when I try to play media through the hass media player I get the same login error and I cannot play any local media from the media browser when I select the HEOS output. It just jumps to play one of the working HEOS playlists.

Seems like the url that is given from hass to the HEOS and which it is trying to play inside the amp is not reachable from the hass instance and hass gives HEOS the login prompt in which it does not have creds. Am I right?

I'm running: Home Assistant 2022.4.3

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added stale and removed stale labels Jul 12, 2022
@WebSpider
Copy link
Contributor

bump

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants