Skip to content

413 Content Too Large when uploading .nii.gz #13

Description

@jlukic

The Brain Age prediction endpoint rejects uploads with a 413 (Content Too Large) error. This occurs with a standard 7T MP2RAGE T1-weighted scan compressed as .nii.gz.

Error:

POST https://brainage-885179799162.us-central1.run.app/predict net::ERR_FAILED 413 (Content Too Large)
processFile @ brainage_simple.html:366

Steps to reproduce:

  1. Go to https://www.brainiac-platform.com
  2. Select Brain Age
  3. Upload a .nii.gz file (~47 MB)
  4. Request fails immediately with 413

File details:

  • Format: .nii.gz (gzipped NIfTI)
  • Size: ~47 MB
  • Source: 7T MP2RAGE UNI-DEN, 0.5mm isotropic (336x448x224)
  • The uncompressed .nii is ~65 MB

Note: the smaller 0.7mm acquisition (~28 MB .nii.gz) was not tested but may also exceed the limit depending on the threshold.

Potential fix:
The Google Cloud Run service's request body size limit needs to be increased from the default 32mb.

This can be set via:

  • gcloud run services update --max-request-body-size

Environment:

  • Browser: Chrome (Linux)
  • Date: 2026-02-17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions