[BUG] SQL returns 500 StringIndexOutOfBoundsException for an empty cursor
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
障害は RestSqlAction.isLegacyCursor に起因します。このメソッドは空文字列かどうかを確認せずに cursor.substring(0, 1) を呼び出しています(RestSqlAction.java の251行目付近)。_plugins/_sql と _plugins/_sql/close のどちらもこのクラスを経由します。各エンドポイントに {"cursor": ""} を POST して再現させたうえで、空のカーソルに対して HTTP 400 を返すガードを追加してください。両方のエンドポイントが空のカーソルに対して 400 を返し、それをテストが検証していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What is the bug?
A request with an empty cursor returns HTTP 500 with StringIndexOutOfBoundsException. This is a bad request, so it should return 400.
How can one reproduce the bug?
POST _plugins/_sql
{"cursor": ""}
{
"error": {
"reason": "There was internal problem at backend",
"details": "Range [0, 1) out of bounds for length 0",
"type": "StringIndexOutOfBoundsException"
},
"status": 500
}
POST _plugins/_sql/close with the same body returns the same 500.
What is the expected behavior?
HTTP 400 with a message that the cursor is empty or invalid.
What is your host/environment?
- main at 135d7db4d (3.10.0-SNAPSHOT), local
integTestcluster - Plugins: opensearch-sql
Do you have any additional context?
RestSqlAction.isLegacyCursor calls cursor.substring(0, 1) without checking for an empty string (line 251). Both endpoints are handled by RestSqlAction.
- 主要言語
- Java
- スター
- 176
- フォーク
- 237
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 34
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opensearch-project/sql のほかの issue
-
bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opensearch-project/sql#5990 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] PromQL queries fail with InvalidTypeIdException when metric has a label named "type"対応中かも @nagendramohan が 106 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
opensearch-project/sql#5684 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
[DOC] Calcite settings documentation missing examples対応中かも @AzazelSensei が 64 日前に担当しました。 オープンdocumentation PPL
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
opensearch-project/sql#4806 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
calcite enhancement Meta performance PPL untriaged
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
opensearch-project/sql#5991 ·
メンテナーはふだん 1 日以内に返信
-
bug duplicate untriaged
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
opensearch-project/sql#5989 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
opensearch-project/sql の issue をすべて見る
似ている issue
-
Document the isv:HDFGroup Linux package repositories and signing key対応中かも @brtnfld が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
checkstyle/checkstyle#23174 ·
メンテナーはふだん 1 日以内に返信
-
bug follow-up lane:backlog
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Sanne/incus-spawn#2620 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Execute API reports every non-400 error, including 404 "not found", with reason "System Error"オープンuntriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
opensearch-project/ml-commons#5296 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信