Unsupported `__op` value in a write request returns HTTP 500
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, mongodb, nodejs, postgres
調査の方向性
まず SchemaController.getObjectType を読み、書き込みリクエストがストレージアダプターに到達する前に操作オブジェクトをどのように検証するかを追ってください。既存のアダプターエラーと関連テストを確認し、サポートされていない __op の値を調べてください。SetOnInsert または未知の演算子を含む作成および更新リクエストが、HTTP 500 ではなく、サポートされていない演算子を示すクライアントエラーを返せば完了です。
索引モデルが issue の本文から書いたものです。
説明
New Issue Checklist
- Report security issues confidentially.
- Any contribution is under this license.
- Before posting search existing issues.
Issue Description
A create or update whose field value is an operation object with an __op value that the REST API does not support returns HTTP 500 instead of a client error. This applies to SetOnInsert, which #8791 added for the server-side database API only, and to any unknown operator name.
SchemaController.getObjectType throws a plain string ('unexpected op: <name>') for an operator it does not know. The thrown value is not an Error, so it reaches the client as Internal server error and is logged without a message. The storage adapters reject such operators with a Parse error (COMMAND_UNAVAILABLE, "The operator is not supported yet."), but schema validation runs first and never gets there.
Steps to reproduce
POST /classes/Thingwith body{"counter": {"__op": "SetOnInsert", "amount": 1}}.PUT /classes/Thing/<objectId>with the same body.- Either request with
{"counter": {"__op": "Foo"}}.
All with the master key; the behavior is independent of ACL and class-level permissions.
Actual Outcome
HTTP 500 with {"code": 1, "message": "Internal server error."}. The server logs Uncaught internal server error. with no message or stack, because a string was thrown.
Expected Outcome
A client error that names the unsupported operator, for example HTTP 400 with Parse.Error.COMMAND_UNAVAILABLE (code 108) as the storage adapters already return, or Parse.Error.INCORRECT_TYPE (code 111). No HTTP 500.
Environment
Server
- Parse Server version:
9.10.7 - Operating system:
macOS - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
local
Database
- System (MongoDB or Postgres):
MongoDB(the error occurs in schema validation before the storage adapter, so Postgres is expected to behave the same) - Database version:
8.0 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
local
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
REST API - SDK version:
n/a
Logs
error: Uncaught internal server error.
- 主要言語
- JavaScript
- スター
- 21.4k
- フォーク
- 4.8k
- 平均マージ
- 7時間 8分
- マージ済み PR(30日)
- 65
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
parse-community/parse-server のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
parse-community/parse-server#10871 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
parse-community/parse-server#10870 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Query with an include path through an inherited object member fails with an internal server error対応中かも @charan-rathore が 17 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
parse-community/parse-server#10795 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
parse-community/parse-server#10794 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Add MongoDB 9 support対応中かも @ga262 が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
parse-community/parse-server#10750 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
parse-community/parse-server の issue をすべて見る
似ている issue
-
cdx-audit output written to a pipe is cut off at 64 KiB再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug mode:cli
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
Build produces empty forge.min.js: package.json lists "forge" instead of "node-forge"対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Fei2411/DeepSeek-Bot#963 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Miaotofu01/Study-Mate#244 ·
メンテナーはふだん 1 日以内に返信
-
test-reliability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Azure/azure-sdk-for-js#40672 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信