parse-community / parse-community/parse-server

TypeError: Cannot read property '*' of undefined

Open
#7,456 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

New Issue Checklist
Issue Description

I just upgrade to parse-server 4.5.0 and I'm getting the error below (in the logs section).

I'm running this using docker-compose, the parse container keeps restarting a couple of times with this error, then seems to be working fine. I checked the changelog and specifically #6465 but that doesn't seem to be it, since I'm running parse-server 4.5.0 and mongodb 4.4.6.

Steps to reproduce

Not sure how to reproduce this, because I'm pretty sure not everyone using parse-server 4.5.0 has this issue.

Actual Outcome

Server keeps restarting.

Expected Outcome

Server starts up successfully first time I start it.

Failing Test Case / Pull Request
  • 🤩 I submitted a PR with a fix and a test case.
  • 🧐 I submitted a PR with a failing test case.
Environment

Server

  • Parse Server version: 4.5.0
  • Operating system: Ubuntu 20.04 LTS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Digital Ocean

Database

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

Client (irrelevant as server doesn't start up)

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): FILL_THIS_OUT
  • SDK version: FILL_THIS_OUT
Logs
warn: Unable to ensure uniqueness for usernames:  Cannot read property '*' of undefined {"stack":"TypeError: Cannot read property '*' of undefined\n    at SchemaData.get (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:671:84)\n    at SchemaController.enforceClassExists (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:1013:24)\n    at /app/node_modules/parse-server/lib/Controllers/DatabaseController.js:1432:70\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)"}
warn: Unable to create case insensitive username index:  Cannot read property '*' of undefined {"stack":"TypeError: Cannot read property '*' of undefined\n    at SchemaData.get (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:671:84)\n    at SchemaController.enforceClassExists (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:1013:24)\n    at /app/node_modules/parse-server/lib/Controllers/DatabaseController.js:1432:70\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)"}
warn: Unable to ensure uniqueness for user email addresses:  Cannot read property '*' of undefined {"stack":"TypeError: Cannot read property '*' of undefined\n    at SchemaData.get (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:671:84)\n    at SchemaController.enforceClassExists (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:1013:24)\n    at /app/node_modules/parse-server/lib/Controllers/DatabaseController.js:1432:70\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)"}
warn: Unable to create case insensitive email index:  Cannot read property '*' of undefined {"stack":"TypeError: Cannot read property '*' of undefined\n    at SchemaData.get (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:671:84)\n    at SchemaController.enforceClassExists (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:1013:24)\n    at /app/node_modules/parse-server/lib/Controllers/DatabaseController.js:1432:70\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)"}
TypeError: Cannot read property '*' of undefined
    at SchemaData.get (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:671:84)
    at SchemaController.enforceClassExists (/app/node_modules/parse-server/lib/Controllers/SchemaController.js:1013:24)
    at /app/node_modules/parse-server/lib/Controllers/DatabaseController.js:1432:70
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

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 inspecting SchemaController.js at SchemaData.get and SchemaController.enforceClassExists, then trace the call from DatabaseController.js:1432. Reproduce the Parse Server 4.5.0 startup with Docker Compose, MongoDB 4.4.6, and the reported environment; done means the server starts successfully without the TypeError warnings.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.