Repository navigation
Closed
Labels
state:releasedReleased as stable versionReleased as stable versionstate:released-alphaReleased as alpha versionReleased as alpha versiontype:bugImpaired feature or lacking behavior that is likely assumedImpaired feature or lacking behavior that is likely assumed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
Issue Description
I have multiple fields to validate before saving an object. But in certain conditions, This causes server to crash
Steps to reproduce
Cloud Code:
Parse.Cloud.beforeSave('JobList', async (request) => {}, {
fields: {
type: {
required: true,
type: String,
options: ['Option A', 'Option B'],
},
project: {required: true},
},
validateMasterKey: true,
});
Field project is a pointer to another class.
send a save request with empty project field and an invalid string for type field (Anything other than "Option A" or "Option B").
Actual Outcome
The client receives the response Validation failed. Please specify data for project. but also server crashes!
Expected Outcome
The response can have either one of validation failed messages. but server should not crash.
Environment
Server
- Parse Server version:
6.4.0 - Operating system:
Windows - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Local
Database
- System (MongoDB or Postgres):
MongoDB - Database version:
6.0.9 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
MongoDB Atlas
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
Parse Dashboard v-5.3.0
Logs
Server writes the following error message in console:
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Validation failed. Invalid option for type. Expected: Option A, Option B".] {
code: 'ERR_UNHANDLED_REJECTION'
}
Reacted by Popo Hack
Metadata
Metadata
Assignees
Labels
state:releasedReleased as stable versionReleased as stable versionstate:released-alphaReleased as alpha versionReleased as alpha versiontype:bugImpaired feature or lacking behavior that is likely assumedImpaired feature or lacking behavior that is likely assumed
Activity
parse-github-assistant commentedon Nov 28, 2023
Thanks for opening this issue!
NabilPopo commentedon Jun 19, 2024
This issue still produce when even I try to verify inputs and I send empty field it will crash the server
mtrezza commentedon Jun 19, 2024
Could someone please open a PR with a failing test that demonstrates the issue?
NabilPopo commentedon Jun 19, 2024
I will do it
parseplatformorg commentedon Jul 25, 2026
🎉 This change has been released in version 9.10.1-alpha.5
parseplatformorg commentedon Sep 24, 2026
🎉 This change has been released in version 9.10.1