Troubleshooting¶
Common issues and how to resolve them.
Configuration not found / "config_dir not set"¶
Symptom: tidydots exits with an error about a missing configuration or config_dir not being set.
Cause: The app configuration at ~/.config/tidydots/config.yaml does not exist or does not contain a valid config_dir value. This happens when you have not yet run tidydots init on this machine.
Solution:
Run tidydots init with the path to your dotfiles repository:
Alternatively, override the repository selected by app config by passing the --dir flag on every command. The TUI loads hostname choices from the selected repository:
Tip
You only need to run tidydots init once per machine. After that, all commands read the saved path automatically.
Broken symlinks¶
Symptom: A program cannot find its configuration, or ls -la shows a symlink pointing to a path that no longer exists.
Cause: The backup source in your dotfiles repo was moved, renamed, or deleted after the symlink was created.
Solution:
-
Run
tidydots listto see all configured paths and verify they are correct: -
If the backup path in
tidydots.yamlis wrong, update it to match the actual location of the files in your repo.If the path is correct but the source is missing, recover the source from version control or another backup before restoring.
-
Re-run
tidydots restoreto recreate the symlinks:
Note
A file or folder symlink already pointing to the configured source is a no-op only if that source resolves. If the source is missing (including a dangling source alias), both restore and restore --dry-run return an error naming the target and source, leaving the existing symlink untouched. Permission or other source-access errors are reported with their underlying cause, not as missing files. Valid source aliases, including rendered-template symlink chains, remain supported.
A symlink pointing to a different location can be replaced by restore. If the target exists as a regular file or directory, you may need --no-merge --force to overwrite it. Other missing-source and adoption behavior is unchanged.
Template merge conflicts¶
Symptom: A .tmpl.conflict file is generated with conflict markers like:
Cause: In symlink mode, you manually edited a .tmpl.rendered file and then re-rendered the template. In copy mode, you edited the suffix-free live target. The 3-way merge detected that both sides changed the same lines and could not automatically resolve the difference.
The deployed file has already been replaced with valid fresh template output. For symlink entries this is .tmpl.rendered; for copy entries the suffix-free target receives the pure render and no .tmpl.rendered cache is created. The conflict file preserves the manual edits that could not be merged.
Solution:
Option 1: Port the edits. Inspect .tmpl.conflict, apply the desired user changes to the .tmpl source, and run tidydots restore again.
Option 2: Discard the edits. Remove the conflict file or leave it in place; the next successful merge removes it automatically. The deployed file already contains the fresh template output.
Note
In symlink mode, conflict files are protected recovery artifacts. If a previous .tmpl.conflict already exists when another conflict occurs, tidydots stops rather than overwriting it. Resolve or move the existing artifact, then run restore again. Copy-mode conflicts instead refresh their existing recovery artifact.
Tip
To avoid merge conflicts in the future, prefer making changes in the .tmpl source file rather than editing generated .tmpl.rendered output or copy-mode targets directly.
Permission errors with sudo entries¶
Symptom: tidydots fails with "permission denied" when trying to create symlinks or copy files to system-level paths like /etc/.
Cause: The config entry targets a path that requires root privileges, and tidydots is running as a normal user. Entries with sudo: true in your tidydots.yaml need elevated privileges.
Solution:
Run tidydots with sudo:
If only some entries require sudo, you can also split your workflow:
- Run
tidydots restoreas a normal user first (non-sudo entries will succeed, sudo entries will fail). - Run
sudo tidydots restoreto handle the remaining sudo entries.
Note
When running with sudo, the home directory (~) may resolve to /root instead of your user home. Use --dir to explicitly specify the dotfiles path if needed:
Template rendering failures¶
Symptom: tidydots reports a template parsing or execution error during restore.
Cause: There is a syntax error in one of your .tmpl files. Common mistakes include:
- Unclosed template delimiters (
{{without a matching}}) - Undefined template variables or functions
- Mismatched quotes inside template expressions
Solution:
-
Preview the operation with dry-run and verbose output to identify the failing file:
-
Open the
.tmplfile mentioned in the error and fix the syntax. Template files use Gotext/templatesyntax. For example: -
Available context variables are:
Variable Description Example .OSOperating system "linux","windows".DistroLinux distribution "arch","ubuntu".HostnameMachine hostname "my-laptop".UserCurrent username "youruser".HasDisplayDisplay server available (X11/Wayland/Windows) true,false.IsWSLRunning inside WSL true,false.EnvEnvironment variables map {{ index .Env "HOME" }} -
All sprout template functions are available (string manipulation, math, collections, and more).
Tip
Template expressions are also supported in targets and backup paths. If a path contains {{ and fails to render, the same debugging approach applies.
In the TUI, invalid path expressions and expansions that result in an empty path are reported as errors and are not used as literal or fallback paths. Correct the expression before attempting restore.
Package installation failures¶
Symptom: tidydots install reports one or more packages as failed.
Cause: Several things can go wrong:
- The required package manager is not installed on the system.
- The package name is wrong for the selected manager.
- The manager needs elevated privileges (e.g.,
aptrequiressudo). - Network connectivity issues for managers that download packages.
Solution:
-
Check which package managers are available and which manager tidydots will use for each package:
Packages marked with
✗cannot be installed because no configured manager is available. -
If the wrong manager is being selected, configure
default_managerormanager_priorityin yourtidydots.yaml. A priority or default manager is used only when that application has a package name for it; deps-only entries are not installation candidates: -
Preview the installation to validate the selected main method and see the dependency commands before the main command:
-
For managers that require sudo (like
aptorpacman), run with elevated privileges:
Git clone failures¶
Symptom: A git package entry fails during tidydots install with a clone or pull error.
Cause: Common reasons include:
- The repository URL is incorrect or the repository does not exist.
- Authentication is required (private repository) and credentials are not configured.
- The specified branch does not exist.
- Network connectivity issues.
- The target directory already exists but is not a git repository.
Solution:
-
Verify the URL manually:
-
If the repository is private, ensure your git credentials (SSH key or token) are configured.
-
If a specific branch is configured, verify it exists:
-
If the target directory exists but is corrupted, remove it and let tidydots clone fresh:
-
Check your
tidydots.yamlgit configuration:
Interactive mode requires a terminal¶
Symptom: Running tidydots (with no subcommand) or using the -i flag produces:
interactive mode requires a terminal; use subcommands (restore, backup, list) for non-interactive use
Cause: tidydots is not connected to a terminal. This happens when running from a script, a cron job, or piping output.
Solution: Use the explicit subcommands instead of the TUI:
These commands work without a terminal and can be used in scripts and automation.
Debugging tips¶
When something is not working as expected, these flags and commands help narrow down the problem.
Preview with dry-run¶
The -n flag shows what tidydots would do without making any changes. Use it before every destructive operation:
Enable verbose output¶
The -v flag provides detailed information about each step:
Combine with dry-run for the safest, most detailed preview:
Inspect your configuration¶
Use list and list-packages to verify that tidydots is reading your config correctly:
# Show all config entries and their target paths
tidydots list
# Show all packages and their install methods
tidydots list-packages
Check the template state database¶
tidydots stores template render history in a SQLite database at .tidydots.db in your dotfiles repo root. If template merges are behaving unexpectedly, you can inspect or delete this file:
# View the database (requires sqlite3)
sqlite3 ~/dotfiles/.tidydots.db ".tables"
sqlite3 ~/dotfiles/.tidydots.db "SELECT * FROM renders;"
# Reset template state (forces fresh renders on next restore)
rm ~/dotfiles/.tidydots.db
Warning
Deleting .tidydots.db removes all stored render history. The next tidydots restore will treat all templates as if they are being rendered for the first time, which means any manual edits to .tmpl.rendered files may be overwritten.
Override OS detection¶
If you want to see what tidydots would do on a different OS without switching machines:
Override the config directory¶
If you have multiple dotfiles repos or want to test a different configuration: