Skip to content

File upload fails with "Cannot read property 'enableForAnonymousUser' of undefined" #7085

Closed
@gnunicorn

Description

@gnunicorn

New Issue Checklist

Issue Description

Trying to upload a file (as a logged in user), the request endlessly stales and the server errors with:

parse_1      | (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'enableForAnonymousUser' of undefined
parse_1      |     at createHandler (/parse-server/lib/Routers/FilesRouter.js:113:41)
parse_1      |     at Layer.handle [as handle_request] (/parse-server/node_modules/express/lib/router/layer.js:95:5)
parse_1      |     at next (/parse-server/node_modules/express/lib/router/route.js:137:13)
parse_1      |     at /parse-server/lib/middlewares.js:252:7
parse_1      |     at runMicrotasks (<anonymous>)
parse_1      |     at processTicksAndRejections (internal/process/task_queues.js:93:5)
parse_1      | (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

Steps to reproduce

Get the docker-image (no custom configuration) try to upload a file as a regular user. The promise never finishes.

Actual Outcome

The server error's and the network never responds.

Expected Outcome

The server should accept the upload, store the file and respond

Failing Test Case / Pull Request

Looks like it was introduced in #7071.

Environment

Using current latest docker image: https://hub.docker.com/layers/parseplatform/parse-server/latest/images/sha256-1b8dfd378cc731e9b81f6398e0eadbaef368f60ad9d731d09b299df0d375ffda?context=explore

Database

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

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Javascript
  • SDK version: 2.19.0

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versionstate:released-betaReleased as beta versiontype:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions