GeezerVison is showing github.com — pkarr-worker(deploy): workerExists() treats any cf error as 'worker does not exist' — a transient/auth probe failure silently reroutes a standard deploy into the bootstrap cf deploy path · Issue #4865 · developing-today/code
pkarr-worker(deploy): workerExists() treats any cf error as 'worker does not exist' — a transient/auth probe failure silently reroutes a standard deploy into the bootstrap cf deploy path #4865DescriptionFinding
pkgs/pkarr-worker/deploy.mjs's workerExists() treats any failure of cf workers get pkarr as "the Worker does not exist":
// current main (eefeab5af), pkgs/pkarr-worker/deploy.mjs:130-142
function workerExists() {
try {
execFileSync("cf", ["-q", "workers", "get", WORKER], { ... });
return true;
} catch {
return false;
}
}
and the caller (deploy.mjs:85) routes on that boolean:
const bootstrapping = !workerExists();
Evidence
- Introduced by PR fix(pkarr): bootstrap a brand-new Worker via cf deploy (#1829) #3241 (merged, merge commit fdd8811, verified an ancestor of current main) — "fix(pkarr): bootstrap a brand-new Worker via cf deploy (P7.2 implement + deploy: Cloudflare Workers pkarr endpoint, under the Nix deployment standard #1829)". Its purpose was only the genuinely-new-Worker case:
cf workers versions create refuses to create a brand-new Worker.
- Verified on current main
eefeab5af648ac612899c65a4c575c20808ef0e1 via two independent contents-API reads: the catch-all catch { return false; } is unchanged, and stderr is piped away (stdio: ["inherit", "pipe", "pipe"]), so nothing distinguishes a not-found response from an auth failure, a network error, a rate limit, or a broken cf install.
Why it matters
When the Worker does exist but the probe fails for any transient reason (expired/insufficient token, Cloudflare API blip, network error), the script silently takes the bootstrap path and runs cf deploy, which uploads and deploys at 100% immediately — bypassing the deployment standard's versions flow (versions create → ?deployable=true pre-check → deployments create) that PR #3234 established and PRs #3242/#3244 hardened. The run then reports success as a "bootstrap", so the misroute is invisible in the output an operator reads. A probe error should be a stop, not a silent change of deploy mechanism.
Related but distinct from the already-filed deploy.mjs findings #3252 (--dry-run ignored on the --deploy-version path) and #3264 (unrecognized arguments silently ignored) — this one is the existence probe's error classification.
Acceptance criteria
-
workerExists() (or its replacement) returns "does not exist" only for the actual not-found response from cf workers get; any other failure (non-not-found exit, spawn error) aborts the deploy with the cf error visible.
- The bootstrap
cf deploy path is unreachable when the existence probe errored for a reason other than not-found.
- A probe/dry-run demonstration: simulated not-found → bootstrap path chosen; simulated auth/network failure → deploy refuses before uploading anything.
- The genuinely-new-Worker bootstrap from PR fix(pkarr): bootstrap a brand-new Worker via cf deploy (#1829) #3241 still works unchanged.
Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item effort/sSmall: expected under 2 hours of work on Nov 3, 2026dezren39 commented on Nov 3, 2026 dezren39 commented on Nov 3, 2026 agent-note:v1
state: reviewed (coverage loop-back)
Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7522 (triage, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
Found via: coverage loop-back 2026-11-03 dezren39 commented on Nov 4, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 5, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 5, 2026 developing-today commented on Nov 7, 2026
Picked up by repo-worker-code-f — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-f posts progress markers; after 30 minutes of silence any other worker may pick this up.) developing-today commented on Nov 7, 2026
Progress from repo-worker-code-f: verified: workerExists catch-all present at deploy.mjs on c3fe40e; fix shape: extract deploy-probe.mjs (not-found-only classification, abort otherwise) + vitest cases; next: implement developing-today commented on Nov 7, 2026 🤖 Agent note · fixed — PR #6811 open, remainder: merge on green CI
- Agent: queue worker lane F (repo-worker-code-f), fallback claim (queue backend down, code#6619)
- Fix: PR fix(pkarr-worker): existence probe aborts on non-not-found cf failures (#4865) #6811, branch
queue/4865-pkarr-worker-exists-probe. New pkgs/pkarr-worker/deploy-probe.mjs: probeWorkerExists returns "does not exist" only for the genuine not-found response (API code 10007 / workers.api.error.not_found / rendered script-not-found; deliberately narrow matcher); any other probe failure (auth, network, spawn) aborts the deploy before any upload with the cf error visible. deploy.mjs delegates to it; the new-Worker bootstrap (PR fix(pkarr): bootstrap a brand-new Worker via cf deploy (#1829) #3241) is unchanged. 7 vitest cases in test/deploy-probe.test.ts + deploy-probe.d.mts.
- Verification: direct node probe on the laptop — exists → true, 10007 → false, auth failure → throws with cf text visible, ENOENT → throws;
node --check clean on both scripts. The vitest suite runs in CI (workers-pool suite needs the package npm ci).
- Remainder (why released
free, not done): PR fix(pkarr-worker): existence probe aborts on non-not-found cf failures (#4865) #6811's CI had not run within the poll window (fleet CI backlogged tonight). Next worker: check PR fix(pkarr-worker): existence probe aborts on non-not-found cf failures (#4865) #6811 (incl. Codex findings — disposition any before merging); if green, merge and close pkarr-worker(deploy): workerExists() treats any cf error as 'worker does not exist' — a transient/auth probe failure silently reroutes a standard deploy into the bootstrap cf deploy path #4865. Do not redo the fix.
developing-today commented on Nov 7, 2026
Released by repo-worker-code-f (outcome: free). Fixed in PR #6811 (deploy-probe.mjs: not-found-only classification, abort with cf error visible on any other probe failure; 7 vitest cases; node probe verified). REMAINS: merge PR #6811 when CI green (disposition Codex findings first), then close #4865. dezren39 commented on Nov 7, 2026 🤖 Agent note · handed off
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|