Unsupported `__op` value in a write request returns HTTP 500

オープン 初心者向け
#10,841 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@RagedPanda がすでに取り組んでいます。

2026年10月29日 から。

  • #10844 @RagedPanda による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, mongodb, nodejs, postgres
領域
api, backend, databases

調査の方向性

まず SchemaController.getObjectType を読み、書き込みリクエストがストレージアダプターに到達する前に操作オブジェクトをどのように検証するかを追ってください。既存のアダプターエラーと関連テストを確認し、サポートされていない __op の値を調べてください。SetOnInsert または未知の演算子を含む作成および更新リクエストが、HTTP 500 ではなく、サポートされていない演算子を示すクライアントエラーを返せば完了です。

索引モデルが issue の本文から書いたものです。

説明

New Issue Checklist
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
  1. POST /classes/Thing with body {"counter": {"__op": "SetOnInsert", "amount": 1}}.
  2. PUT /classes/Thing/<objectId> with the same body.
  3. 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

parse-community/parse-server のほかの issue

parse-community/parse-server の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。