Relationships
#803 Datastore should fail fast on unresolvable credentials instead of stalling on the AWS provider chain
Opened by mgreten · 6/24/2026· Shipped 6/24/2026
When @swamp/s3-datastore runs with no resolvable AWS credentials (no AWS_PROFILE, no default profile, no static env creds), the AWS SDK provider chain doesn't fail quickly — it falls through SSO token resolution to the EC2 IMDS endpoint (169.254.169.254). Off-EC2, that's either a fast-fail (~2s, when an expired SSO token short-circuits it) or a long stall (tens of seconds, IMDS connect-timeout × the sync layer's 30s request timeout × 3× retry backoff).
Measured, same machine back-to-back: profile pinned → datastore status healthy in ~22ms; no profile → CredentialsProviderError after 2011ms (fast path), with much longer stalls observed when no token is cached.
The stall is the harmful case: a push/sync that overruns a caller's command timeout gets SIGKILL'd mid-hold, which orphans the datastore lock (the #218 / #666 orphan path) and degrades concurrency for everyone.
Proposed: a short, bounded credential preflight before any S3 op (e.g. ≤2–3s for the whole chain) that aborts with an actionable error if creds don't resolve; and, when not on EC2, skip or sub-second-cap the IMDS provider (e.g. set AWS_EC2_METADATA_DISABLED internally) so off-EC2 hosts never eat the multi-minute hang. Fast, loud failure means the process exits before a timeout-SIGKILL can orphan a lock.
Relates to #666 (lock contention) and #218 (orphan loop) — this removes one trigger that feeds both.
Upstream repository: https://github.com/systeminit/swamp-extensions
Environment
- Extension:
@swamp/s3-datastore@2026.06.03.2 - swamp:
20260617.212026.0-sha.396e0952 - OS:
darwin(aarch64) - Deno:
2.8.3 - Shell:
/bin/zsh
Shipped
Click a lifecycle step above to view its details.