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

Failed to call service configurator/configure expected string or bytes like object #310

Closed
alandtse opened this issue Aug 28, 2019 · 12 comments · Fixed by #335
Closed

Failed to call service configurator/configure expected string or bytes like object #310

alandtse opened this issue Aug 28, 2019 · 12 comments · Fixed by #335
Labels
alexapy Issue relates to the API bug Something isn't working

Comments

@alandtse
Copy link
Owner

Describe the bug
With 2FA disable, Alexa will request a OTP using the claimspicker form. Selection of sms or email result in Failed to call service configurator/configure expected string or bytes like object and the configurator does not advance.

To Reproduce
Steps to reproduce the behavior:

  1. Begin log in process and fill out captcha
  2. Receive authentication request
  3. Enter any option
  4. See error

Expected behavior
Configuration completes.

Screenshots
If applicable, add screenshots to help explain your problem.

System details

  • Home-assistant (version):
  • Hassio (Yes/No): (Please note you may have to restart hassio 2-3 times to load the latest version of alexapy after an update. This looks like a HA bug).
  • 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

2019-08-27 08:29:44 DEBUG (MainThread) [alexapy.alexalogin] Verification method requested: Authentication required
We will send you a One Time Password (OTP) to authenticate your request.
, Option: sms = As a text message - +1******xxxx.
Option: email = In an email - x**x@xxxxxxx.com.

2019-08-27 08:29:44 DEBUG (MainThread) [custom_components.alexa_media] Testing login status: {‘claimspicker_required’: True, ‘claimspicker_message’: ‘Option: sms = As a text message - +1******xxxx.\nOption: email = In an email - x**x@xxxxxxx.com.\n’}
2019-08-27 08:29:44 DEBUG (MainThread) [custom_components.alexa_media] Creating configurator to select verification option
2019-08-27 08:30:22 DEBUG (MainThread) [custom_components.alexa_media] Status: {‘claimspicker_required’: True, ‘claimspicker_message’: ‘Option: sms = As a text message - +1******xxxx.\nOption: email = In an email - x**x@xxxxxxxx.com.\n’} got captcha: w6geea securitycode: None Claimsoption: sms AuthSelectOption: None VerificationCode: None
2019-08-27 08:30:22 DEBUG (MainThread) [alexapy.alexalogin] No valid cookies for log in; using credentials
2019-08-27 08:30:22 DEBUG (MainThread) [alexapy.alexalogin] Loaded last request to https://www.amazon.com/ap/cvf/request?arb=c7cf42eb-f42b-43a1-b10b-0b471447xxxx

https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639/3069
https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639/3079
https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639/3084
https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639/3089

@alandtse alandtse added alexapy Issue relates to the API bug Something isn't working labels Aug 28, 2019
@nonkronk
Copy link

Screenshot 2019-08-28 19 42 18

Same issue here... i just upgraded the component yesterday through hacs

@alandtse
Copy link
Owner Author

There is a potential fix here. https://gitlab.com/alandtse/alexapy/blob/%23310/alexapy/alexalogin.py. Please try replacing your existing copy.

Some people have tried copying the alexapy directory (from gitlab) into the config directory so the directory structure is config/alexapy. I think that may work but I haven’t tested it.

Even if this doesn't fix it, please report back with logs as this version provides more info.

@mattnewham
Copy link

I have this error, I dont even get verification method, just throws the error as soon as I hit confirm. I've put the new alexapy folder in /config and no fix.

@LCerebo
Copy link

LCerebo commented Aug 28, 2019

I have a similar error as the one described by @mattnewham: after updating the component through hacs at version 2.0.0, I receive the notification that ask me to configure my account, then the pop-up appears but after pressing the "confirm" button nothing happens.
No 2FA configured, running home-assistant 0.97.2 through docker.
Screenshot 2019-08-28 at 23 48 13

@alandtse
Copy link
Owner Author

Please try replacing alexalogin with what I linked and provide logs. It's possible the /config may not work unless you do a pip install.

@kjake
Copy link

kjake commented Aug 29, 2019

Seeing the same issue as @LCerebo after restarting HASS today. I don't know where to put @alandtse's files - I'm running a HASS.io/HASSOs image, so have limited access to things.

Also noted an alexa_media[email].pickle file in /config that contains:
'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

Rolling back to v1.4.1 in HACS fixed it

@mattnewham
Copy link

Hassio installs don’t like pip install, so previously the solution was to put alexapy in the config folder, which didn’t work for me.

Also rolling back doesn’t seem to work for me either. I rolled back to 1.4 (which previously worked) then on the config thing I click the button and a second empty dialog box appears and then disappears. I think this was a bug back then too?

@alandtse
Copy link
Owner Author

No, I don't think this was reported in 1.4.1. We may just have to push out the code to get better logs to figure out what is happening.

@GHSTUDIO1
Copy link

I installed using Hass configure option...,.,just create a file in the config folder....that's the one that you see with automations, scripts, etc folders. Copy Alan's code...I used windows copy/paste.....Save the file.

delete any pickle files that refer to your alexas....

restart....

Fixed my problem which was identical to lCerebo and Kjake.....

@humphrep
Copy link

I can't get past this error:
Failed to call service configurator/configure. expected string or bytes-like object

That pops up every time I try to put in sms or email. I tried putting the new alexalogin.py file in the /config directory. I am running HASSIO.

Not sure how to grab the logs, is there a link to instructions for grabbing the appropriate logs?

@kjake
Copy link

kjake commented Aug 29, 2019

Thanks @GHSTUDIO1, that made sense.
I used Configurator in Hass.io to create a new file in /config, named it alexalogin.py, pasted the text from GitLab and saved the file. Then, I deleted the .pickle file I found. Then, went to HACS and upgraded to v2.0.0 again and restarted Home Assistant.
After restarting, a notification was showing to begin the login for Alexa. I confirmed it, and it closed, but a new notification showed up for the capatcha - the image loaded, I typed it in, hit confirm and it finished the login. I was able to send TTS after that without any API errors.

@humphrep
Copy link

I am back and running as well. I uninstalled from HACS, and manually put on 1.4.1. I went through the prompts to get the one time code. Then I was able to upgrade to 2.0.0 via HACS. I didn't have to put the alaexalogin.py file in the /config directory.

@alandtse alandtse mentioned this issue Sep 3, 2019
@alandtse alandtse reopened this Sep 3, 2019
@alandtse alandtse closed this as completed Sep 4, 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.

7 participants