Troubleshooting
Diagnostics and fixes for every major class of xenvsync error — from decrypt failures and key permissions to team access, CI injection, and export issues.
First-Response Diagnostics
Decryption Failures
authentication failed — vault decryption error
Cause: The key used to decrypt does not match the key that encrypted the vault. This happens when the wrong .xenvsync.key is present, the vault came from a different project, or the vault was tampered with.
vault file not found / no such file .env.vault
Cause: The vault has not been created yet, or you are running xenvsync from the wrong directory.
no key file found — .xenvsync.key missing
Cause: The symmetric key file is absent. It was never initialized, was gitignored and not restored, or was deleted.
passphrase required — enc: prefix detected
Cause: The key file was created with --passphrase and requires XENVSYNC_PASSPHRASE to be set before xenvsync can use it.
Key & Permission Errors
key file readable by others — permission warning
Cause: xenvsync expects .xenvsync.key and ~/.xenvsync/identity to be owner-only (mode 0600). Broader permissions are a security risk.
key not in .gitignore — doctor warning
Cause: The .xenvsync.key file is not listed in .gitignore. Committing it would expose the decryption key.
key strength warning — all-zeros or weak key
Cause: doctor detected a key that is all zeros or appears too weak to provide security.
Stale Vault & Sync Issues
.env is newer than .env.vault — stale vault warning
Cause: The plaintext .env was edited after the last push. The vault does not reflect current secrets.
diff shows unexpected changes
Cause: A diff that shows changes you did not make may indicate that another team member pushed changes, or that the vault was rotated.
Team & V2 Vault Access
no identity file found — team member cannot decrypt
Cause: The member has not generated their X25519 identity, or the identity file was deleted.
recipient not in roster — V2 decryption failed
Cause: The member's public key was not included in the roster when the vault was last encrypted. Either they were never added, or rotation was performed without them.
member removed but can still decrypt old vault
Cause: Removing from roster does not retroactively re-encrypt. Rotation is required to exclude the revoked identity.
.xenvsync-team.json not committed
Cause: The team roster file is needed by all members. It must be committed to the repository.
CI/CD Injection Failures
xenvsync pull fails in CI — key not available
Cause: The key was not injected into the CI environment. CI jobs do not have the .xenvsync.key file by default.
run command exits with unexpected code
Cause: xenvsync run preserves child exit codes. A non-zero exit comes from the child process, not xenvsync itself.
Export Errors
export --format=shell produces invalid output
Cause: Values are single-quote escaped to prevent shell expansion. If a value itself contains a single quote, the escaping handles it. This is the secure behavior.
YAML export has unquoted boolean-like values
Cause: YAML 1.1 treats yes/no/on/off as booleans. xenvsync v1.12.0+ quotes these automatically.
Multi-Environment Issues
wrong environment loaded — unexpected variables
Cause: Fallback merging layers .env.shared → .env.<name> → .env.local. A variable from .env.shared may be overriding your expectation.
invalid environment name — path traversal error
Cause: Environment names must not contain slashes or .. characters. This is a security check.
Still Stuck?
If none of the above resolves your issue, collect diagnostic output and open a GitHub issue:
File a bug at github.com/nasimstg/xenvsync/issues with the output from the commands above and your OS / Go version.