# Troubleshooting Secrets

Symptoms you can hit with secrets, grants and sources, with their cause and fix.

## A workflow run stops before the job starts, naming a secret

**Cause:** the secret does not exist in the job's environment or as a Default, is not granted to
`actions` for this repository, or the person who started the run lacks `secrets:GetSecretValue` on
it. The message says which.

**Fix:** create or grant it (see [Grant a consumer access to a secret](grant-a-consumer.md)), or
attach a policy allowing `secrets:GetSecretValue`, then re-run.

## A workflow says the run has no triggering IAM user

**Cause:** the run's trigger recorded no IAM user, so no policy can be evaluated.

**Fix:** start the workflow from the console (`workflow_dispatch`), or drop the job's `secrets:`
list.

## A rollout fails with "is not granted to deploy"

**Cause:** the app binds a secret that has no `deploy` grant.

**Fix:** grant `deploy` on the secret, then deploy again.

## Reveal is refused with "Encryption key is unavailable"

**Cause:** the secret's KMS key is disabled, scheduled for deletion or has no material.

**Fix:** enable the key, cancel its deletion, or import its material again.

## Rotate is refused because the secret is synced

**Cause:** its value comes from a source; a manual change would be overwritten by the next sync.

**Fix:** change it in 1Password or Vault, then choose **Sync now**.

## Connecting a source says the credential was rejected

**Cause:** the token is mistyped, expired or revoked, or (1Password) no vault is shared with the
service account, or (Vault) it sees no KV secrets engine or the AppRole login failed. For Vault the
same message also covers a server that cannot be reached: "… rejected the credential: could not
reach Vault: …" (an address that is not public, a redirect, or no answer within 10 seconds).

**Fix:** create a new token with read access, or correct the address, then connect again.

## A synced secret shows "vault not found, or not shared with this service account"

**Cause:** the vault in the reference is misspelled or not shared with the service account.

**Fix:** share the vault with the service account in 1Password, then **Sync now**. "item not found
in that vault" and "field not found on that item" mean the item or field name is wrong.

## A Vault secret shows "permission denied"

**Cause:** the token's policy may not read that path. Only the secrets that use the path fail.

**Fix:** add the path to the policy, then **Sync now**.

## Creating a synced secret says a vault is reachable through several sources

**Cause:** more than one connected source can read the vault.

**Fix:** pass `source` with the source's name.

## A source cannot be disconnected

**Cause:** secrets or SSH key pairs still sync from it.

**Fix:** delete them, or keep the source.

## An environment cannot be deleted

**Cause:** it still holds secrets or apps.

**Fix:** move or delete them first.
