Relationships
#2438 serve: one unresolvable username in `auth.admins` stops the server from starting
Opened by swamp_lord · 9/23/2026· Shipped 9/23/2026
Summary
If any name in auth.admins (or auth.allowed-users) can't be resolved on
the OAuth provider, swamp serve exits at startup. One typo in an access list
takes the whole server down.
Environment
- Seen in production on swamp
20260910(core375d7eca),--auth-mode oauth, providerhttps://swamp-club.com,@swamp/gcs-datastore@2026.09.23.1,@swamp/1password@2026.09.10.0 - Code path confirmed unchanged on
main@1da85ec8 - Not reproduced in isolation: OAuth mode needs
allowed-users/allowed-collectivesand a swamp-club key withoauth:managefor headless client registration
Steps to reproduce
- In
serve.yaml:auth: mode: oauth oauth-provider: https://swamp-club.com admins: [alice, bob, alic_e] # alic_e does not exist allowed-users: [alice, bob]
- Start
swamp serve.
Expected
An error is logged for alic_e and serve starts with the resolvable admins. Or the list is validated when the config is applied, before a restart.
Actual
Resolved admin "alice" to user:"…"
Resolved admin "bob" to user:"…"
Error: Failed to resolve admin 'alic_e': Username 'alic_e' not found on https://swamp-club.com. Ensure the username exists on https://swamp-club.com.The process exits, and in Kubernetes it crash-loops (about 6 minutes of full downtime in our case).
Root cause (on main)
src/cli/commands/serve.ts ≈L2442 throws Failed to resolve admin '<name>': … during startup admin resolution instead of skipping or warning for that entry.
Suggested fix
Skip unresolvable admins and allowed users with an ERROR log, and serve with the rest. Optionally add a swamp serve --check-config (or similar) that validates the list up front.
Reproduction configuration
Test environment
| swamp | built from main @ 1da85ec847ef6a8a0ce0297563b2a9fab1f4b2b8, unmodified (20260923.175528.0-sha.1da85ec8) |
| Datastore | @swamp/s3-datastore@2026.09.23.1 on local MinIO (http://127.0.0.1:19000, bucket swamp-repro) |
| Vault | none configured; control-plane _token-secrets only |
| Instances | each serve instance starts with an empty HOME and a repo containing only .swamp.yaml |
serve.yaml:
host: 127.0.0.1
port: 19201
auth:
mode: oauth
oauth-provider: https://swamp-club.com
admins: [alice, no-such-user-zz9]
allowed-users: [alice]Serve command:
swamp serve --repo-dir <repo> --host 127.0.0.1 --port 19201 --hot-reload --config serve.yamlShipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.