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

Websocket failed: KeyError: 'ubid-main' #127

Closed
mcc05 opened this issue Mar 17, 2019 · 5 comments · Fixed by #131
Closed

Websocket failed: KeyError: 'ubid-main' #127

mcc05 opened this issue Mar 17, 2019 · 5 comments · Fixed by #131
Labels
alexapy Issue relates to the API bug Something isn't working

Comments

@mcc05
Copy link

mcc05 commented Mar 17, 2019

Just upgraded to the latest version 1.2.2, and I'm running HA 0.90.b3, however it fails to start with the following error, is there something I'm missing?

019-03-17 10:15:20 DEBUG (SyncWorker_0) [alexapy.alexalogin] Logged in as xxxxxxxxx@xxxxxxxx.com
2019-03-17 10:15:20 DEBUG (SyncWorker_0) [alexapy.alexalogin] Using cookies to log in
2019-03-17 10:15:20 DEBUG (SyncWorker_0) [alexapy.alexalogin] Log in successful with cookies
2019-03-17 10:15:20 DEBUG (SyncWorker_0) [custom_components.alexa_media] Setting up Alexa devices
2019-03-17 10:15:20 ERROR (SyncWorker_0) [custom_components.alexa_media] ***********@xxxxxxxx.com: Websocket failed: 'ubid-main'
Traceback (most recent call last):
  File "/config/custom_components/alexa_media/__init__.py", line 405, in setup_alexa
    websocket = WebsocketEchoClient(login_obj, ws_handler)
  File "/config/deps/lib/python3.7/site-packages/alexapy/alexawebsocket.py", line 37, in __init__
    url += str(self._cookies['ubid-main'])
KeyError: 'ubid-main'

EDIT: Fixed log formatting

@alandtse
Copy link
Owner

That looks like a bug as the cookie entry is missing from your cookies and is actually required to use websockets as it's used to build the url.

What region are you in? Are you comfortable debugging directly in python? Are you in an environment where you can edit or replace the alexapy files directly (i.e. everything but hass.io I think)?

Are you able to use the Alexa webapp at alexa.amazon.com (or whatever region you're at?) If you can, you can try to catch the WebSocket connection for your region using your browsers dev tools while on the Web player. Here's chrome's tutorial.

@alandtse alandtse changed the title Websocket failed Websocket failed: 'ubid-main' Mar 17, 2019
@alandtse alandtse added bug Something isn't working alexapy Issue relates to the API labels Mar 17, 2019
@alandtse alandtse changed the title Websocket failed: 'ubid-main' Websocket failed: KeyError: 'ubid-main' Mar 17, 2019
@alandtse
Copy link
Owner

Also, let me know if you lost any functionality. It should be falling back to the 1.2.1 functionality so you shouldn't lose anything as result of websockets not working.

@Obicom
Copy link

Obicom commented Mar 17, 2019

same here .... with 1.2.2

could you explain where I can download previous version 1.2.1 ?

image

@alandtse
Copy link
Owner

@Obicom The releases page.

@Obicom
Copy link

Obicom commented Mar 17, 2019

but let me mention I found no functional restrictions with this error ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alexapy Issue relates to the API bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants