How can I quickly check for problems with chezmoi on my machine?
How can I quickly check for problems with chezmoi on my machine?
- chezmoi version
- Configuration file location and validity
- Source directory location
- Destination directory (usually home)
- Editor configuration
- Merge tool configuration
- Password manager availability
- Git configuration
- And more…
ok- Everything is finewarning- Only a problem if you use that featureerror- Definite problem that needs fixing
How do I debug a command that's not working as expected?
How do I debug a command that's not working as expected?
- What chezmoi is doing
- Files being read/written
- Scripts being executed
- External commands being run
- Step-by-step execution
- Template evaluation
- File comparisons
- Internal state changes
- Very detailed information
The output of `chezmoi diff` is broken with escape sequences. How do I fix it?
The output of `chezmoi diff` is broken with escape sequences. How do I fix it?
ESC[37m instead of colors.Quick fix - Set LESS environment variable:~/.bashrc or ~/.zshrc.Permanent fix - Configure chezmoi:bat: Usebat --paging=alwaysmost: Already handles colors correctly- Custom pager: Ensure it supports ANSI codes
Why do I get a blank buffer when running `chezmoi edit`?
Why do I get a blank buffer when running `chezmoi edit`?
- chezmoi creates a temporary file
- Your editor command starts and immediately returns
- chezmoi thinks you’re done and deletes the temp file
- Your editor (running in background) opens a now-deleted file
- You see a blank buffer
chezmoi makes `~/.ssh/config` group writeable. How do I fix this?
chezmoi makes `~/.ssh/config` group writeable. How do I fix this?
002 (group-writable by default) instead of the more common 022.SSH requires strict permissions:~/.ssh/configmust not be group or world writable- SSH will refuse to use it if permissions are wrong
chezmoi reports `user: lookup userid NNNNN: input/output error`
chezmoi reports `user: lookup userid NNNNN: input/output error`
- Static binaries with musl can’t dynamically load LDAP/NIS libraries
- Your system needs these libraries to look up user information
chezmoi reports timeout obtaining persistent state lock
chezmoi reports timeout obtaining persistent state lock
- Another chezmoi command is running
- Check for background chezmoi processes
- Look in other terminal windows
- Script calling chezmoi
- A
run_script is invoking chezmoi - Creates a deadlock (chezmoi waiting for itself)
- A
- Stale lock from crashed process
- chezmoi crashed without releasing lock
- Lock file persists
- Write lock:
add,apply,edit,forget,import,init,state,unmanage,update - Read lock:
diff,status,verify - Multiple readers OK, but only one writer
~/.config/chezmoi/chezmoistate.boltdb.chezmoi reports `fork/exec: exec format error` for a script
chezmoi reports `fork/exec: exec format error` for a script
#!).Problem script:- before }} suppresses the trailing newline.Now creates:- to trim whitespace in templates:{{-trims whitespace before-}}trims whitespace after
chezmoi reports `permission denied` when executing a script
chezmoi reports `permission denied` when executing a script
/tmp directory is mounted with the noexec option, preventing script execution.Full error:~/tmp instead of /tmp.Why this happens:- chezmoi needs to write scripts to a temp location
- Scripts might be templates or encrypted
- Must be executable to run
/tmpwithnoexecprevents this
chezmoi reports `no such file or directory` when adding a file
chezmoi reports `no such file or directory` when adding a file
.chezmoiexternal.* but not in your source directory.Example scenario:.chezmoiexternal.toml has:dot_config directory doesn’t exist in source because it’s external-only.Solution - Create placeholder directory:chezmoi reports `permission denied` for stdin/stdout with snap
chezmoi reports `permission denied` for stdin/stdout with snap
chezmoi reports `no such file or directory` for scripts on Nix/Termux
chezmoi reports `no such file or directory` for scripts on Nix/Termux
/bin/bash doesn’t exist.Solution 1 - Use lookPath (recommended):Make the script a template:lookPath in templates for maximum portability.