Closed SeafireGit closed 5 years ago
Problem seems to be somewhere here : https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/amazon_polly/tts.py
between line 142 and 184, but I can't figure out what it is.
I think that the parameters aws_access_key_id, aws_secret_access_key and region_name are expecting a normal string. So try to configure it without quotation marks surrounding the actual value.
I removed the quote for each parameter but I still get the same error. :(
It seems to fail here File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/amazon_polly/tts.py", line 177, in get_engine
all_voices_req = polly_client.describe_voices()
, which is shortly after creating your polly client. So I would suggest that there is some kind of issue when creating your client. Maybe your credentials are not working properly somehow.
Have you tried to test your credentials with the official Amazon python package boto3? If not try something along the lines of:
import boto3
polly_client = boto3.client(
'polly',
aws_access_key_id='YOUR ACCESS_KEY',
aws_secret_access_key='YOUR SECRET_KEY',
region_name='YOUR REGION_NAME'
)
all_voices_req = polly_client.describe_voices()
Just to make sure that your credentials are working as they should be :)
If you get any errors just let me know.
I double check my credential and they were right. So I tried the credential directly with boto3, and it indeed didn't work. I regenerate new one on AWS website and it works now !
For whatever reason, the first generated secret key ( mk/RRUeZL[...]bekt6ic7X6xOPs2A2N now deactivated) had a '/' in it, so I suppose boto is not able to deal with / in the secret key. This is the only difference I can see.
I'm not sure if there is a way to make the error more explicit in HA logs, as the error raised by boto is : botocore.exceptions.ClientError: An error occurred (InvalidSignatureException) when calling the DescribeVoices operation: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
Thanks a lot Springstan for your help, and sorry for the inconvenience.
That is great to hear! Yeah it seems like boto does not handle /
correctly. Please open an issue on boto's repo so they are aware and can fix this issue for future users.
Of course! Do not be sorry for that we are a community after all, who help each other out :) And by the way do not forget to close this issue here.
Issue solved.
Home Assistant release with the issue:
0.97.2
Last working Home Assistant release (if known):
Operating environment (Hass.io/Docker/Windows/etc.): Hassbian
Component/platform: https://www.home-assistant.io/components/amazon_polly/
Description of problem: Unable to set up Amazon polly
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information:
Hello, I am unable to make Amazon Polly TTS work. I tried to uninstall and reinstall boto3 (pip3 [un]install boto3) without success neither.