Open kubouch opened 2 years ago
Seems to be introduced with https://github.com/nushell/reedline/pull/401
It seems the history database somehow gets corrupted. When I try to open-db
it, it shows an error "Not a SQLite file".
Trying to run nu
with the corrupted database results in
Error:
× error within history database: SqliteFailure(Error { code: NotADatabase, extended_code: 26 },
│ Some("file is not a database"))
Is your home directory on a network drive by any chance? If so, which one and with which mount options. It should be pretty hard to corrupt an SQLite database, the only instances I've myself had before were when on a network drive, opened from multiple computers, with a NFS mount option such as nolock
. It might also be helpful if you could send an example corrupted file (publicly or via email)
It was on a compute cluster (that I do not administer) that has many nodes so it is quite possible it was due to some mounting etc.
Since it might be hard to track down the cause, I think the panic should first be patched ASAP with some error handling, then we can move on to figuring out why the database got corrupted.
Could there also maybe be some corruption resulting due to threading or something within reedline? I'm not sure if rusqlite is really safe regarding that.
Platform Linux Terminal software tmux
Describe the problem you are observing.
Steps to reproduce
Happens with history set to sqlite.
Unfortunately, I don't have 100% repro steps but reedline seems to panic when I have one Nushell open, then open another one in a Slurm interactive session, work for a while, then try to bring up a history entry with the "up" key.
The panic happens at this line https://github.com/nushell/reedline/blame/70118f732c974fd953356020c6b3eb9b6ebe1ee0/src/engine.rs#L1007 where it says "todo: error handling". The expect() should be cleared up.
Screenshots/Screencaptures