Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Created June 10, 2026 20:01
Show Gist options
  • Select an option

  • Save Takazudo/8759e71f5b11491dbae2893994fd9255 to your computer and use it in GitHub Desktop.

Select an option

Save Takazudo/8759e71f5b11491dbae2893994fd9255 to your computer and use it in GitHub Desktop.
Minimal repro: wrangler deploy 500/10013 for D1-bound Workers (account-scoped CF backend issue)

Minimal reproduction — wrangler deploy HTTP 500 [code: 10013] for D1-bound Workers

Note: this is an account-scoped Cloudflare backend issue — it reproduces only on affected accounts. On an affected account, ANY Worker with a D1 (or Durable Objects) binding fails at the deployment-creation step; the same Worker with no D1/DO binding deploys fine.

Steps

  1. npx wrangler d1 create repro-db and put the returned database_id into wrangler.toml
  2. npx wrangler deploy

Expected

Deploys normally.

Actual (on affected account)

Version upload succeeds, then POST /accounts/{account}/workers/scripts/{name}/deployments returns HTTP 500 with body {"result":null,"success":false,"errors":[{"code":10013,"message":"An unknown error has occurred..."}]}.

Also fails identically via wrangler versions deploy <id>@100% and via the legacy PUT /workers/scripts/{name} path (tested with wrangler 3.60.0). Removing the d1_databases block makes existing Workers deploy again (not viable for Workers whose code needs the binding).

export default {
async fetch(request, env) {
const row = await env.DB.prepare('SELECT 1 AS ok').first();
return new Response(JSON.stringify(row));
},
};
name = "d1-deploy-10013-repro"
main = "index.js"
compatibility_date = "2025-01-15"
[[d1_databases]]
binding = "DB"
database_name = "repro-db"
database_id = "PUT-YOUR-D1-DATABASE-ID-HERE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment