Troubleshooting
Outcome: the five failures a new Atuin user actually meets, each with its cause and its check. Four of the five happened in this guide's own lab and are photographed in its transcripts; nobody had to imagine them.
"Nothing is being recorded"
The shell you are typing in never
loaded the hooks. Causes, in order of
likelihood: the shell was already open
when you added the init line (open a
new one — chapter 4); the line went
into the wrong file (.bashrc for
bash, .zshrc for zsh); your terminal
starts login shells, which read
.bash_profile instead — the lab met
exactly this in its tmux pane and
bridged it with a .bash_profile that
sources .bashrc; or the shell is not
interactive at all (a script — see
below, and chapter 2). The check is
ten seconds:
echo $ATUIN_SESSION
Empty means unrecorded. Non-empty and
still nothing lands? Run a command,
then atuin history list from the same
shell, and atuin doctor if the list
disagrees with your day.
"Failed to find $ATUIN_SESSION"
$ env -u ATUIN_SESSION atuin history list --cmd-only
ERROR error=Failed to find $ATUIN_SESSION in the environment. Check that you have correctly set up your shell.
Error: Failed to find $ATUIN_SESSION in the environment. Check that you have correctly set up your shell.
(transcript t90-session-error.txt —
the lab's first transcript accident,
kept on purpose.) Some atuin
subcommands want the session variable
the init script exports, and outside a
set-up shell — a cron job, a script, a
bare SSH command — it does not exist.
The fix matches the setting: run such
commands from a real shell, or export a
session yourself first
(export ATUIN_SESSION=$(atuin uuid),
the same thing the init script does).
Not a database problem; the database
was never reached.
"My import doubled things"
Imports stamp rows with what the file
says, and a bash history file can say
the same command many times — bash
appends every running of it, including
in shells Atuin was already
recording. Re-importing such a file
after live recording began brings
repeat rows for the repeated commands
(though never for timestamped ones —
chapter 9's unique constraint refuses
those). The lab did this to itself:
its count went 22 fixtures to 38 rows
after a second import of a file the
lab's own shells had appended to, with
cd ~ present twice (transcript
t90-reimport-duplicates.txt). The
remedy is built in, and it rehearses
before it acts:
$ atuin history dedup --before 2027-01-01 --dupkeep 1 --dry-run
Found 1 duplicate to delete.
2026-10-12 20:17:00 cd ~ 0s
$ atuin history dedup --before 2027-01-01 --dupkeep 1
Found 1 duplicate to delete.
deleting 01a1824c025971e49e307f2b91788ecb
--before bounds the sweep by date,
--dupkeep says how many copies of
each command survive, --dry-run
lists without touching. Duplicates are
defined by command, directory and host
together, so rows of the same command
in different directories are never
merged. The lasting fix is chapter
12's order of operations: import once,
early, then let recording work.
"Ctrl-R does the old search" (or nothing)
The binding belongs to whoever claimed
it last in your startup files. If
another tool's integration (fzf is the
usual neighbour, chapter 13) loads
after Atuin's line, it wins the key.
Reorder, or accept the arrangement and
use chapter 10's --disable-ctrl-r to
make it official. If Ctrl-R does
nothing at all, suspect the same
login-shell trap as above: the init
line never ran, so nobody owns the key
but bash — and bash's own reverse
search should still appear. No search
of any kind means the terminal is
eating the key; a different rabbit
hole, and atuin doctor's shell
section is the place to start.
"Search finds it in GLOBAL but not here"
Almost always a fact problem, not a
search problem — chapter 6's vanishing
rsync. The command was run in another
session, another directory, or (chapter
4) was imported and carries the
import's session and "unknown" as its
directory. Ask the database directly,
as chapter 9 does:
SELECT cwd, session, exit FROM history WHERE command LIKE 'rsync%';
The row states its own facts; the
scope was only ever filtering on them.
Similarly, a query that finds nothing
anywhere may be a mode problem:
chapter 5's prefix mode cannot find
what does not start with your query,
and fuzzy cannot find letters that are
not there in order. Try the other
modes before doubting the database —
--search-mode on the command line
overrides the configuration for one
call.
When all else fails: the doctor
atuin doctor prints the whole
situation — version, shell, preexec
plugin, sync state, database
locations — formatted for pasting into
a bug report (the lab's is transcript
t01-doctor.txt). Run it, read it
yourself first (half the answers in
this chapter are lines in it), and
include it when you ask for help. It
is the rare error message that was
designed to be shared.