Repository: jj-vcs/jj

Issue #1907: `thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Other("Is a directory (os error 21)")', lib/src/operation.rs:97:64`
Created: 2023-07-25T09:54:53Z
Description
My machine locked up and needed a hard reset, so there's a chance there's some file system corruption here (I run ext4). When I run any jj command, I now get:
❯ RUST_BACKTRACE=full jj op log
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Other("Is a directory (os error 21)")', lib/src/operation.rs:97:64
stack backtrace:
   0:     0x55e0419ba4f1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hded4932df41373b3
   1:     0x55e0419e492f - core::fmt::write::hb1cb56105a082ad9
   2:     0x55e0419b6091 - std::io::Write::write_fmt::h797fda7085c97e57
   3:     0x55e0419ba305 - std::sys_common::backtrace::print::hf74aa2eef05af215
   4:     0x55e0419bb9d7 - std::panicking::default_hook::{{closure}}::h8cad394227ea3de8
   5:     0x55e0419bb7c4 - std::panicking::default_hook::h249cc184fec99a8a
   6:     0x55e0419bbe8c - std::panicking::rust_panic_with_hook::h82ebcd5d5ed2fad4
   7:     0x55e0419bbd87 - std::panicking::begin_panic_handler::{{closure}}::h810bed8ecbe66f1a
   8:     0x55e0419ba926 - std::sys_common::backtrace::__rust_end_short_backtrace::h1410008071796261
   9:     0x55e0419bbad2 - rust_begin_unwind
  10:     0x55e0413e4f23 - core::panicking::panic_fmt::ha0a42a25e0cf258d
  11:     0x55e0413e53c3 - core::result::unwrap_failed::h100c4d67576990cf
  12:     0x55e04178213b - jj_lib::operation::Operation::view::h6709b46a87292520
  13:     0x55e041788c0b - jj_lib::repo::RepoLoader::load_at::h94367482d5849691
  14:     0x55e04147a6d4 - jj_cli::cli_util::CommandHelper::workspace_helper_internal::h2cdc6b2db1464e83
  15:     0x55e0414b8139 - jj_cli::commands::operation::cmd_op_log::h010be4d923fb200e
  16:     0x55e0414d90df - jj_cli::commands::run_command::h44a341f058127919
  17:     0x55e041418880 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h8fe6a69f8c1091b8
  18:     0x55e04146bf55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0847077649ffbc54
  19:     0x55e04149d1e8 - jj_cli::cli_util::CliRunner::run::h0dba531a0a7d9e9c
  20:     0x55e0413e57d1 - jj::main::h4e8ca46c819e8247
  21:     0x55e0413e5753 - std::sys_common::backtrace::__rust_begin_short_backtrace::h59ca8584147632a6
  22:     0x55e0413e5769 - std::rt::lang_start::{{closure}}::hd1da4e9f7a4e8af7
  23:     0x55e0419ae795 - std::rt::lang_start_internal::hd66bf6b7da144005
  24:     0x55e0413e5805 - main
  25:     0x7f60be55dace - __libc_start_call_main
  26:     0x7f60be55db89 - __libc_start_main@@GLIBC_2.34
  27:     0x55e0413e5685 - _start
  28:                0x0 - <unknown>

Not sure where to go from here, but I've archived this repo if we want to do any further investigations!

Duplicate issue #3370: Internal error after forced shutdown
Created: 2024-03-26T08:31:12Z
Description

I just had to reset my machine because of RAM starvation (not related to Jujutsu) after I moved through the history with jj edit. The command had already completed, but apparently some parts of the change were not yet written to persistent storage, because after rebooting all jj commands spit out an error.
Steps to Reproduce the Problem

run jj edit <change>
wait for the command to complete
power off the machine

Expected Behavior
Some data might be lost, but jujutsu is still in a workable state
Actual Behavior
Every jj command results in the output
Internal error: Failed to load the repo: Error when reading object  of type view: Is a directory (os error 21)

Specifications

Platform: nixOS 23.11
Version: jj 0.13.0

Closing comment (2024-03-26T15:02:10Z): Closed as dupe of #1907. Perhaps, fsync() stuff will help improve data integrity.