Unsupported `__op` value in a write request returns HTTP 500
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, mongodb, nodejs, postgres
Línea de trabajo
Empieza leyendo SchemaController.getObjectType y sigue cómo las solicitudes de escritura validan los objetos de operación antes de llegar a los adaptadores de almacenamiento. Revisa los errores existentes de los adaptadores y las pruebas relacionadas para detectar valores __op no compatibles. Se considera terminado cuando las solicitudes de creación y actualización con SetOnInsert o un operador desconocido devuelvan un error de cliente que indique el operador no compatible, en lugar de HTTP 500.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 21.4k
- Forks
- 4.8k
- Merge medio
- 7 h 8 min
- PR fusionados (30 d)
- 65
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de parse-community/parse-server
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
parse-community/parse-server#10871 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
parse-community/parse-server#10870 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Query with an include path through an inherited object member fails with an internal server errorPosiblemente ocupada @charan-rathore la tomó hace 17 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
parse-community/parse-server#10795 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
parse-community/parse-server#10794 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Add MongoDB 9 supportPosiblemente ocupada @ga262 la tomó hace 31 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
parse-community/parse-server#10750 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de parse-community/parse-server
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
hugomrdias/playwright-test#753 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
KonstantinStarovoytov/kitden#21 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
guybedford/es-module-shims#556 ·
-
app ernst:4-klein
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NewspeedyNL/PidLane#683 ·
Los mantenedores suelen responder en 1 día