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

[BUG] MLResourceNotFoundException leads to 500 error #2958

Open
dbwiddis opened this issue Sep 16, 2024 · 1 comment
Open

[BUG] MLResourceNotFoundException leads to 500 error #2958

dbwiddis opened this issue Sep 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dbwiddis
Copy link
Member

dbwiddis commented Sep 16, 2024

What is the bug?

The MLResourceNotFoundException is just a decorated RuntimeException with special handling for ML Stats.

However, it's used in cases where a document is not found which should generally result in a 404 error.

How can one reproduce the bug?
Steps to reproduce the behavior:

  • Follow any code path leading to the MLResourceNotFound exception handling in ModelAccessControlHelper.validateModelGropuAccess() which would be trying to register a model to a model group that doesn't exist, or having the model group index not exist. This may be difficult to encounter the exception due to being caught earlier in the handling, but is appearing in the MultiTenancy branch due to tenant ID checks.
{
  "error": {
    "root_cause": [
      {
        "type": "m_l_resource_not_found_exception",
        "reason": "Fail to find model group"
      }
    ],
    "type": "m_l_resource_not_found_exception",
    "reason": "Fail to find model group"
  },
  "status": 500
}

What is the expected behavior?

A resource "not found" should result in a 4xx series error, usually a 404.

Do you have any additional context?

An OpenSearchStatusException would probably be appropriate here but it's not quite as simple since we have to keep the current stats exclusion exceptions, so a more careful refactoring is needed.

@dbwiddis dbwiddis added bug Something isn't working untriaged labels Sep 16, 2024
@ylwu-amzn
Copy link
Collaborator

Thanks @dbwiddis , good point. Need to research how to enhance this part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: On-deck
Development

No branches or pull requests

4 participants