R2-3483 : `R2 put: Unspecified error` on remote binding
What versions & operating system are you using?
Wrangler 4.20.5
Please provide a link to a minimal reproduction
No response
Describe the Bug
Letting my local wrangler instance sit idle for a while eventually causes requests to R2 remote bindings to throw. PUTs to R2 specifically throw an error (see error below).
Restarting my wrangler dev fixes this. I'm able to provide more details if needed.
Please provide any relevant error logs
▲ [WARNING] workerd/api/r2-rpc.c++:242: warning: R2 error response does not contain the CF-R2-Error header.; response.statusCode = 400
error [Error: put: Unspecified error (0)]
Thanks for reporting this! Would you be able to provide a reproduction repo that demonstrates the issue?
Hi @penalosa here is a very basic reproduction: https://github.com/hexcowboy/cf-workers-remote-binding-bug
➜ curl -X POST http://localhost:3009/upload/test-3
Internal Server Error%
To reproduce, let the dev server sit idle. I'm not sure exactly how long this takes but after 2 hours of idle I reproduced it in the screenshot above.
Also seeing this for other R2 operations like head
▲ [WARNING] workerd/api/r2-rpc.c++:122: warning: R2 error response does not contain the CF-R2-Error header.; respons
e.statusCode = 400
✘ [ERROR] [Error: head: Unspecified error (0)]
I am experiencing the same error. I'll go back to using an S3 implementation for now.
hi @hexcowboy,
thank you so much for the repro 🙏 . I noticed that in your repro you are using the experimental remote mode, and was wondering if you are experiencing the same issue in remote mode proper
@CarmenPopoviciu After about 1.5h idle with --remote instead of --x-remote-bindings, I'm seeing a different error
➜ curl -X POST http://localhost:3009/upload/test-5
error code: 1031%
Usually restart helps, but today I have this error on permanent basis
workerd/api/r2-rpc.c++:242: warning: R2 error response does not contain the CF-R2-Error header.; response.statusCode = 503
hi all, we're checking with the internal team about this error, but in the meantime @istarkov to clarify, are you running with remote bindings or wrangler dev --remote?
we've raised an internal ticket: R2-3483
remote bindings through import adapter from "@sveltejs/adapter-cloudflare";
adapter: adapter({
platformProxy: {
// environment: "staging",
configPath: "./wrangler.jsonc",
experimental: {
remoteBindings: true,
},
},
}),
The issue probably somehow depends on the connection quality. I had issue with my router, it seems like it broke idle connections with > 60s idle timeout. I still see the issue periodically, but not that often like that day.
Having the same issue.
orkerd/api/r2-rpc.c++:122: warning: R2 error response does not contain the CF-R2-Error header.; response.statusCode = 400
wrangler.jsonwith below binding:
"main": "src/main.ts",
"compatibility_date": "2025-04-17",
"compatibility_flags": [
"nodejs_compat"
],
"r2_buckets": [
{
"bucket_name": "example-bucket",
"binding": "example_bucket",
"experimental_remote": true
}
],
wrangler dev --persist-to ../../.wrangler/state --x-remote-bindingsusing 4.33.2 on Ubuntu 22.04- Binding works initially. But after keeping the dev server running for a while (~1-2 hours) it starts showing the same error when getting requests that need to access the binding. I.e.
Unhandled error: Error: head: Unspecified error (0)from:
const object = await env.example_bucket.head(this.objectKey);
- Kill dev server and restart with command from step 2 -> It works again for a while.
Let me know if you need more info.
The same thing happens with range queries after some time of running.
R2 error response does not contain the CF-R2-Error header.; response.statusCode = 500 JsError( "Error: Error: put: Unspecified error (0) - Cause: Error: put: Unspecified error (0)", ) [wrangler:info] POST /admin_api/upload/r2 200 OK (6653ms)
there are 400 code. i am 500 code.
using worker-rs.
I have this same issue, reading from R2 remote after a while of letting my local cf worker instance (wrangler dev) sit idle for a bit. I've set it up like this:
[[r2_buckets]]
binding = "R2_BUCKET"
bucket_name = "MY_BUCKET"
remote = true
Logs:
R2 error response does not contain the CF-R2-Error header.; response.statusCode = 400
[wrangler:error] Error: get: Unspecified error (0)
For me it started working after deleting .wrangler (cache) folder and restarting my server
Glad I found this thread. I am having the exact same issue. Idle worker in dev --remote, idle 1h22 min, put Unspecified error. Restarted it and it works.