An app using Vault dynamic database credentials starts failing with `password authentication failed for user "v-kubernetes-api-x7f..."` after a few hours
IntermediateTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer
Likely causes → The lease hit its max_ttl and Vault revoked the DB user, but the app only read the credentials once at startup. Or the agent renewed the lease but the app's connection pool kept stale credentials.
Diagnose →
vault read database/roles/api # default_ttl, max_ttl
vault list sys/leases/lookup/database/creds/api
Fix → Have Vault Agent re-render the credentials file and signal the app (exec with restart_on_secret_changes), or let the app re-read credentials and rebuild the pool. Make max_ttl longer than the longest pod lifetime, or restart pods well before it.
Prevent → Load-test credential rotation in staging with a short max_ttl such as 10 minutes.
More on Secrets management: Vault, External Secrets and SOPS
`vault kv get secret/app/db` returns `Code: 403. Errors: * permission denied` although the policy allows `secret/app/*`BeginnerVault pod restarted and `vault status` shows `Sealed: true`; every app now fails to fetch secretsBeginnerPod stuck in `Init:0/1`; the `vault-agent-init` container logs `error authenticating: ... Code: 403 ... * permission denied`IntermediateAfter a cluster upgrade, Vault Kubernetes auth fails for every pod with `error validating token: invalid issuer (iss) claim`AdvancedPods annotated with `vault.hashicorp.com/agent-inject: true` start without a Vault sidecar, and the app fails on a missing fileBeginnerExternalSecret shows `SecretSyncedError` with `AccessDeniedException: ... is not authorized to perform: secretsmanager:GetSecretValue`Intermediate