Repository navigation
Description
spawn schedule is non-functional in production. This is #790's mirror image — a
missing prefix instead of an extra one — and it is invisible to the gate added
for #790.
Verified against the live infra account
$ aws lambda get-function-configuration --function-name sweep-orchestrator
DOES NOT EXIST
$ aws lambda get-function-configuration --function-name spawn-sweep-orchestrator
spawn-sweep-orchestrator
$ aws lambda get-function-configuration --function-name scheduler-handler \
--query 'Environment.Variables'
(empty — no variables at all)
The chain
lambda/scheduler-handler/main.go:27:
defaultOrchestratorFuncName = "sweep-orchestrator":110 allows an override — orchestratorFuncName = getEnv("SPAWN_ORCHESTRATOR_FUNCTION_NAME", defaultOrchestratorFuncName) — but scripts/deploy-scheduler-handler.sh sets no environment whatsoever (grep for --environment and the variable name: 0 hits), and the live function confirms none is set.
:178 then builds the ARN and invokes it:
orchestratorArn := fmt.Sprintf("arn:aws:lambda:%s:%s:function:%s", schedule.Region, accountID, orchestratorFuncName)So every scheduled execution calls arn:…:function:sweep-orchestrator and gets
ResourceNotFoundException.
Every other reference in the repo uses the prefixed name —
pkg/infrastructure/resolver.go, pkg/sweep/detached.go,
pkg/config/infrastructure.go, scripts/deploy-sweep-orchestrator.sh:16 (which
is what creates it).
Second-order: the ARN also interpolates schedule.Region, while the
orchestrator exists only in us-east-1 — so even with the name fixed, a schedule
in another region would fail.
Consistent with the symptom being unnoticed: all three spawn-schedules-*
buckets measured 0 objects, so no schedule has ever run far enough to stage
its parameters.
Why the #790 gate cannot see it
TestEveryHardcodedLambdaNameIsCreatedByADeployMechanism
(pkg/infrastructure/lambda_names_test.go) was written for exactly this class
and misses this instance on two counts:
- its
constDeclregex requires the identifier to end inFunction— this
one ends inFuncName; - its
litregex requires a literal after:function:— here the format string
is%s, with the name arriving via a variable.
So the gate checks the shape of how I happened to write the constants in
pkg/infrastructure, not the property "every Lambda name reaches a function that
exists". That is the same mistake as #799's directory-scoped discovery, one layer
in: I generalised the search over files but not over naming styles.
TestScheduleRecordConstants (lambda/scheduler-handler/main_test.go:76)
asserts only that the constant is non-empty.
Suggested
- Fix the constant to
spawn-sweep-orchestrator, and decide whether the region
should be pinned to the orchestrator's region rather than the schedule's. - Widen the gate so it cannot miss this shape: match any string constant or
variable whose value is used to build a:function:ARN, regardless of
identifier suffix or whether the name is interpolated. The robust form is to
collect candidate values (any string literal matching a plausible function
name) and check them against the discovered deploy-mechanism set, rather than
keying on how the identifier is spelled. - Have
deploy-scheduler-handler.shset the environment explicitly, so the
deployed function's configuration is reproducible rather than relying on a
compiled-in default.
Related: #790 (same class, opposite direction), #799 (a gate that matched the
author's own search scope), #804 (read side reconstructing a name the write side
resolved).
Activity
fix(schedule): invoke a sweep orchestrator that exists, in a region i…
scttfrdmn commentedon Oct 11, 2026
Deployed.
scheduler-handlernow carries the fix, with zero config drift.Also stamped
spawn:version=0.127.0-7-g4602df8, so skew between the repo and thisfunction is now readable in one API call (#768) — it previously had no version tag.
The specific fix verified: the exact ARN the handler will build now resolves.
A correction to how I described the impact
I wrote that "every scheduled sweep fails with ResourceNotFoundException". The
tense was wrong — it would have failed. Measured after deploying:
spawn-schedulesCount=0spawn-schedule-historyCount=0lagotto-capacity-poller)/aws/lambda/scheduler-handlerlog groupNo log group means the function has never been invoked, not once since it was
deployed. So nobody ever created a schedule, nothing ever fired, and the bug was
latent rather than actively breaking users. It would have broken the first person
to try.
That makes the fix no less necessary and the severity lower than I stated. Worth
correcting because "has never worked" and "is currently failing" imply different
urgency, and only the first is true.
What is still unverified
Nothing has exercised this end to end. Config-level verification proves the
handler will invoke a function that exists in a region it is deployed to; it does
not prove a schedule runs. Doing that means creating a real schedule, letting it
fire, and having it launch billable instances — which needs a TTL, an explicit
teardown and an independent leak check, and is a separate piece of work rather
than a deploy check.
If someone does run it, #804 is the next thing in the path: the schedules-bucket
name is resolved on the write side and reconstructed on the read side. The infra
account owns
spawn-schedules-us-east-1so the preferred name is used there and#804 should not bite; an account that took the fallback would still fail.
One small gap the deploy surfaced
The retention step reported:
which is correct and tolerated by design — but it means the group created by the
first invocation will have no retention until someone re-deploys. For a
function that has never run, that is the guaranteed outcome rather than an edge
case. Worth either creating the group in the deploy script or re-running the
retention step after the first invocation.
security: scope the portal onboarding role, and give cmd/onboard.go i…