Skip to content

fix(deploy-helpers): treat code 10007 as a missing dispatch namespace Worker - #17387

Open
NuroDev wants to merge 2 commits into
mainfrom
NuroDev/dispatch-namespace-not-found
Open

NuroDev wants to merge 2 commits into
mainfrom
NuroDev/dispatch-namespace-not-found

Conversation

@NuroDev

@NuroDev NuroDev commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Fixes the Wrangler E2E shard 1 and 3 failures on the Version Packages PR (#17371).

Before uploading to a dispatch namespace, preUploadApiChecks fetches the script to see whether it already exists. It treated only code 10092 as "not found". The Cloudflare API now returns 10007 (This Worker does not exist on your account.) for a missing script in a dispatch namespace, so the check threw. Every first deploy of a new Worker with wrangler deploy --dispatch-namespace failed before upload.

That broke two E2E tests on every OS: deployments.test.ts (Workers for Platforms, assets-only deploy) and miniflare-remote-resources.test.ts (Dispatch Namespace remote binding, whose setup deploys into a dispatch namespace). The same tests passed on the Version Packages PR at 15:19 UTC today with unchanged code, so the API response changed rather than Wrangler.

The check now accepts both codes through isWorkerNotFoundError(), matching the Durable Object migrations lookup in durable.ts, which already handled both.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bug fix with no user-facing configuration or API changes

The new environments.test.ts case deploys a new Worker to a dispatch namespace with both a 10092 and a 10007 not-found response. The 10007 case failed with the same API error as CI before the fix.

🤖 Generated with Claude Code


Devin Review

… Worker

The Cloudflare API now reports a missing Worker in a dispatch namespace
with code 10007 instead of 10092, so the pre-upload existence check
threw and first deploys with `--dispatch-namespace` failed. Accept both
codes, matching the Durable Object migrations lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c8e8056

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@cloudflare/deploy-helpers Patch
wrangler Patch
@cloudflare/remote-bindings Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@NuroDev NuroDev self-assigned this Dec 4, 2026
@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Dec 4, 2026
@workers-devprod
workers-devprod requested review from a team and cjol and removed request for a team December 4, 2026 19:05
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/dispatch-namespace-not-found.md: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/helpers/validate-worker-props.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/environments.test.ts: [@cloudflare/wrangler]

devin-ai-integration[bot]

This comment was marked as resolved.

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — A small, well-scoped bug fix. The regression test now covers all three not-found codes (10092, 10007, 10090), and no issues were found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No security concerns.


📋 Code Quality: ✅ LGTM

isWorkerNotFoundError matches 10007 and 10090, and the explicit check still handles 10092. For these three codes the script is treated as not existing, and any other error is still rethrown. The parametrized test covers all three codes and takes expect from the test context.


📝 Documentation: ✅ LGTM

The changeset describes the user-facing fix, is classified as a patch and has no type prefix.


Reviewed commit: c8e80568

`isWorkerNotFoundError()` also matches the legacy environment not-found
code, so cover it alongside 10092 and 10007.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ask-bonk

ask-bonk Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@pkg-pr-new

pkg-pr-new Bot commented Dec 4, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@17387

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@17387

@cloudflare/cli-shared-helpers

npm i https://pkg.pr.new/@cloudflare/cli-shared-helpers@17387

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@17387

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@17387

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@17387

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@17387

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@17387

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@17387

miniflare

npm i https://pkg.pr.new/miniflare@17387

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@17387

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@17387

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@17387

@cloudflare/test-server

npm i https://pkg.pr.new/@cloudflare/test-server@17387

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@17387

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@17387

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@17387

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@17387

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@17387

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@17387

wrangler

npm i https://pkg.pr.new/wrangler@17387

commit: c8e8056

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

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants