mcfly icon indicating copy to clipboard operation
mcfly copied to clipboard

Sqlite3 error: duplicate column name: cmd_tpl

Open cantino opened this issue 7 years ago • 8 comments

@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>

cantino avatar Apr 08 '19 20:04 cantino

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.

cantino avatar May 13 '19 15:05 cantino

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.

Lomanic avatar May 14 '19 17:05 Lomanic

Sure, if that's easy, thanks!

cantino avatar May 16 '19 02:05 cantino

Had the same problem... I accidentally entered something like this in the shell:

^@^@^@^@^@^@^@[...]^@^@^@^@^@^@^@^@^@sudo

After i deleted the line, McFly works.

bash_history.txt

linuxundich avatar May 16 '19 18:05 linuxundich

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.

cantino avatar May 20 '19 19:05 cantino

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

gbstack avatar Sep 15 '21 03:09 gbstack

Is it easy for you to see if #194 fixes this for you?

cantino avatar Sep 17 '21 22:09 cantino

@gbstack @linuxundich any chance you could test #194?

cantino avatar Nov 06 '21 19:11 cantino