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

[FEATURE] Handle 503 response properly #2391

Closed
penghuo opened this issue Oct 30, 2023 · 0 comments
Closed

[FEATURE] Handle 503 response properly #2391

penghuo opened this issue Oct 30, 2023 · 0 comments
Assignees
Labels
bug Something isn't working Flint v2.12.0 Issues targeting release v2.12.0

Comments

@penghuo
Copy link
Collaborator

penghuo commented Oct 30, 2023

When supplying malformed inputs to the, some inputs resulted in a 503 error response. The following request and response pairs are supplied as examples of requests when 503 errors were returned by the application.

POST /_plugins/_async_query HTTP/1.1
Host: search-flint-pentest-nonvpc-oct-18-2kzkhs77tftmh6upidtglzu6em.us-west-2.es-release.amazonaws.com
Content-Length: 129

{"datasource": "my_glueaaaaaaaaaaaaaaaaaaaa", "lang": "sql", "query": "select * from my_glue.default.http_logs_non_vpc limit 10"}
Request With Non-Existent Datasource

HTTP/1.1 503 Service Unavailable
Date: Thu, 19 Oct 2023 20:36:03 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 221
Connection: close
access-control-allow-origin: *

{
  "status": 503,
  "error": {
    "type": "DataSourceNotFoundException",
    "reason": "There was internal problem at backend",
    "details": "DataSource with name my_glueaaaaaaaaaaaaaaaaaaaa doesn\u0027t exist."
  }
}
503 Error Response

GET /_plugins/_async_query/00fe3g1k1eaj480m HTTP/1.1
Host: search-flint-pentest-nonvpc-oct-18-2kzkhs77tftmh6upidtglzu6em.us-west-2.es-release.amazonaws.com

Request With Non-Existent QueryId

HTTP/1.1 503 Service Unavailable
Date: Thu, 19 Oct 2023 20:39:18 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 188
Connection: close
access-control-allow-origin: *

{
  "status": 503,
  "error": {
    "type": "AsyncQueryNotFoundException",
    "reason": "There was internal problem at backend",
    "details": "QueryId: 00fe3g1k1eaj480m not found"
  }
}
503 Error Response

DELETE /_plugins/_async_query/00fe3aag2kbuj8ug0m HTTP/1.1
Host: search-flint-pentest-nonvpc-oct-18-2kzkhs77tftmh6upidtglzu6em.us-west-2.es-release.amazonaws.com
Content-Length: 2

{}
Request With Non-Existent QueryId

HTTP/1.1 503 Service Unavailable
Date: Thu, 19 Oct 2023 20:42:30 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 190
Connection: close
access-control-allow-origin: *

{
  "status": 503,
  "error": {
    "type": "AsyncQueryNotFoundException",
    "reason": "There was internal problem at backend",
    "details": "QueryId: 00fe3aag2kbuj8ug0m not found"
  }
}
503 Error Response

POST /_plugins/_sql HTTP/1.1
Host: search-flint-pentest-nonvpc-oct-18-2kzkhs77tftmh6upidtglzu6em.us-west-2.es-release.amazonaws.com
Content-Length: 51


{
  "query": "SELECT * FROM .kibana LIMIT 50"
}
OpenSearch Dashboard Request User Does Not Have Permissions

HTTP/1.1 503 Service Unavailable
Date: Fri, 20 Oct 2023 17:56:31 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 697
Connection: close
access-control-allow-origin: *

{
  "error": {
    "reason": "Error occurred in OpenSearch engine: no permissions for [indices:admin/mappings/get] and User [name=arn:aws:iam::789207650999:role/a9cs-test-alt2-Admin, backend_roles=[arn:aws:iam::789207650999:role/a9cs-test-alt2-Admin], requestedTenant=null]",
    "details": "OpenSearchSecurityException[no permissions for [indices:admin/mappings/get] and User [name=arn:aws:iam::789207650999:role/a9cs-test-alt2-Admin, backend_roles=[arn:aws:iam::789207650999:role/a9cs-test-alt2-Admin], requestedTenant=null]]\nFor more details, please send request for Json format to see the raw response from OpenSearch engine.",
    "type": "OpenSearchSecurityException"
  },
  "status": 403
}
503 Error Response

POST /_plugins/_sql HTTP/1.1
Host: search-flint-pentest-nonvpc-oct-18-2kzkhs77tftmh6upidtglzu6em.us-west-2.es-release.amazonaws.com
Content-Length: 51


{
  "query": "SELECT * from I_THINK/IM/A_URL"
}
Request Through OpenSearch Dashboard With Malformed Query

HTTP/1.1 503 Service Unavailable
Date: Mon, 23 Oct 2023 21:20:13 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 444
access-control-allow-origin: *

{
  "error": {
    "reason": "There was internal problem at backend",
    "details": "class com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr cannot be cast to class com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr (com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr and com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr are in unnamed module of loader java.net.FactoryURLClassLoader @6da646b8)",
    "type": "ClassCastException"
  },
  "status": 503
}
503 Error Response

POST /_plugins/_async_query HTTP/1.1
Host: search-flint-pentest-nonvpc-oct-18-2kzkhs77tftmh6upidtglzu6em.us-west-2.es-release.amazonaws.com
Content-Length: 191

{"datasource": "my_glue","datasource": "my_glueaaaaaaaaa", "lang": "sql", "query": "SELECT INDEX my_glue AND select * from my_glue.default.http_logs_non_vpc limit 10,.query_execution_result"}
Query Request With Duplicate Datasource

HTTP/1.1 400 Bad Request
Date: Wed, 25 Oct 2023 17:53:49 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 377
Connection: close
access-control-allow-origin: *

{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Duplicate field 'datasource'\n at [Source: (org.opensearch.core.common.io.stream.InputStreamStreamInput); line: 1, column: 38]"}],"type":"json_parse_exception","reason":"Duplicate field 'datasource'\n at [Source: (org.opensearch.core.common.io.stream.InputStreamStreamInput); line: 1, column: 38]"},"status":400}
Verbose Error Response

POST /_plugins/_async_query HTTP/1.1
Host: search-flint-pentest-nonvpc-oct-18-2kzkhs77tftmh6upidtglzu6em.us-west-2.es-release.amazonaws.com
Content-Length: 167

{"datasource": ["my_glue","test"], "lang": "sql", "query": "SELECT INDEX my_glue AND select * from my_glue.default.http_logs_non_vpc limit 10,.query_execution_result"}
Request With Datasource Array

HTTP/1.1 500 Server Error
Date: Wed, 25 Oct 2023 17:54:01 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 209
Connection: close
access-control-allow-origin: *

{"error":{"root_cause":[{"type":"illegal_state_exception","reason":"Can't get text on a START_ARRAY at 1:16"}],"type":"illegal_state_exception","reason":"Can't get text on a START_ARRAY at 1:16"},"status":500}
500 Error Response
@penghuo penghuo added enhancement New feature or request untriaged v2.11.1 Issues targeting release v2.11.1 labels Oct 30, 2023
@penghuo penghuo changed the title [FEATURE] Handle response properly. [FEATURE] Handle 503 response properly Oct 30, 2023
@anirudha anirudha added v2.12.0 Issues targeting release v2.12.0 and removed v2.11.1 Issues targeting release v2.11.1 labels Oct 30, 2023
@penghuo penghuo added the Flint label Oct 31, 2023
@penghuo penghuo added bug Something isn't working and removed enhancement New feature or request labels Nov 29, 2023
@vmmusings vmmusings self-assigned this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Flint v2.12.0 Issues targeting release v2.12.0
Projects
None yet
Development

No branches or pull requests

4 participants