mcfly icon indicating copy to clipboard operation
mcfly copied to clipboard

SqliteFailure

Open sivaswami opened this issue 4 years ago • 15 comments

• • • source mcfly.bash • • • McFly: Upgrading McFly DB to version 3, please wait...thread 'main' panicked at 'McFly error: Unable to add cmd_tp
l to commands: SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("duplicate column name: cmd_tpl"))',
src/libcore/result.rs:999:5 stack backtrace: 0: 1: 2: 3: 4: 5: 6: 7: 8: main 9: __libc_start_main 10:

sivaswami avatar Sep 19 '19 15:09 sivaswami

Hey @sivaswami, that's a new one. Are you just installing McFly for the first time?

cantino avatar Sep 19 '19 15:09 cantino

yes. for first time.

sivaswami avatar Sep 19 '19 15:09 sivaswami

could you try deleting the ~/.mcfly directoy and see if it happens again?

cantino avatar Sep 19 '19 17:09 cantino

• • • rm -rf ~/.mcfly ; source mcfly.bash 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, 108, 115]))', src/libcore/result.rs:999:5 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

sivaswami avatar Sep 19 '19 17:09 sivaswami

• • • rm -rf ~/.mcfly ; export RUST_BACKTRACE=1 ; source mcfly.bash 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, 108, 115]))', src/libcore/result.rs:999:5 stack backtrace: 0: 1: 2: 3: 4: 5: 6: 7: 8: main 9: __libc_start_main 10:

sivaswami avatar Sep 19 '19 17:09 sivaswami

Thank you @sivaswami. I suspect there's something in your existing history file that's causing an import error. I wish I knew what it was. I suspect that if you move .bash_history to a new name temporarily, then remove ~/.mcfly, it will work.

cantino avatar Sep 19 '19 18:09 cantino

I use timestamp with my history. is this could be a problem? content of history file looks like this:

#1529475153 ls #1529475159 cd test

my settings in bashrc : export HISTIGNORE='&:ssh*:*bin/se:. bin/se:*history:mutt:[bf]g:exit:pwd: hostname:*cd ..:bash:zsh:*echo:cs:h:pushd:popd' export HISTTIMEFORMAT='%F %T '

sivaswami avatar Sep 19 '19 19:09 sivaswami

does mcfly handles HISTTIMEFORMAT and other History related env parameter settings ? some more options include: export HISTTIMEFORMAT=”%a %h %d – %r ” export HISTTIMEFORMAT=”%A %B %d – %r ”

sivaswami avatar Sep 19 '19 19:09 sivaswami

in some env, I also change $HISTFILE to point to different file.

sivaswami avatar Sep 19 '19 19:09 sivaswami

Ah! We do support timestamps, but currently only in the default epoch format. I suspect if you unset HISTTIMEFORMAT it'd work.

cantino avatar Sep 19 '19 20:09 cantino

It works now after deleting the bash_history file. You are creating a new screen itself. is there any way, we can do half-screen alone just like fzf ? What are the intelligence I get from mcfly ? any inputs or documentation link ? Just to understand as beginner.

sivaswami avatar Sep 20 '19 05:09 sivaswami

Hey @sivaswami, glad it's working! The current UI is full screen. If you'd want to work on a half-screen view, you'd be welcome to. I find the current experience meets my needs well.

cantino avatar Sep 22 '19 19:09 cantino

If there are 'bad lines' in ~/.bash_history/etc, can they be ignored?

Tatsh avatar Dec 01 '21 02:12 Tatsh

They should be, @Tatsh. What are you seeing?

cantino avatar Dec 24 '21 17:12 cantino

I had a different error that was caused by using su without a new login shell (su -). This caused an issue with a temporary file mcfly writes to, because environment variables were inherited.

Tatsh avatar Dec 24 '21 19:12 Tatsh