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

When Bedrock model is deprecated, SDK throws ValidationException instead of ResourceNotFoundException #6424

Open
abhirpat opened this issue Aug 28, 2024 · 3 comments
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@abhirpat
Copy link

abhirpat commented Aug 28, 2024

Describe the bug

When Bedrock model is deprecated from a region, SDK throws ValidationException instead of ResourceNotFoundException. This leads to confusion in error handling because according to SDK documentation.

Based on these definitions, the ResourceNotFoundException is more appropriate in this case. Also, note the ValidationException is recommended by Bedrock team to retry request when sessionId expires after 24 hours. When model not available, it can cause ThrottlingException if developer was not made through documentation.

  • ResourceNotFoundException - The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
  • ValidationException - Input validation failed. Check your request parameters and retry the request.
    __

Expected Behavior

Here the model resource was removed from the region so it should throw ResourceNotFoundException.

Current Behavior

The SDK throws ValidationException

Reproduction Steps

  1. Configure and code RetrieveAndGenerate API
  2. Make a request using a model that is not available in the region for e.g. Titan Text Premier not available in us-west-2 as of now
  3. Note that the error thrown is ValidationException

Possible Solution

When Bedrock model resource is not available in the region then it should throw ResourceNotFoundException instead of ValidationException.

Additional Information/Context

No response

SDK version used

latest

Environment details (OS name and version, etc.)

Node 18

@abhirpat abhirpat added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 28, 2024
@zshzbh
Copy link

zshzbh commented Aug 28, 2024

Hey @abhirpat,

The links you provided are AWS SDK JS V3 related. It seems that you have a question for AWS SDK JS V3, could you please confirm the version of AWS SDK you used? I can redirect this ticket to JS SDK V3 repo.

Thanks!
Maggie

@zshzbh zshzbh added p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 28, 2024
@zshzbh zshzbh self-assigned this Aug 28, 2024
@abhirpat
Copy link
Author

Thanks @zshzbh . It's the latest version 3.638.0.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Aug 29, 2024
@zshzbh zshzbh transferred this issue from aws/aws-sdk-js Aug 30, 2024
@RanVaknin
Copy link
Contributor

When Bedrock model is deprecated from a region, SDK throws ValidationException instead of ResourceNotFoundException. This leads to confusion in error handling because according to SDK documentation.

The server is the one that returns this exception. The SDK has no discretion about which error to raise, instead the Bedrock API is the entity that is returning the wrong error.

This is not actionable by the SDK team. My suggestion is to submit documentation feedback to the Bedrock team directly using the feedback link

Thanks,
Ran~

@RanVaknin RanVaknin added the service-api This issue is due to a problem in a service API, not the SDK implementation. label Sep 4, 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 bug. p3 This is a minor priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

3 participants