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

Unable to configure w/ v2.0.x, getting stuck at the "Begin" configurator and unable to login #307

Closed
rpitera opened this issue Aug 27, 2019 · 18 comments · Fixed by #335
Closed
Labels
alexapy Issue relates to the API bug Something isn't working

Comments

@rpitera
Copy link

rpitera commented Aug 27, 2019

Describe the bug
Configurator fails to advance to the next step and allow a login in 2.x.x. Clicking on Confirm in the Begin step on the configurator just cycles repeatedly. The workaround is to login through 1.4.1 and then upgrade again.
---Old text
As the title says, I was able to resolve this myself but thought it was important to report. After upgrading from 1.41 to 2.0.0, I got the familiar notification to start the configuration flow. But when I pressed the "Confirm" button, it created a SECOND notification, then cleared the dialog. But the original notification remained. Subsequent attempts produced the same results.

To Reproduce
Steps to reproduce the behavior:

  1. Installed update
  2. Click on configuration message in notifications
  3. Click on Confirm button
  4. A second notification briefly shows, then disappears. Dialog disappears but original configuration notification remains.

Screen capture of sequence above:
https://www.dropbox.com/s/7lto8vnuyxvwxxs/media.io_screen-recording.mp4?dl=0

Expected behavior
Standard update of pickle file and notification clearing.

System details

  • Home-assistant (version): 0.97.2
  • Hassio (Yes/No): Yes
  • alexa_media (version from const.py or HA startup): 2.0.0
  • alexapy (version from pip show alexapy or HA startup): 1.0.0

Additional context
No error was shown in the home assistant logs. Tried this with Chrome and FF, cleared cookies and cache. No change. Downgraded to 1.41 and rebooted. Configuration flow worked correctly and pickle was updated. Then upgraded to 2.0.0 and rebooted again. Everything is working fine, no additional notifications and Alexa Media Player loaded fine.

If this was just some temporary aberration, feel free to close it but I thought I would document it in case it was important or someone else had the same issue.

@sephrioth
Copy link

I have the same issue.

@alandtse
Copy link
Owner

@rpitera thanks for reporting. Btw love your UI.

@sephrioth can you provide some logs for alexapy and alexa_media so we can see what the cause is?

@sephrioth
Copy link

@alandtse Sorry I have cleared the log, uninstall then re-install this plugin solved this issue for now.

@rpitera

This comment has been minimized.

@alandtse
Copy link
Owner

I'm going to leave this up for a while to see if anyone can get logs to figure out the issue. I'm also testing config_flow and we may move away from configurator making this moot.

@bennydente
Copy link

bennydente commented Aug 30, 2019

Hi, i have this bug to. but no log in home-assistant.log file.
i'm on 0.98.1 and alexa_media 2.0.0.

@fabioxp7980
Copy link

fabioxp7980 commented Aug 31, 2019

Hi all, same problem, removed. pickle file to force login, with version 1.4.1, even if I upgrade to the last version 2.0.1 the alexa media player always disappear so I must use only 1.4.1 in order to have my media player working with tts automations. Is there a way to fix this problem?
P. S. I'm on 0.98.1

@alandtse
Copy link
Owner

Still need logs to resolve this. Enable logging (check the Wiki) and maybe we can see what's going on.

@Ghostsl84
Copy link

Ghostsl84 commented Aug 31, 2019

Hello,

with me it works now under 2.0.1 with Amazon.de
the following steps have been taken:

  1. Disinstall Alexa Media Player under HACS
  2. Delete the pickle file
  3. Remove the Alexa configuration from the configration.yaml
  4. Restart the Home Assistant twice (Reboot under Hass.io - System)
  5. Now install Alexa Media Player 2.0.1 under HACS
  6. Home Assistant Restart (Reboot under Hass.io - System)
  7. Open Configuration.yaml and fill in the following

alexa_media:
accounts:
- email: your email
password: your password
url: amazon.com

  1. Home Assistant Restart. (Reboot under Hass.io - System)
  2. Enter Capatcha
  3. Home Assistant Restart (Reboot under Hass.io - System)
  4. open configuration.yaml and

url: amazon.com
replace with
url: amazon.de

  1. Home Assistant Restart (Reboot under Hass.io - System)
  2. Confirm the configuration immediately after the restart. (Configure) this can take about 2 minutes (as long as a circle turns to confirm field)
  3. it confirms the field Confirm still exists
  4. I had to click with the mouse about 36 times very fast one behind the other and the field disappeared and my configuration under Amazon.de was accepted.
  5. HACS is the Amazon Media Player yellow and not green

Hope that helps and my English is understandable :-)

@fabioxp7980
Copy link

fabioxp7980 commented Sep 1, 2019

Still need logs to resolve this. Enable logging (check the Wiki) and maybe we can see what's going on.

Log Details (ERROR) Sun Sep 01 2019 14:49:37 GMT+0200 (Ora legale dell’Europa centrale) Error during setup of component alexa_media Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 168, in _async_setup_component hass, processed_config File "/config/custom_components/alexa_media/__init__.py", line 120, in async_setup await login.login_with_cookie() File "/usr/local/lib/python3.7/site-packages/alexapy/alexalogin.py", line 121, in login_with_cookie await self.login(cookies=self._cookies) File "/usr/local/lib/python3.7/site-packages/alexapy/alexalogin.py", line 240, in login if (cookies is not None and await self.test_loggedin(cookies)): File "/usr/local/lib/python3.7/site-packages/alexapy/alexalogin.py", line 195, in test_loggedin cookies=self._cookies File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 497, in _request await resp.start(conn) File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 844, in start message, payload = await self._protocol.read() # type: ignore # noqa File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 588, in read await self._waiter aiohttp.client_exceptions.ServerDisconnectedError: None

This is my log with error alexa media component setup failed in Hassio 0.98.1, alexa media player components in HACS 2.0.1 version upgraded from 1.4.1 already with login process done, the 1.4.1 integration works, I have media player speaking, if I upgrade, even with captcha done on 1.4.1, then is broken.

EDIT: SOLVED in this way, cleared alexapy hidden folder, wrote shell command to retrieve another time that file, restarted twice my hassio, now I have my media player talking in hassio 0.98.1 and 2.0.1 Hacs component, thank you for the patience!

@rpitera

This comment has been minimized.

@alandtse

This comment has been minimized.

@airdrummingfool
Copy link

airdrummingfool commented Sep 2, 2019

I have this issue, and haven't yet done anything to try and solve it aside from restarting HA a few times.

When HA starts up:

homeassistant_1  | 2019-09-02 06:29:50 INFO (MainThread) [custom_components.alexa_media]
homeassistant_1  | -------------------------------------------------------------------
homeassistant_1  | alexa_media
homeassistant_1  | Version: 2.0.1
homeassistant_1  | This is a custom component
homeassistant_1  | If you have any issues with this you need to open an issue here:
homeassistant_1  | https://github.com/custom-components/alexa_media_player/issues
homeassistant_1  | -------------------------------------------------------------------
homeassistant_1  |
homeassistant_1  | 2019-09-02 06:29:50 INFO (MainThread) [custom_components.alexa_media] Loaded alexapy==1.0.1
homeassistant_1  | 2019-09-02 06:29:50 DEBUG (MainThread) [alexapy.alexalogin] Trying to load cookie from file /config/alexa_media.[redacted].pickle
homeassistant_1  | 2019-09-02 06:29:51 DEBUG (MainThread) [alexapy.alexalogin] cookie loaded: <class 'requests.cookies.RequestsCookieJar'> <RequestsCookieJar[<Cookie at-main=[redacted] for .amazon.com/>, <Cookie csrf=[redacted] for .amazon.com/>, <Cookie sess-at-main="[redacted]" for .amazon.com/>, <Cookie session-id=[redacted] for .amazon.com/>, <Cookie session-id-time=[redacted] for .amazon.com/>, <Cookie session-token="[redacted]" for .amazon.com/>, <Cookie ubid-main=[redacted] for .amazon.com/>, <Cookie x-main="[redacted]" for .amazon.com/>]>
homeassistant_1  | 2019-09-02 06:29:51 DEBUG (MainThread) [alexapy.alexalogin] Key: "at-main", Value: "[redacted]"
homeassistant_1  | 2019-09-02 06:29:51 DEBUG (MainThread) [alexapy.alexalogin] Key: "csrf", Value: "[redacted]"
homeassistant_1  | 2019-09-02 06:29:51 DEBUG (MainThread) [alexapy.alexalogin] Key: "sess-at-main", Value: ""[redacted]""
homeassistant_1  | 2019-09-02 06:29:51 DEBUG (MainThread) [alexapy.alexalogin] Key: "session-id", Value: "[redacted]"
homeassistant_1  | 2019-09-02 06:29:51 DEBUG (MainThread) [alexapy.alexalogin] Key: "session-id-time", Value: "[redacted]"
homeassistant_1  | 2019-09-02 06:29:51 DEBUG (MainThread) [alexapy.alexalogin] Key: "session-token", Value: ""[redacted]""
homeassistant_1  | 2019-09-02 06:29:51 DEBUG (MainThread) [alexapy.alexalogin] Key: "ubid-main", Value: "[redacted]"
homeassistant_1  | 2019-09-02 06:29:51 DEBUG (MainThread) [alexapy.alexalogin] Key: "x-main", Value: ""[redacted]""
homeassistant_1  | 2019-09-02 06:29:55 DEBUG (MainThread) [alexapy.alexalogin] Not logged in: An exception of type ContentTypeError occurred. Arguments:
homeassistant_1  | ("0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8'",)
homeassistant_1  | 2019-09-02 06:29:55 DEBUG (MainThread) [alexapy.alexalogin] No valid cookies for log in; using credentials
homeassistant_1  | 2019-09-02 06:29:55 DEBUG (MainThread) [alexapy.alexalogin] Get to https://alexa.amazon.com was redirected to https://www.amazon.com/ap/signin?showRmrMe=1&openid.return_to=https://alexa.amazon.com/&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.assoc_handle=amzn_dp_project_dee&openid.mode=checkid_setup&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.ns=http://specs.openid.net/auth/2.0&
homeassistant_1  | 2019-09-02 06:29:55 DEBUG (MainThread) [alexapy.alexalogin] Processing https://alexa.amazon.com
homeassistant_1  | 2019-09-02 06:29:55 DEBUG (MainThread) [alexapy.alexalogin] Found standard login page
homeassistant_1  | 2019-09-02 06:29:55 DEBUG (MainThread) [alexapy.alexalogin] Found post url to https://www.amazon.com/ap/signin
homeassistant_1  | 2019-09-02 06:29:55 DEBUG (MainThread) [alexapy.alexalogin] Preparing post to https://www.amazon.com/ap/signin Captcha: None SecurityCode: None Claimsoption: None  AuthSelectOption: None VerificationCode: None
homeassistant_1  | 2019-09-02 06:29:56 DEBUG (MainThread) [alexapy.alexalogin] Processing https://www.amazon.com/ap/signin
homeassistant_1  | 2019-09-02 06:29:56 DEBUG (MainThread) [alexapy.alexalogin] Found standard login page
homeassistant_1  | 2019-09-02 06:29:56 DEBUG (MainThread) [alexapy.alexalogin] Found post url to https://www.amazon.com/ap/signin
homeassistant_1  | 2019-09-02 06:29:56 DEBUG (MainThread) [custom_components.alexa_media] Testing login status: {}

When I click "confirm" in the Configurator popup (which just creates another notification):

homeassistant_1  | 2019-09-02 06:32:55 DEBUG (MainThread) [custom_components.alexa_media] Configurator closed for Status: {}
homeassistant_1  |  got captcha: None securitycode: None Claimsoption: None AuthSelectOption: None  VerificationCode: None
homeassistant_1  | 2019-09-02 06:32:55 DEBUG (MainThread) [alexapy.alexalogin] No valid cookies for log in; using credentials
homeassistant_1  | 2019-09-02 06:32:55 DEBUG (MainThread) [alexapy.alexalogin] Loaded last request to https://www.amazon.com/ap/signin?showRmrMe=1&openid.return_to=https://alexa.amazon.com/spa/index.html&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.assoc_handle=amzn_dp_project_dee&openid.mode=checkid_setup&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.ns=http://specs.openid.net/auth/2.0&
homeassistant_1  | 2019-09-02 06:32:55 DEBUG (MainThread) [alexapy.alexalogin] Processing https://www.amazon.com/ap/signin?showRmrMe=1&openid.return_to=https://alexa.amazon.com/spa/index.html&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.assoc_handle=amzn_dp_project_dee&openid.mode=checkid_setup&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.ns=http://specs.openid.net/auth/2.0&
homeassistant_1  | 2019-09-02 06:32:55 DEBUG (MainThread) [alexapy.alexalogin] Found standard login page
homeassistant_1  | 2019-09-02 06:32:55 DEBUG (MainThread) [alexapy.alexalogin] Found post url to https://www.amazon.com/ap/signin
homeassistant_1  | 2019-09-02 06:32:55 DEBUG (MainThread) [alexapy.alexalogin] Preparing post to https://www.amazon.com/ap/signin Captcha: None SecurityCode: None Claimsoption: None  AuthSelectOption: None VerificationCode: None
homeassistant_1  | 2019-09-02 06:32:57 DEBUG (MainThread) [alexapy.alexalogin] Processing https://www.amazon.com/ap/signin
homeassistant_1  | 2019-09-02 06:32:57 DEBUG (MainThread) [alexapy.alexalogin] Found standard login page
homeassistant_1  | 2019-09-02 06:32:57 DEBUG (MainThread) [alexapy.alexalogin] Found post url to https://www.amazon.com/ap/signin
homeassistant_1  | 2019-09-02 06:32:57 DEBUG (MainThread) [custom_components.alexa_media] Testing login status: {}

(Updated to include alexapy logs)

@alandtse alandtse changed the title Unable to configure w/ v2.0.0, solved by downgrading then upgrading again Unable to configure w/ v2.0.0, getting stuck at the "Begin" captcha Sep 2, 2019
@alandtse alandtse changed the title Unable to configure w/ v2.0.0, getting stuck at the "Begin" captcha Unable to configure w/ v2.0.x, getting stuck at the "Begin" configurator and unable to login Sep 2, 2019
@alandtse
Copy link
Owner

alandtse commented Sep 2, 2019

As an update, I'm able to reproduce this sometimes. This seems like the weirdness I first encountered moving us to 2.0.0 where Amazon would act as if we weren't sending data and the Begin step kept repeating. Sometimes waiting a day would resolve it automatically.

It's slow going to resolve this because I'm getting throttled by Amazon while testing it because of the constant relogins (i.e., Amazon stops sending any more OTP messages to me: Unable to deliver the OTP over a phone call currently. Please wait 10 minutes and try again. If you continue to get this message, try a different method, such as text or email.)

As always logs are appreciated. If anyone is able to sniff the https traffic for logins in 1.4 vs 2.0, I'd appreciate it. Obviously make sure you redact that traffic and send it to me in a private gist.

@alandtse
Copy link
Owner

alandtse commented Sep 2, 2019

Ok I think I figured it out. Doing some more testing before the release.

@alandtse
Copy link
Owner

alandtse commented Sep 2, 2019

For the adventurous, alexapy fix staged.

@airdrummingfool
Copy link

Your fix works for me. I couldn't pip install directly from the gitlab repo (it kept requesting authentication - possibly related thread), so I did the following from inside my HA Docker container:

wget https://gitlab.com/alandtse/alexapy/-/archive/%23307/alexapy-%23307.tar.gz
pip install alexapy-%23307.tar.gz

I restarted HA, and once I clicked the "Confirm" button in the popup - and waited about 10 seconds - the notification went away for good, and I could control my Alexa devices again. Thanks!

@krissen
Copy link

krissen commented Sep 3, 2019

HA 0.98.2; Alexa_media at 2.0.1 via HACS. Got stuck at configurator "Begin" -loop, as described in the thread.

Having installed the alexapy fix, mentioned above, login worked fine again. 👍

@alandtse alandtse added alexapy Issue relates to the API bug Something isn't working labels Sep 3, 2019
@alandtse alandtse mentioned this issue Sep 3, 2019
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.

8 participants