Skip to content

Parse Cloud Code Function won't allow Queries, or any object manipulation through cloud code. #7728

Closed
@malcolm-dane

Description

@malcolm-dane

New Issue Checklist

Issue Description

Repeated errors in cloud code function using queries. Setting no user in the fields, using master key etc doesn't allow for queries,object manipulation etc. Throws error: Parse error: TypeError: Cannot read property 'protectedFields' of undefined {"code":1,"stack":"Error: TypeError: Cannot read property 'protectedFields' of undefined\n at /app/node_modules/parse-server/lib/Controllers/DatabaseController.js:1170:21\n at processTicksAndRejections (internal/process/task_queues.js:95:5)"}

Steps to reproduce

I had the latest Parse Server, dropped it down to a few months old, and still the bug was there. Create cloud function to Query an Object and return an array etc. Manually created mongoatlas entries and tried to query them via cloud function, these items had no permissions set. master key was set to be used, and user set to false.

Actual Outcome

I have gotten several errors similiar to this or like this one:

error: Parse error: TypeError: Cannot read property 'protectedFields' of undefined {"code":1,"stack":"Error: TypeError: Cannot read property 'protectedFields' of undefined\n at /app/node_modules/parse-server/lib/Controllers/DatabaseController.js:1170:21\n at processTicksAndRejections (internal/process/task_queues.js:95:5)"}

Expected Outcome

For it to atleast return something retrieved from the backend

Environment

Heroku 20
Parse Server 4.10.0 -> latest build.
Updated Node, downgraded node etc. Didn't go too long ago in version numbers.

Server
"parse": "3.4.0",
"parse-server": "4.10.0"

  • Parse Server version: 4.10 but also latest
  • Operating system: `Ubuntu'
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): heroku

Database

  • System (MongoDB or Postgres): atlas
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Atlas

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): REST

Logs

error: Parse error: TypeError: Cannot read property 'protectedFields' of undefined {"code":1,"stack":"Error: TypeError: Cannot read property 'protectedFields' of undefined\n at /app/node_modules/parse-server/lib/Controllers/DatabaseController.js:1170:21\

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions