parse-community / parse-community/parse-server

Parse.Files cannot be created if over 512MB

Open
#9,283 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

New Issue Checklist
Issue Description

Files larger than 512MB are not able to be uploaded to Parse Server as Parse.Files.

The files are converted to stings, which is more than Node can handle.

Steps to reproduce

Upload a file bigger than 512MB.

Actual Outcome
Error: Cannot create a string longer than 0x1fffffe8 characters

    at Object.slice (node:buffer:654:37)

    at Buffer.toString (node:buffer:824:14)

    at createHandler (/project/server/node_modules/parse-server/lib/Routers/FilesRouter.js:153:29)

    at Layer.handle [as handle_request] (/project/server/node_modules/express/lib/router/layer.js:95:5)

    at next (/project/server/node_modules/express/lib/router/route.js:144:13)

    at handleParseSession (/project/server/node_modules/parse-server/lib/middlewares.js:281:7)

    at Layer.handle [as handle_request] (/project/server/node_modules/express/lib/router/layer.js:95:5)

    at next (/project/server/node_modules/express/lib/router/route.js:144:13)

    at handleRateLimit (/project/server/node_modules/parse-server/lib/middlewares.js:275:3)

    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {

  code: 'ERR_STRING_TOO_LONG'

This appears to come from this line:
https://github.com/parse-community/parse-server/blob/6.3.1/src/Routers/FilesRouter.js#L175

Expected Outcome

The Parse.File to be created.

Environment

Server

  • Parse Server version: 6.3.1
  • Operating system: Linux
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Aptible

Database

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

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Android
  • SDK version: 4.2.0
Logs

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 in src/Routers/FilesRouter.js around line 175 and inspect the createHandler path that converts uploaded file data to a string. Reproduce the failure with a file larger than 512MB, then verify that a Parse.File can be created without triggering Node's string-length error.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript, nodejs
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.