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

validate_e911_address returns invalid country code #4216

Open
cjhelloletsgo opened this issue Jul 23, 2024 · 2 comments
Open

validate_e911_address returns invalid country code #4216

cjhelloletsgo opened this issue Jul 23, 2024 · 2 comments
Labels
bug This issue is a confirmed bug. chime-sdk-voice p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.

Comments

@cjhelloletsgo
Copy link

cjhelloletsgo commented Jul 23, 2024

Describe the bug

The validate_e911_address api returns invalid country codes. If I enter "US" for the country code like in this python script (Address is a random address off zillow)

import boto3

chime_sdk_voice_client = boto3.client("chime-sdk-voice")

chime_response = chime_sdk_voice_client.validate_e911_address(
    AwsAccountId="YOUR_ACCOUNT_ID_GOES_HERE",
    StreetNumber="4360",
    StreetInfo="E 16th Avenue Unit 3",
    City="Denver",
    State="CO",
    Country="US",
    PostalCode="80220",
)

print(f"chime_response: {chime_response}")

I get this response:

{
  "ResponseMetadata": {
    "RequestId": "2043dd77-b139-4990-9ff9-13e89d969be6",
    "HTTPStatusCode": 202,
    "HTTPHeaders": {
      "date": "Tue, 23 Jul 2024 00:46:58 GMT",
      "content-type": "application/json",
      "content-length": "239",
      "connection": "keep-alive",
      "x-amzn-requestid": "2043dd77-b139-4990-9ff9-13e89d969be6"
    },
    "RetryAttempts": 0
  },
  "ValidationResult": 1,
  "AddressExternalId": "726bccfb130b49fba7b017aa8fcf96f7",
  "Address": {
    "streetName": "16th",
    "streetSuffix": "Ave",
    "preDirectional": "E",
    "streetNumber": "4360",
    "city": "Denver",
    "state": "CO",
    "postalCode": "80220",
    "country": "USA"
  }
}

ValidationResult is 1, which means the address had to be modified, the Country was returned as "USA" instead of "US" like I passed it in.

But if I try to validate again with USA instead this time it errors out and says that is invalid

Traceback (most recent call last):
  File "/home/colton/projects/work/firstfire/agero/test.py", line 5, in <module>
    chime_response = chime_sdk_voice_client.validate_e911_address(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/colton/projects/work/firstfire/agero/.venv/lib/python3.12/site-packages/botocore/client.py", line 565, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/colton/projects/work/firstfire/agero/.venv/lib/python3.12/site-packages/botocore/client.py", line 1021, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.BadRequestException: An error occurred (BadRequestException) when calling the ValidateE911Address operation: 2 validation errors detected: Value at 'country' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[A-Z]{2,2}$; Value at 'country' failed to satisfy constraint: Member must have length less than or equal to 2

The documentation is also unclear how to handle apartment numbers or different units, as you can see it just removes it in the validation result but it seems like it should be returned as postDirectional looking through the api responses.

Link to api docs

Expected Behavior

The api validates the address, if changes are required it returns a valid address in the response

Current Behavior

invalid responses are returned/apartments are unable to be accounted for in emergency calls

Reproduction Steps

Use snippets above

Possible Solution

Fix bugs/Improve documentation

Additional Information/Context

No response

SDK version used

1.34.145

Environment details (OS name and version, etc.)

Ubuntu 24.04

@cjhelloletsgo cjhelloletsgo added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Jul 23, 2024
@tim-finnigan tim-finnigan self-assigned this Jul 23, 2024
@tim-finnigan tim-finnigan added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Jul 23, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out. The validate_e911_address command makes a call to the ValidateE911Address API. We reached out to the Chime team regarding this behavior and can let you know when we have an update.

Since this is an issue involving the API, which is used across SDKs, I created a new issue to track this in our cross-SDK repository: aws/aws-sdk#789. Please refer to that issue for updates going forward.

@tim-finnigan tim-finnigan added service-api This issue is caused by the service API, not the SDK implementation. chime-sdk-voice and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Jul 23, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@tim-finnigan tim-finnigan reopened this Oct 30, 2024
@tim-finnigan tim-finnigan added the p2 This is a standard priority issue label Oct 30, 2024
@tim-finnigan tim-finnigan removed their assignment Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. chime-sdk-voice p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants