Skip to content

[BUG] Can't upload R2 incremental cache - recurring 503 Service Unavailable #1110

@grabmateusz

Description

@grabmateusz

Describe the bug

We have a project, when with wrangler 4.42.2 and @opennextjs/cloudflare version: 1.11.0 we're able to bulk upload R2 incremental cache containing over 17k assets on regular basis.
When we update dependencies to wrangler 4.62.0 and @opennextjs/cloudflare 1.16.2 bulk upload of R2 incremental cache stops to work with recurring 503 Service Unavailable

Steps to reproduce

  1. Create any project with hundreds of ISRed pages
  2. Try to deploy it to CF

Expected behavior

Like with wrangler 4.42.2 and @opennextjs/cloudflare version: 1.11.0 - R2 is populated, worker is deployed

@opennextjs/cloudflare version

1.16.2

Wrangler version

4.62.0

next info output

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 22.21.1
  npm: 10.9.4
  Yarn: 1.22.21
  pnpm: N/A
Relevant Packages:
  next: 15.5.10 // An outdated version detected (latest is 16.1.6), upgrade is highly recommended!
  eslint-config-next: 14.1.0
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.3.3
Next.js Config:
  output: N/A
 ⚠ An outdated version detected (latest is 16.1.6), upgrade is highly recommended!
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Additional context

We have a project, when with wrangler 4.42.2 and @opennextjs/cloudflare version: 1.11.0 we're able to bulk upload R2 incremental cache containing over 17k assets on regular basis. The logs looks as follows:

Populating R2 incremental cache...
Populating remote R2 incremental cache using batch upload...
Using batch upload with R2 credentials from environment variables
Successfully uploaded 17126 assets to R2 using batch upload

Now we would like to update to newest Wrangler and OpenNext, but it seems OpenNext changed the way of bulk uploading R2 cache, which is again error prone. In our logs we can see:

Resource location: remote 
Starting bulk upload of 16974 objects to bucket <bucket> using a concurrency of 50
Uploaded 0% (10 out of 16,974)
Uploaded 0% (20 out of 16,974)

and in the end:

Uploaded 21% (3,720 out of 16,974)
Uploaded 21% (3,730 out of 16,974)
▲ [WARNING] 🚧 `wrangler r2 bulk put` is an experimental command. Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose
▲ [WARNING] Processing wrangler.jsonc configuration:
    - Unexpected fields found in top-level field: ""
✘ [ERROR] Error uploading "<path>"
  Error: Failed to fetch <url>.fetch - 503: Service Unavailable);

In the end it is impossible to upload R2 incremental cache and in the end our deployment fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions