Skip to content

cf r2 objects put --file fails with "timeout" on a 264 MB file (50 MB works) #73

Closed

Description

@paultnylund

cf version: 1.0.0-beta.5, macOS

What happens

Uploading a 264,177,556-byte file with cf r2 objects put <key> --bucket-name <bucket> --file <path> fails after about 30 seconds:

┌ Error
│ An unexpected error occurred
│
│ timeout
└

Exit code 1, and the object is not in the bucket afterwards (GET returns 404). The same command with a 1 MB and a 50 MB file of random bytes succeeds, and reading them back gives identical content. The command's help gives a 300 MB limit, so 264 MB should be accepted. wrangler r2 object put --remote uploads this same file size fine in our CI.

Repro

head -c 264177556 /dev/urandom > big.bin
cf r2 objects put probe/big.bin --bucket-name <bucket> --file big.bin

Expected

Uploads up to the documented 300 MB succeed, or the request timeout scales with file size or can be configured.

Activity

  1. added theissue type on Sep 30, 2026
  2. edgariscoding commented on Sep 30, 2026

    @edgariscoding

    Still happening on 1.0.0-beta.7 (macOS). It depends on upload time rather than size: on a slower uplink, a 50 MB file of random bytes also fails after about 30 seconds with the same bare timeout error, while a 5-byte file succeeds.

    head -c 50000000 /dev/urandom > r2-50m.bin
    cf r2 objects put r2-50m.bin --bucket-name <bucket> --file r2-50m.bin --content-type application/octet-stream
    # fails after 30.4 s: "An unexpected error occurred / timeout"
    

    The bundled client appears to default every API request to 30 seconds (timeoutInSeconds: (e.timeout ?? 3e4) / 1e3 in dist/auth-*.mjs), and neither cf r2 objects put --help nor the global flags expose a way to raise it. A --timeout flag, or a timeout that scales with the body size for uploads, would make the documented 300 MB limit reachable. It would also help if the error said which timeout was hit and how long it was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions