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] Rest APIs without feature flag enabled return incorrect error message #292

Closed
dbwiddis opened this issue Dec 14, 2023 · 0 comments · Fixed by #295
Closed

[BUG] Rest APIs without feature flag enabled return incorrect error message #292

dbwiddis opened this issue Dec 14, 2023 · 0 comments · Fixed by #295
Assignees
Labels
bug Something isn't working v2.12.0

Comments

@dbwiddis
Copy link
Member

What is the bug?

The Base REST handler tracks consumed parameters and content.

When a param is required, and is not consumed (via request.param("foo")) the Base Rest Handler overrides whatever message is returned to OpenSearch.

How can one reproduce the bug?

  1. Start up OpenSearch but do not enable the Flow Framework feature flag.
  2. Attempt to use any API that uses a named param for workflow ID (get, status, etc.)
  3. Observe response:
{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "request [/_plugins/_flow_framework/workflow/foobar] contains unrecognized parameter: [workflow_id]"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "request [/_plugins/_flow_framework/workflow/foobar] contains unrecognized parameter: [workflow_id]"
    },
    "status": 400
}

What is the expected behavior?

The specific error message produced by the API (for example, the need to enable the feature flag).

Do you have any additional context?

The fix is to consume the param prior to any attempted rest response, for example:

String workflowId = request.param("workflow_id");

This is a similar error to #274 but more critical to fix (thus BUG instead of FEATURE). Both this bug and #274 can/should be fixed at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2.12.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant