Giter Site home page Giter Site logo

Comments (12)

mehta avatar mehta commented on May 20, 2024 3

I had similar issue and in my case there were some bad-characters in my bash-history, it looks like:

$ cat .bash_history
   1   │ �^Awhich psql
   2   │ ^@exit
   3   │ ^@ksh
   4   | ls -l 
   5   | mkdir rex
   6   | .. 

So I performed following steps:

  1. Removed bad lines in ~/.bash_history (i.e. 1,2,3 in this case)
  2. Deleted ~/.mcfly/history.db
  3. source "$(brew --prefix)/opt/mcfly/mcfly.bash" ## For me, it was installed via homebrew
  4. RUST_BACKTRACE=1 mcfly -d search

and then mcfly was working just fine, I guess it has issue in importing non-ASCII characters from .bash_history.

from mcfly.

cantino avatar cantino commented on May 20, 2024

Woah, very weird. If you rm ~/.mcfly/history.db, does it happen again?

from mcfly.

buster avatar buster commented on May 20, 2024

Now it's this error:

RUST_BACKTRACE=1 mcfly -d search
thread 'main' panicked at 'Please ensure that MCFLY_SESSION_ID contains a random session ID.: NotPresent', libcore/result.rs:1009:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:227
             at libstd/panicking.rs:476
   3: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   4: rust_begin_unwind
             at libstd/panicking.rs:325
   5: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   6: core::result::unwrap_failed
   7: mcfly::settings::Settings::parse_args
   8: mcfly::main
   9: std::rt::lang_start::{{closure}}
  10: main
  11: __libc_start_main
  12: _start

from mcfly.

cantino avatar cantino commented on May 20, 2024

It sounds like mcfly.bash isn't loaded in your shell? That should be setting MCFLY_SESSION_ID

from mcfly.

buster avatar buster commented on May 20, 2024

You're right. Initially, i had a similar error when loading the mcfly.bash.
Afterwards i only tested with "mcfly search".

Anyway, after removing the db file it seems to work :)

from mcfly.

cantino avatar cantino commented on May 20, 2024

Glad it's working!

from mcfly.

cantino avatar cantino commented on May 20, 2024

@mehta, were you on v0.2.4 or newer when this happened?

from mcfly.

mehta avatar mehta commented on May 20, 2024

@mehta, were you on v0.2.4 or newer when this happened?

$ brew info mcfly
cantino/mcfly/mcfly: stable v0.3.1
...

from mcfly.

Lomanic avatar Lomanic commented on May 20, 2024

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>

Fixed like in #17 (comment), had non-printable characters in my history, they would show up in less like @^^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@#1553851840. For whatever reason they wouldn't show with grep -aPn '[^\x00-\x7F]' ~/.bash_history or any similar command, but I could find the right line with cat -en ~/.bash_history | grep "@^"

from mcfly.

cantino avatar cantino commented on May 20, 2024

That looks like a new error, @Lomanic. I'll make a new issue for it.

from mcfly.

jesusfj710 avatar jesusfj710 commented on May 20, 2024

Hi @cantino, could we add this to the readme.md or something like troubleshooting.md?

  1. Removed bad lines in ~/.bash_history (i.e. 1,2,3 in this case)
  2. Deleted ~/.mcfly/history.db
  3. source "$(brew --prefix)/opt/mcfly/mcfly.bash" ## For me, it was installed via homebrew
  4. RUST_BACKTRACE=1 mcfly -d search

from mcfly.

cantino avatar cantino commented on May 20, 2024

@jesusfj710 Sure, would you mind sending a PR?

from mcfly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.