Skip to content

panick because of SqliteFailure and DatabaseCorrupt #8553

Open
@amtoine

Description

Describe the bug

man second time i somewhat break my SQLITE history 😆

suddenly, nushell panicked as soon as i start typing something...

i managed to capture the panick

thread 'main' panicked at 'todo: error handling: ReedlineError(HistoryDatabaseError("SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some(\"database disk image is malformed\"))"))', /home/disc/a.stevan/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/reedline-0.17.0/src/hinter/default.rs:24:18
stack backtrace:
   0:     0x55be0214de65 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3155a8c966b4beb5
   1:     0x55be00bb9e9e - core::fmt::write::h062c617411b691df
   2:     0x55be021464d5 - std::io::Write::write_fmt::hb61fdf1275c61e1c
   3:     0x55be0214dc35 - std::sys_common::backtrace::print::hca896ae22beb06cb
   4:     0x55be0214f9bf - std::panicking::default_hook::{{closure}}::h0b5eeed5cf36ab5f
   5:     0x55be0214f72a - std::panicking::default_hook::h8932b573145a321b
   6:     0x55be02150050 - std::panicking::rust_panic_with_hook::h4b1447a24e3e94f8
   7:     0x55be0214fde4 - std::panicking::begin_panic_handler::{{closure}}::h8701da9995a3820c
   8:     0x55be0214e37c - std::sys_common::backtrace::__rust_end_short_backtrace::hb696c5ed02a01598
   9:     0x55be0214fb32 - rust_begin_unwind
  10:     0x55be0080faa3 - core::panicking::panic_fmt::h8aa706a976963c88
  11:     0x55be0080fd63 - core::result::unwrap_failed::h065c02f906ca4578
  12:     0x55be0200add3 - <reedline::hinter::default::DefaultHinter as reedline::hinter::Hinter>::handle::h0ce84c434fdb5c34
  13:     0x55be0202f52e - reedline::engine::Reedline::repaint::h747ff1059a070ba7
  14:     0x55be0202c0a0 - reedline::engine::Reedline::read_line::hfdb34a853bcf81bb
  15:     0x55be00cbdffe - nu_cli::repl::evaluate_repl::hbb8c871bdafdd4cb
  16:     0x55be00c7c6eb - nu::run::run_repl::h46faae14c9cc3c2d
  17:     0x55be00c89f6a - nu::main::he99211a7fe877948
  18:     0x55be00c8acea - std::sys_common::backtrace::__rust_begin_short_backtrace::h2c98c55c9dae525b
  19:     0x55be00c8addf - std::rt::lang_start::{{closure}}::h19eb786a933e9365
  20:     0x55be0213e49b - std::rt::lang_start_internal::hcd7e45acd25ab5ab
  21:     0x55be00c8a5a5 - main
  22:     0x7ff1b4e29d90 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  23:     0x7ff1b4e29e40 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:392:3
  24:     0x55be008723e5 - _start
  25:                0x0 - <unknown>

i think it's because, when you start typing, nushell queries the history for suggestion based on the history, it fails and crashes the session 🤔

i managed to solve the issue by removing all history files from another shell.

How to reproduce

i do not have real steps to reproduce this...

only the traceback above and the history files i kept on my working machine 🤔

i can bring them back here tomorrow 👍

Expected behavior

i opened the history files with open and the opened fine, without any sign of "corruption" 🤔

then, i think nushell should not crash 😉

Screenshots

No response

Configuration

same here, the version is on my working machine... i can bring it tomorrow 😌

Additional context

No response

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't workinghistoryRelated to the historyline editorIssues related to reedlinepanic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions