Repository navigation
Description
Symptom
Instances launched into the dev account (435415984226) with a running spored (SPORE_DNS_SIGV4=1 in the systemd unit, the default) do not get a resolvable {name}.{base36(account)}.spore.host record, and the DNS Lambda shows zero invocations while they're alive.
Evidence (2026-07-23, us-east-1)
- Two
t4g.nanoinstances launched, reachedrunningwith public IPs, ran their full 5-min TTL, and self-terminated correctly (sosporedwas alive and healthy — TTL enforcement worked). direct-e2e.5k0zfnmq.spore.hostnever resolved via public DoH during the instances' lifetime (polled repeatedly).aws lambda get-function-url-config --function-name spawn-dns-updater→AuthType: AWS_IAM(the [HIGH] dns-updater accepts unsigned identity docs + default-allows cross-account → Route53 spoofing #173 cutover has landed on the infra side).aws logs filter-log-eventson/aws/lambda/spawn-dns-updater→ 0 events in a 30-minute window covering both instances. So the requests are being rejected at the Function URL auth layer before invocation, not failing inside the Lambda.- The instance role (
spored-instance-role) DOES grantlambda:InvokeFunctionUrlonarn:aws:lambda:*:966362334030:function:spawn-dns-updater(verified), so the IAM grant is present. - spored binary in
spawn-binaries-us-east-1(spawn/spored-linux-arm64) LastModified 2026-07-22.
Likely cause
The Function URL is now AWS_IAM, but the SigV4-signed requests from spored are being rejected (403 → no invocation logged). Candidate reasons:
- the installed spored build predates / doesn't actually emit the SigV4 signature (the [HIGH] dns-updater accepts unsigned identity docs + default-allows cross-account → Route53 spoofing #173 rollout comment in
pkg/launcher/bootstrap.goanticipates old non-signing instances aging out — but a freshly-installed binary should sign); - a mismatch in the signed request (host/payload-hash/session-token header) so the signature is rejected;
- the instance role's
lambda:InvokeFunctionUrlgrant not actually being honored for the FunctionUrlAuthType.
Impact
The self-termination guarantee is unaffected (proven — both self-terminated). But DNS registration is silently broken post-cutover: no error surfaces to the user; the name just never appears. Worth confirming the current spored build signs correctly against the AWS_IAM Function URL and adding a visible spored-side log line on registration failure.
Found while building a spawn-ts BYOA demo that resolves the spore.host name to confirm registration end-to-end.
Activity
scttfrdmn commentedon Jul 23, 2026
Investigation update + partial fix (PR #436)
Dug into this. Splitting it into visibility (fixed) and root cause (still open).
Ruled out: it is NOT a missing/incorrect infra-side policy
Verified read-only against the live function (
AWS_PROFILE=spore-host-infra, us-east-1):get-function-url-config→AuthType: AWS_IAM✅ (cutover landed, as you found)get-policy→ statementFunctionURLAllowIAMAccess,Action: lambda:InvokeFunctionUrl,Principal: "*", conditionlambda:FunctionUrlAuthType = AWS_IAMThat resource policy is the standard "any IAM-authorized principal" form, and
Principal: *does permit cross-account callers as long as their own IAM allows it — which the dev instance role does (lambda:InvokeFunctionUrlon the dns-updater ARN, confirmed inpkg/aws/iam.go). So my initial hypothesis (missing cross-account resource policy) is wrong — this is not it.The client's signing path (
pkg/dns/client.gosignRequest: SigV4lambdaservice, instance-role creds from the ambient chain, hex SHA-256 payload hash; SDK auto-addsX-Amz-Security-Token) also looks correct and already has passing unit tests (TestCallAPI_SignedWhenEnabled). So the 403 is signature/credential-level, not authorization-model-level.Remaining root-cause candidates (still open)
cfg.Region(falling back tous-east-1). If an instance in another region signs for its own region while the Function URL is verified asus-east-1, the SigV4 scope won't match → 403. Worth checking what region the failing dev instances signed for.Next concrete step: capture the actual 403 body/headers from a live signed request (the PR below now surfaces it), and/or add temporary debug logging of the signed canonical request on one dev instance.
What PR #436 fixes now (visibility)
The bigger immediate problem was that this failure was completely silent:
callAPIdidn't check the HTTP status — it parsed the403body ({"Message":"Forbidden"}) as a normal response → emptyDNS API error:. Fixed: surfacesHTTP 403: <body>.spawn:dns-status/spawn:dns-errortags…spawn statusnow prints a clear warning when registration failed, so the "FQDN never resolves" symptom is diagnosable from the launch account without SSHing in.So after #436 merges, re-running your BYOA repro will show the actual
403body inspawn status/ the tags, which should pin down which of the candidates above is the cause. Leaving this issue open for that root-cause work; #436 also folds in the #434 doc fix.fix(dns): fail closed on empty signing credentials (#435)
scttfrdmn commentedon Jul 23, 2026
Root cause narrowed to "signed with empty/anonymous credentials" — with live proof
Ran a decisive experiment: hit the live prod DNS Function URL with an intentionally-invalid body (can't create a record) both unsigned and SigV4-signed (same signing path as
pkg/dns/client.go), from two accounts. A403 {"Message":"Forbidden"}= rejected at the auth layer (no invocation); any other status = the request reached the Lambda.966362334030(same-account){"Message":"Forbidden"}966362334030lambda, us-east-1)Missing required field: record_name→ reached Lambda ✅435415984226(cross-account){"Message":"Forbidden"}435415984226(cross-account)What this proves
AWS_IAMFunction URL.AuthType: AWS_IAM✅FunctionURLAllowIAMAccess(Principal:*,FunctionUrlAuthType: AWS_IAM) — allows cross-account IAM ✅spored-instance-roleinlinespored-policygrantslambda:InvokeFunctionUrlonarn:aws:lambda:*:966362334030:function:spawn-dns-updater✅lambda), payload hash — all match ✅403 {"Message":"Forbidden"}+ 0 invocations) with all of the above correct is a request that arrives effectively unsigned — i.e. spored signed with an empty/anonymous credential.Why that happens silently
config.LoadDefaultConfig→credsProvider.Retrieve()can return a blank credential without an error when the instance role isn't reachable via IMDS yet (agent starts, tries DNS registration before IMDS creds are available).SignHTTPwith an emptyAccessKeyIDdoes not error client-side — it produces a signature with an empty credential scope, which the Function URL rejects as a bare 403. So spored "signs", sends, and gets a silent 403, exactly as observed.(Corroborating smell: the DNS client is the only spored AWS caller using bare
LoadDefaultConfig(ctx)with noWithRegion— every other call inpkg/agent/agent.gopassesWithRegion(identity.Region). Not the cause on its own since signing falls back to us-east-1, but it reflects the DNS-client credential/region setup being the odd one out.)Fix in PR #436 (updated)
Added a fail-closed guard: if signing is enabled but the resolved credential is empty,
signRequestreturns a clear, actionable error and sends nothing — instead of emitting an unsigned-effectively request that dies as a silent 403. Combined with the visibility fixes (HTTP-status surfacing +spawn:dns-statustag +spawn statuswarning), a future occurrence will say "credentials empty / instance role not reachable via IMDS" rather than vanishing.Still to confirm on a live instance (the last mile)
This is a strong inference, not yet a live capture. To close definitively, re-run the BYOA repro with PR #436's build and check
spawn status/ thespawn:dns-errortag:Leaving open for that live confirmation + the retry follow-up.
fix(dns): surface DNS registration failures instead of swallowing them (
scttfrdmn commentedon Jul 23, 2026
Live repro (gated t4g.nano, 20m TTL, terminated + leak-checked, ~$0.00) — my empty-creds hypothesis is WRONG
Launched a real instance to confirm. It reproduced the symptom and then disproved my previous comment's conclusion. Correcting the record.
Reproduced the exact symptom
spored statuson the live box (spored v0.92.0,SPORE_DNS_SIGV4=1):The decisive control — same box, same instance role, same minute
v4.SignHTTP)DNS API error:(empty) — i.e. 403, rejectedcurl --aws-sigv4 aws:amz:us-east-1:lambdawith the instance role's IMDS credsMissing required field: record_name→ reached the Lambda ✅IMDS creds were present (
AccessKeyIdlength 20), so credentials are NOT empty. curl signs with the very same instance-role creds and gets through.Corrected conclusion
curl --aws-sigv4from the same box with the same role succeeds where spored'sv4.Signer.SignHTTPpath fails.Puzzle to resolve: a standalone Go program using the same
v4.SignHTTPdid reach the Lambda in my earlier off-box probes (from both infra and dev creds). So the delta is something in spored's actual request that my minimal probe didn't replicate — candidates now:Accept-Encoding, orContent-Lengthhandling), causing a signature mismatch.x-amz-content-sha256header —curl --aws-sigv4sends it; Go'sSignHTTPuses the payload hash in the string-to-sign but doesn't add the header to the request. Function URL IAM verification may require it. (Why my minimal probe still passed is unexplained — needs the on-box Go-vs-curl comparison with creds held constant.)Status of PR #436
The visibility fixes stand and are valuable (the empty
DNS API error:→ now surfacesHTTP 403: {...};spawn statuswarning; dns-status tags). The fail-closed-on-empty-creds guard is a reasonable safety net but does NOT fix this — creds aren't empty. Not reverting it (still correct defensively), but it should not be described as the #435 fix.Next diagnostic (needs one more gated launch)
Run my exact standalone Go
SignHTTPprobe on the instance with the instance role (curl-vs-Go, creds held constant), and/or add temporary spored logging of the signed canonical request + response headers. That will pin candidate 1/2/3. Holding for a go-ahead before spending on another instance.(Cost note: repro instance i-0227e06cdbed64ed8 terminated explicitly and independently leak-checked — dev account clean, ~$0.00.)
scttfrdmn commentedon Jul 23, 2026
RESOLVED — spored's DNS registration works; the original report was a measurement artifact
Ran this to ground with gated live instances (all terminated + leak-checked, ~$0.00 total). The released v0.92.0 daemon registers DNS correctly and the name resolves publicly. There is no signing/credential/policy bug.
The daemon's own log (
/var/log/spored.log) on a fresh instanceAnd it resolves via public DoH:
Confirmed twice, on two independent instances.
Where every earlier "finding" went wrong (measurement artifacts, not bugs)
spored statusreturned the emptyDNS API error:— because a manualspored statusinvocation over SSM does not inherit the systemd unit'sEnvironment=SPORE_DNS_SIGV4=1. So it signed nothing and got a legitimate 403. Running the same binary on-box withSPORE_DNS_SIGV4=1set explicitly →✓ DNS registered. (I verified both side by side.)runDaemon()callslog.SetOutput(/var/log/spored.log), so its logs go to that file, not the journal.journalctlonly ever shows systemd's "Started" line by design. The registration was in/var/log/spored.logthe whole time.statusrun from Feature request: --tag / --tags flag for custom EC2 instance tags #1.So what about the ORIGINAL report (0 invocations, name never resolved)?
That was against the dev account (435415984226) during/around the
AuthType: AWS_IAMcutover. Given that the current released daemon works end-to-end in that same account today, the original symptom was almost certainly transient/timing relative to the cutover — e.g. the instances in the report ran while the Function URL flip and the instance-rolelambda:InvokeFunctionUrlgrant weren't yet both in place, or before the signing spored build was the one installed. It is not reproducible now.What actually shipped from this investigation (all still valid)
PR #436 (merged) hardens the observability that made this so hard to diagnose in the first place — every one of these would have short-circuited the confusion:
callAPInow surfaces the real HTTP status/body (no more emptyDNS API error:).spawn:dns-status/spawn:dns-errortags;spawn statusshows a clear warning on failure.Plus the #434 base36 doc fix.
Recommendation
Closing-eligible: not reproducible; released daemon verified working end-to-end incl. public resolution. Leaving the final call to the maintainer, but I'd close as resolved-by-#436 (observability) + not-reproducible (the underlying registration). If anyone hits a fresh occurrence, PR #436's changes mean it will now show the actual error in
spawn status/ thespawn:dns-errortag rather than vanishing.(Cost: 3 gated t4g.nano launches, each explicitly terminated + independently leak-checked; dev account confirmed clean; ~$0.00. No production artifacts or infra modified; diagnostic build was throwaway and read-only.)
scttfrdmn commentedon Jul 23, 2026
Retested with a fresh instance and got to the real root cause — my original diagnosis (AuthType: AWS_IAM rejecting spored's requests) was wrong. Correcting the record:
What I actually found
Launched a fresh
t4g.nano(spored 0.92.0,SPORE_DNS_SIGV4=1set) and inspected it live over SSM:The reason isn't auth — it's that spored is correctly skipping registration. Per
pkg/agent/agent.go:203:DNS registration is gated on a non-empty
config.DNSName, which is populated from thespawn:dns-nametag (pkg/aws/tags.go:91-92writes it;pkg/provider/ec2.go:513reads it). Confirmed my instance's tags:spawn:managed,spawn:ttl,spawn:ttl-deadline,spawn:price-per-hour,spawn:spored-version, … but nospawn:dns-name. Soconfig.DNSName == ""→ the whole registration block is skipped. spored is behaving exactly as written.So the earlier "0 invocations / AWS_IAM" observation was a red herring
That was from an instance in a different state; there was never an auth rejection to see, because a signed request was never sent — no DNS name was configured, so spored never called the Lambda.
Implications
spawn:dns-name. (My spawn-ts browser launcher doesn't set it — that's on me; I'll add it. But worth confirming the Gospawn launchdefault: does it always setspawn:dns-name— e.g. defaulting to the instance name — or only when--dns-nameis passed? If the latter, "no DNS by default" may be expected behavior rather than a bug.)config.DNSName == "", spored logs nothing about DNS. A singlelog.Printf("DNS registration skipped: no spawn:dns-name configured")(or an info line when it is attempting) would have made this a 30-second diagnosis instead of a live-instance investigation. Right now a silent skip is indistinguishable from a silent failure.Whether #435 stays open probably depends on (1): if
spawn launchis supposed to setspawn:dns-nameby default and doesn't, that's the real bug; if DNS is opt-in via--dns-name, then the only actionable item is the logging in (2).(Found while dogfooding a browser SSM terminal — being able to read the spored journal live on the box is how I nailed this down.)
scttfrdmn commentedon Jul 23, 2026
Answered my own open question by reading
cmd/launch_config.go:195-201:--nameis required, and--dnsdefaults to it — so the Gospawn launchalways setsconfig.DNSName, hence always emitsspawn:dns-name, hence spored always registers. DNS-by-default is the intended behavior.Conclusion: this is a spawn-ts (my browser launcher) bug, not a spored or infra bug. spawn-ts collects a
namebut never maps it into thespawn:dns-nametag, soconfig.DNSNameis empty on the instance and spored correctly skips registration. Nothing wrong on the daemon/Lambda side. I'll fix it in spawn-ts (emitspawn:dns-namedefaulting to the launch name, matching the Go contract).Leaving the observability suggestion from my previous comment as the only spawn-side follow-up (a log line when DNS is skipped/attempted). Feel free to close #435 as "not a spawn bug" — happy to move the fix entirely to spawn-ts.
scttfrdmn commentedon Jul 23, 2026
✅ Fixed on the spawn-ts side and validated live — root cause was the missing
spawn:dns-nametag, nothing wrong with spored or the infra Lambda.Fix: spawn-ts now emits
spawn:dns-nameat launch (defaulting to a slugified launch name, mirroring the Go launcher's--dns=--name).Proof: launched a fresh
t4g.nanowith the tag present (spawn:dns-name=dnsfix-435) →dnsfix-435.5k0zfnmq.spore.hostresolved to the instance's public IP54.198.111.130via public DoH within ~30s of boot. So theAuthType: AWS_IAM+ SigV4 data path works end-to-end — my very first diagnosis on this issue (auth rejection) was a red herring; the requests simply were never sent because no DNS name was configured.Net for this repo: no spawn/spored code change required. The only optional spawn-side follow-up remains the observability nit — a log line when spored skips DNS for an empty
config.DNSName, so a genuinely-missing name is distinguishable from a silent failure. Otherwise this can be closed as "not a spawn bug" (fix lived in the browser launcher).fix(spored): log when DNS registration is skipped for no configured n…
fix(spored): log when DNS registration is skipped for no configured n…
scttfrdmn commentedon Jul 23, 2026
Resolved — root cause was client-side (spawn-ts), spawn-side observability added
Confirming your root-cause and closing.
Root cause (yours): spawn-ts never mapped its launch
nameinto thespawn:dns-nametag, soconfig.DNSNamewas empty on the instance and spored correctly skipped registration. The Gospawn launchalways sets it (--dnsdefaults to the required--name, perlaunch_config.go:195-201). Nothing wrong with spored, the DNS Lambda, SigV4 signing, the IAM grant, or the infra — all verified working end-to-end on live instances (registered + publicly resolved). The DNS-registration fix belongs entirely in spawn-ts.Spawn-side follow-up shipped (your suggestion): PR #437 (merged). The agent's DNS
if/elsechain had no branch for the most common case (config.DNSName == ""), so a missingspawn:dns-nametag skipped registration with zero log output — which is precisely why a launcher bug masqueraded as a broken registration path. spored now logs:Together with PR #436 (surfaced HTTP status,
spawn:dns-status/spawn:dns-errortags,spawn statuswarning, fail-closed on empty creds) and the #434 doc fix, a future occurrence of this class is diagnosable at a glance.Closing as root-caused to spawn-ts; spawn-side observability added (#436, #437). The spawn-ts tag-mapping fix is tracked on that repo.
(Full disclosure: my intermediate comments on this issue proposed several wrong spawn-side root causes — all measurement artifacts of how I was probing, not real defects. The daemon/Lambda/infra path was correct throughout; you identified the actual client-side cause. Cost: gated t4g.nano repros, all terminated + leak-checked, dev account clean, ~$0.00.)