Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git sync panic with Unexpected git2 error #318

Open
2 tasks done
sublimeye opened this issue Aug 26, 2023 · 4 comments
Open
2 tasks done

git sync panic with Unexpected git2 error #318

sublimeye opened this issue Aug 26, 2023 · 4 comments
Labels
bug Not as expected

Comments

@sublimeye
Copy link

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Description

  • happens with git sync, git next / prev
  • git stack shows a tree
  • git switch works as well

Version

git-stack 0.10.17

Steps to reproduce

prerequisites

  • working in a private repository
  • working in private enterprise git configuration

steps

install git stack
register aliases
checkout a repo / master branch (no changes)
run git sync

Actual Behaviour

panic

Expected Behaviour

no panic

Debug Output

[TRACE git_stack::config] Loading gitconfig
[TRACE git_stack::config] Loading /home//.gitconfig
[TRACE git_stack::config] Loading /home/
/config
[DEBUG globset] built glob set; 0 literals, 5 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
[TRACE git_stack::git::repo] Loading local branches
[TRACE git_stack::git::protect] master is ignored by "master"
[TRACE git_stack::graph::branch] Branch master is protected
[DEBUG git_stack::ops] Chose branch origin/master as the base for origin/master
[TRACE git_stack::graph::branch] Branch poppy-bare-root is not on the branch of 78ccc83ed415e5f30fd572b6c48ed294eaa662b8
[TRACE os_info::imp] linux::current_platform is called
[TRACE os_info::imp::lsb_release] lsb_release command returned Output { status: ExitStatus(unix_wait_status(0)), stdout: "Distributor ID:\tUbuntu\nDescription:\tUbuntu 20.04.6 LTS\nRelease:\t20.04\nCodename:\tfocal\n", stderr: "No LSB modules are available.\n" }
[TRACE os_info::imp::lsb_release] Trying to parse "Distributor ID:\tUbuntu\nDescription:\tUbuntu 20.04.6 LTS\nRelease:\t20.04\nCodename:\tfocal\n"
[TRACE os_info::imp::lsb_release] Parsed as 'Some("Ubuntu")' distribution and 'Some("20.04")' version
[TRACE os_info::imp] Returning Info { os_type: Ubuntu, version: Custom("20.04"), edition: None, codename: Some("focal"), bitness: X64, architecture: Some("x86_64") }
Well, this is embarrassing.

tracefile

name = "git-stack"
operating_system = "Ubuntu 20.04 (focal) [64-bit]"
crate_version = "0.10.17"
explanation = """
Panic occurred in file '/home/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/git-stack-0.10.17/src/git/repo.rs' at line 184
"""
cause = "Unexpected git2 error: invalid data in index - calculated checksum does not match expected; class=Index (10)"
method = "Panic"
backtrace = """

0: 0x564f516649e0 - git_stack::git::repo::GitRepo::is_dirty::h03c07a5f74680362
1: 0x564f516685bc - git_stack::git::repo::stash_push::hf8580558d076d206
2: 0x564f5158b75c - git_stack::sync::SyncArgs::exec::hd8902831d68a03fc
3: 0x564f515990a9 - git_stack::args::Args::exec::h5185612fc3b1b138
4: 0x564f5156ade3 - git_stack::run::ha096894fe63ff735
5: 0x564f5156a688 - git_stack::main::h262e0a49089c1e64
6: 0x564f515a9583 - std::sys_common::backtrace::__rust_begin_short_backtrace::h9c19c74b83540e41
7: 0x564f515a51a9 - std::rt::lang_start::{{closure}}::hb24346ccad80bb0d
8: 0x564f518bb5fb - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h75ba4244a1c7bb54
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:284
- std::panicking::try::do_call::h0a2baa36dea975a1
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:500
- std::panicking::try::h0e42aa233d4224d4
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:464
- std::panic::catch_unwind::hefdfd8f482606434
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panic.rs:142
- std::rt::lang_start_internal::{{closure}}::h457959f0f91da23b
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:148
- std::panicking::try::do_call::h112cfd1acb38183b
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:500
- std::panicking::try::ha64f15b20cec18ca
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:464
- std::panic::catch_unwind::hbacc2b68ee2c119e
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panic.rs:142
- std::rt::lang_start_internal::h5f408694586c2a05
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:148
9: 0x564f5156afd5 - main
10: 0x7f19abf4e083 - __libc_start_main
11: 0x564f5151d93e - _start
12: 0x0 - """

@sublimeye sublimeye added the bug Not as expected label Aug 26, 2023
@epage
Copy link
Collaborator

epage commented Aug 27, 2023

cause = "Unexpected git2 error: invalid data in index - calculated checksum does not match expected; class=Index (10)"

That is an interesting error. I'm curious if you have any idea how your repo got into that state so I can reproduce this

@epage
Copy link
Collaborator

epage commented Aug 27, 2023

(it'd also be helpful for knowing how we should respond to that error)

@arxanas
Copy link
Contributor

arxanas commented Aug 27, 2023

You might want to see if arxanas/git-branchless#894 is related.

@epage
Copy link
Collaborator

epage commented Aug 27, 2023

The key information if this is only reproducible with git 2.40+

It looks like it's this issue in libgit2: libgit2/libgit2#6531

You can follow the workaround here:

workaround is to disable the offending option git config --local index.skipHash false. then you have to clear your index and restage all your changes so that the index gets built with the option disabled.

I expect we'll have to wait for libgit2 to fix it and for the changes to propagate downstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not as expected
Projects
None yet
Development

No branches or pull requests

3 participants