Sqlite3 error: duplicate column name: cmd_tpl
@Lomanic wrote:
I'm trying McFly 0.3.3 (binary release x64 and manual install) on Debian 9 and I'm encountering the same error
McFly: Upgrading McFly DB to version 3, please wait...thread 'main' panicked at 'McFly error: Unable to add cmd_tpl to commands: SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("duplicate column name: cmd_tpl"))', src/libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Setting export RUST_BACKTRACE=1 adds the following backtrace
stack backtrace:
0: <unknown>
1: <unknown>
2: <unknown>
3: <unknown>
4: <unknown>
5: <unknown>
6: <unknown>
7: <unknown>
8: <unknown>
9: main
10: __libc_start_main
11: <unknown>
For me mcfly.bash is properly sourced (MCFLY_SESSION_ID and MCFLY_HISTORY are set)
Here is the result of export RUST_BACKTRACE=1 && rm ~/.mcfly/history.db
McFly: Importing Bash history for the first time. This may take a minute or two...thread 'main' panicked at 'McFly error: Insert to work: NulError(NulError(0, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 49, 53, 51, 56, 56, 49, 51, 53, 49, 54]))', src/libcore/result.rs:1009:5
stack backtrace:
0: <unknown>
1: <unknown>
2: <unknown>
3: <unknown>
4: <unknown>
5: <unknown>
6: <unknown>
7: <unknown>
8: <unknown>
9: main
10: __libc_start_main
11: <unknown>
Hey @Lomanic, that's very odd. I can't reproduce it. You should be able to delete ~/.mcfly/history.db and it'll rebuild. Mind trying that? I've also added a guard for command insertion in https://github.com/cantino/mcfly/pull/59, but I don't think that's the whole problem.
I explained how I fixed this issue in https://github.com/cantino/mcfly/issues/17#issuecomment-479462830 (I had bad characters in my history file, see also https://github.com/cantino/mcfly/issues/17#issuecomment-451357620). I don't use mcfly anymore but I think I still have the problematic history file backed up, I can send it to you anonymised for debugging if you want.
Sure, if that's easy, thanks!
Had the same problem... I accidentally entered something like this in the shell:
^@^@^@^@^@^@^@[...]^@^@^@^@^@^@^@^@^@sudo
After i deleted the line, McFly works.
Thanks @linuxundich! That history file is working for me now. I don't know if this is something that's been fixed, or if the invalid UTF characters got lost in the transfer.
I met this issue as well. how about just skipping importing the command which causes error and display some warning that what commands are failed to import? Now mcfly cannot run at all. I don't mind imported shell history is incomplete, I just want to use it..
Thanks
Is it easy for you to see if #194 fixes this for you?
@gbstack @linuxundich any chance you could test #194?