Skip to content

fix: Pinata upload times out on files larger than 50MB #3

Description

@brightpixel-dev

Bug Report

The /api/ipfs/upload endpoint returns a 504 timeout error for audio files larger than approximately 50MB. This affects producers uploading high-quality WAV and FLAC files.

Steps to Reproduce

  1. Prepare a 24-bit 48kHz WAV file (~60MB)
  2. POST it to /api/ipfs/upload with multipart form data
  3. Observe: request hangs for ~30 seconds then returns 504

Root Cause

Axios default timeout is too low for large payloads over slow connections. The current axios.post call to Pinata has no explicit timeout set, so it falls back to the OS TCP timeout (~30s).

Fix

// In src/services/ipfs.ts
const response = await axios.post(PINATA_URL, form, {
  headers: { ... },
  timeout: 5 * 60 * 1000, // 5 minutes for large files
  maxBodyLength: Infinity,
  maxContentLength: Infinity,
});

Also raise the multer fileSize limit from 100MB to 200MB and document it in the README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions