question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chime Client - Unable to create user

See original GitHub issue

Describe the bug Using the Chime client from boto3, the create_user call always raises

An error occurred (BadRequestException) when calling the CreateUser operation: Service received a bad request

Steps to reproduce

accountid = client.list_accounts()['Accounts'][0]['AccountId']
client.create_user(AccountId=accountid, Email="valid@email.com", UserType="PrivateUser", Username="Matiboy")

Note that the email address belongs to a validated domain

Expected behavior User is created

Debug logs

[DEBUG] botocore.hooks: Event before-parameter-build.chime.CreateUser: calling handler <function generate_idempotent_uuid at 0x7f5e257aa048>
2020-04-14 04:29:34,747 botocore.hooks [DEBUG] Event before-parameter-build.chime.CreateUser: calling handler <function generate_idempotent_uuid at 0x7f5e257aa048>
[DEBUG] botocore.hooks: Event before-call.chime.CreateUser: calling handler <function inject_api_version_header_if_needed at 0x7f5e257ab9d8>
2020-04-14 04:29:34,769 botocore.hooks [DEBUG] Event before-call.chime.CreateUser: calling handler <function inject_api_version_header_if_needed at 0x7f5e257ab9d8>
[DEBUG] botocore.endpoint: Making request for OperationModel(name=CreateUser) with params: {'url_path': '/accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users?operation=create', 'query_string': {}, 'method': 'POST', 'headers': {'User-Agent': 'Boto3/1.12.39 Python/3.6.9 Linux/4.19.76-linuxkit Botocore/1.15.39'}, 'body': b'{"Email": "mathieu@redapesolutions.com", "UserType": "ServiceUser", "Username": "Matiboy"}', 'url': 'https://service.chime.aws.amazon.com/accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users?operation=create', 'context': {'client_region': 'aws-global', 'client_config': <botocore.config.Config object at 0x7f5e232deef0>, 'has_streaming_input': False, 'auth_type': None}}
2020-04-14 04:29:34,770 botocore.endpoint [DEBUG] Making request for OperationModel(name=CreateUser) with params: {'url_path': '/accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users?operation=create', 'query_string': {}, 'method': 'POST', 'headers': {'User-Agent': 'Boto3/1.12.39 Python/3.6.9 Linux/4.19.76-linuxkit Botocore/1.15.39'}, 'body': b'{"Email": "mathieu@redapesolutions.com", "UserType": "ServiceUser", "Username": "Matiboy"}', 'url': 'https://service.chime.aws.amazon.com/accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users?operation=create', 'context': {'client_region': 'aws-global', 'client_config': <botocore.config.Config object at 0x7f5e232deef0>, 'has_streaming_input': False, 'auth_type': None}}
[DEBUG] botocore.hooks: Event request-created.chime.CreateUser: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f5e232deeb8>>
2020-04-14 04:29:34,785 botocore.hooks [DEBUG] Event request-created.chime.CreateUser: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f5e232deeb8>>
[DEBUG] botocore.hooks: Event choose-signer.chime.CreateUser: calling handler <function set_operation_specific_signer at 0x7f5e257a7ea0>
2020-04-14 04:29:34,789 botocore.hooks [DEBUG] Event choose-signer.chime.CreateUser: calling handler <function set_operation_specific_signer at 0x7f5e257a7ea0>
[DEBUG] botocore.auth: Calculating signature using v4 auth.
2020-04-14 04:29:34,791 botocore.auth [DEBUG] Calculating signature using v4 auth.
[DEBUG] botocore.auth: CanonicalRequest:
POST
/accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users
operation=create
host:service.chime.aws.amazon.com
x-amz-date:20200414T042934Z

host;x-amz-date
d57e352f3173e4ad4eb0482bc8c6113808ef014a754e85e0cebe0d4c2efb210b
2020-04-14 04:29:34,795 botocore.auth [DEBUG] CanonicalRequest:
POST
/accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users
operation=create
host:service.chime.aws.amazon.com
x-amz-date:20200414T042934Z

host;x-amz-date
d57e352f3173e4ad4eb0482bc8c6113808ef014a754e85e0cebe0d4c2efb210b
[DEBUG] botocore.auth: StringToSign:
AWS4-HMAC-SHA256
20200414T042934Z
20200414/us-east-1/chime/aws4_request
b6c9f9db52f616be81175e1d3906f020d76e53b29f457a33ce6a2f9f8a0855ff
2020-04-14 04:29:34,879 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20200414T042934Z
20200414/us-east-1/chime/aws4_request
b6c9f9db52f616be81175e1d3906f020d76e53b29f457a33ce6a2f9f8a0855ff
[DEBUG] botocore.auth: Signature:
d11e72048d48c75b6801c9bbf48efd2c8b4174e1cf8bdd00f51732af92fe3b61
2020-04-14 04:29:34,880 botocore.auth [DEBUG] Signature:
d11e72048d48c75b6801c9bbf48efd2c8b4174e1cf8bdd00f51732af92fe3b61
[DEBUG] botocore.endpoint: Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://service.chime.aws.amazon.com/accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users?operation=create, headers={'User-Agent': b'Boto3/1.12.39 Python/3.6.9 Linux/4.19.76-linuxkit Botocore/1.15.39', 'X-Amz-Date': b'20200414T042934Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAWHADH74D3STKFT6M/20200414/us-east-1/chime/aws4_request, SignedHeaders=host;x-amz-date, Signature=d11e72048d48c75b6801c9bbf48efd2c8b4174e1cf8bdd00f51732af92fe3b61', 'Content-Length': '90'}>
2020-04-14 04:29:34,881 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://service.chime.aws.amazon.com/accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users?operation=create, headers={'User-Agent': b'Boto3/1.12.39 Python/3.6.9 Linux/4.19.76-linuxkit Botocore/1.15.39', 'X-Amz-Date': b'20200414T042934Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAWHADH74D3STKFT6M/20200414/us-east-1/chime/aws4_request, SignedHeaders=host;x-amz-date, Signature=d11e72048d48c75b6801c9bbf48efd2c8b4174e1cf8bdd00f51732af92fe3b61', 'Content-Length': '90'}>
[DEBUG] urllib3.connectionpool: Resetting dropped connection: service.chime.aws.amazon.com
2020-04-14 04:29:34,890 urllib3.connectionpool [DEBUG] Resetting dropped connection: service.chime.aws.amazon.com
[DEBUG] urllib3.connectionpool: https://service.chime.aws.amazon.com:443 "POST /accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users?operation=create HTTP/1.1" 400 131
2020-04-14 04:29:36,300 urllib3.connectionpool [DEBUG] https://service.chime.aws.amazon.com:443 "POST /accounts/7e1fe1a5-c81b-4a9c-9c6c-c1a100dba141/users?operation=create HTTP/1.1" 400 131
[DEBUG] botocore.parsers: Response headers: {'x-amzn-RequestId': 'fa0c7b5c-925f-4f1c-b78a-5c888c24d90e', 'x-amzn-ErrorType': 'BadRequestException:', 'Content-Type': 'application/json', 'Content-Length': '131', 'Date': 'Tue, 14 Apr 2020 04:29:35 GMT', 'Connection': 'close'}
2020-04-14 04:29:36,305 botocore.parsers [DEBUG] Response headers: {'x-amzn-RequestId': 'fa0c7b5c-925f-4f1c-b78a-5c888c24d90e', 'x-amzn-ErrorType': 'BadRequestException:', 'Content-Type': 'application/json', 'Content-Length': '131', 'Date': 'Tue, 14 Apr 2020 04:29:35 GMT', 'Connection': 'close'}
[DEBUG] botocore.parsers: Response body:
b'{"Code":"BadRequest","Message":"Service received a bad request","RequestId":"fa0c7b5c-925f-4f1c-b78a-5c888c24d90e","Resource":null}'
2020-04-14 04:29:36,306 botocore.parsers [DEBUG] Response body:
b'{"Code":"BadRequest","Message":"Service received a bad request","RequestId":"fa0c7b5c-925f-4f1c-b78a-5c888c24d90e","Resource":null}'
[DEBUG] botocore.hooks: Event needs-retry.chime.CreateUser: calling handler <botocore.retryhandler.RetryHandler object at 0x7f5e23482320>
2020-04-14 04:29:36,309 botocore.hooks [DEBUG] Event needs-retry.chime.CreateUser: calling handler <botocore.retryhandler.RetryHandler object at 0x7f5e23482320>
[DEBUG] botocore.retryhandler: No retry needed.
2020-04-14 04:29:36,311 botocore.retryhandler [DEBUG] No retry needed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
swetashrecommented, Apr 21, 2020

@matiboy - You can use this api https://docs.aws.amazon.com/chime/latest/APIReference/API_InviteUsers.html which invites the user to your account. So that if that user logs in they will automatically be part of the team of the person that invited them.

With an enterprise account, any users that register for Amazon Chime with an email address for your claimed domains are automatically added to your account. So if they just login they will automatically be joined into that account and you do not have to invite the user.

These document have some more information: https://docs.aws.amazon.com/chime/latest/ag/manage-access.html

Hope this helps.

0reactions
matiboycommented, Apr 21, 2020

@swetashre Thank you for your reply; so just to confirm, as of right now, I can’t create users in my “Team” based account? If that’s indeed the case then I’ll close the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Amazon Chime identity and access
After you create your IAM user access keys, you can view your access key ID at any time. However, you can't view your...
Read more >
Why are my users not able to sign in? - Amazon Chime Help ...
They were previously able to sign in. Now some users are seeing "Authorization Failed" error messages when trying to sign in. errorsign-in.
Read more >
Unable to create user from Amazon Chime - Stack Overflow
I am trying to create user using "CreateUser" function of Amazon Chime through javascript but I am getting "BadRequestException: Service ...
Read more >
Chime — Boto3 Docs 1.26.29 documentation - Amazon AWS
After that, the attendee is unable to join the meeting. We recommend securely transferring each JoinToken from your server application to the client...
Read more >
FAQs | amazon-chime-sdk-js - Open Source at AWS
If you have more questions, contact Customer support. ... You cannot use the Amazon Chime SDK to build a custom client to join...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found