Hello, i have a server that has not been restarted for 3 months and been using atuin there. The issue is that i can not see and search all of my previous commands. I can see that all of the history in the sqlite file is uncommitted. Is there a way to commit it without restarting the server?
Doesn’t the terminal commit any history to the log only AFTER the terminal is closed?
One can also force it with an atuin sync
So the thing is that .bash_history lists 140 commands after i installed atuin, whereas atuin lists me only 40 of them. I looked into the sqlite .db file - empty. For the .db-wal file, i made a copy of all sqlite files and forced the commit with
sqlite3 /path/to/database.db
PRAGMA wal_checkpoint(FULL);
It then showed me the 40 commands that atuin lists me. So somehow the 100 commands got lost. Interestingly, the very first commands are still there, then atuin had a blackout and the new commands are registered correctly.
I haven’t synced the commands with the atuin server, i left everything local. I tried atuin sync nonetheless, but the status is the same.
I don’t really know the root of the issue, but it would be nice to have a command to commit the sqlite data as all of the commands reside in the write-ahead-log. I noticed that the sqlite database only gets commited on shutdown as when i closed the terminal, the database was still uncommited.
I upgraded to v18.4.0 from v18.3.0 btw a week ago
What is the output of atuin doctor
I am only ssh-ing to that
{
"atuin": {
"version": "18.4.0",
"sync": null,
"sqlite_version": "3.46.0"
},
"shell": {
"name": "bash",
"default": "bash",
"plugins": [
"atuin",
"bash-preexec"
],
"preexec": "bash-preexec"
},
"system": {
"os": "Ubuntu",
"arch": "aarch64",
"version": "24.04",
"disks": [
{
"name": "/dev/mmcblk0p2",
"filesystem": "ext4"
},
{
"name": "/dev/mmcblk0p1",
"filesystem": "vfat"
}
]
}
}
Ok, so according to the output, everything looks good.
e.g. if you had bash running without prexec or ble, it would be understandable why the commands are not in atuin.
But to be perfectly clear, sync has nothing to do with commands being added to the local database. Neither does a restart.
What about your cwd_filter
and history_filter
in the config?
The only idea I have is to use ATUIN_LOG=debug
and see what atuin spits out.
Maybe opening an issue on github might help.
What kind of commands are you running? SQLite auto-commits every transaction, so this is unlikely to be the issue.
I suspect the fault lies with bash-preexec. This is a hack on top of debug traps/similar to build functionality somewhat akin to the shell hooks that zsh/etc support out of the box. It sometimes has issues. depending on the rest of your shell setup.
If possible, I’d suggest trying one of
- Install blesh, and remove bash-preexec from your shell setup. This is a new line editor for Bash, that handles things like shell hooks much better.
- If possible, try using zsh