parse-community / parse-community/parse-server

query.exclude() gives error but no additional logs.

Open
#6,801 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

Hi. When I use exclude method in my cloud code, I get this error with no additional logs:

{"code":141,"level":"error","stack":"Error\n    at error (/root/parse/node_modules/parse-server/lib/Routers/FunctionsRouter.js:121:16)\n    at runMicrotasks (<anon$
{"functionName":"getHomeObjects","error":{"code":141},"params":{},"user":"Tw8o5jj3DJ","level":"error","message":"Failed running cloud function getHomeObjects for u$

This is console log:

Input: {}
  Error: {"code":141} {"functionName":"getHomeObjects","error":{"code":141},"params":{},"user":"Tw8o5jj3DJ"}
error: Parse error:  {"code":141,"stack":"Error\n    at error (/root/parse/node_modules/parse-server/lib/Routers/FunctionsRouter.js:121:16)\n    at processTicksAndRejections (internal/process/task_queues.js:97:5)"}
error: Failed running cloud function getHomeObjects for user Tw8o5jj3DJ with:

This error happens only when I use exclude method on queries. I use exclude method to exclude some array list from obbject

For example:
query.exclude("words");

The thing is this happens random. I have other cloud codes which uses same query but on different Class. It works but some other class it doesn't work.

I formatted my server and did a clean install but I still got the error.

But if I remove exclude, cloud code works fine

My parse server version is 4.2.0
My MongoDB version is also 4.2.0
Database is in localhost.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the getHomeObjects cloud function with and without query.exclude("words"), then inspect the failure path mentioned in lib/Routers/FunctionsRouter.js at line 121. Compare the affected class and query with the working case; done means the exclude failure is reproducible and produces useful diagnostic output or is fixed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, node.js
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.