{"record":{"id":"7a6e2b2dc4772a98","repo":"gitbutlerapp/gitbutler","slug":"unknown","errorCode":"Unknown","errorMessage":"git fetch worker thread panicked: {reason}","messagePattern":"git fetch worker thread panicked: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gitbutler-git/src/context.rs","lineNumber":180,"sourceCode":"        )?;\n        Ok(runtime.block_on(crate::fetch(\n            repo_path,\n            crate::tokio::TokioExecutor,\n            &remote,\n            on_prompt,\n        )))\n    })\n    .join()\n    .map_err(|panic| {\n        let reason = if let Some(message) = panic.downcast_ref::<String>() {\n            message.clone()\n        } else if let Some(message) = panic.downcast_ref::<&'static str>() {\n            (*message).to_owned()\n        } else {\n            \"unknown panic payload\".to_owned()\n        };\n\n        anyhow!(\"git fetch worker thread panicked: {reason}\").context(\n            but_error::Context::new(\"git fetch failed unexpectedly\").with_code(Code::Unknown),\n        )\n    })??;\n    result.map_err(map_needs_authorization)\n}\n\n/// The concrete error type produced by fetch/push through the tokio executor.\ntype GitError = crate::Error<crate::repository::Error<crate::tokio::TokioExecutor>>;\n\n/// Convert the error into an anyhow error, giving `NeedsAuthorization` failures a message that\n/// tells the user what to do about it (see [`needs_authorization_message`]); every other error\n/// converts as-is.\nfn map_needs_authorization(err: GitError) -> anyhow::Error {\n    let crate::Error::Backend(crate::repository::RepositoryError::NeedsAuthorization(ref prompt)) =\n        err\n    else {\n        return err.into();\n    };","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/gitbutler-git/src/context.rs#L162-L198","documentation":"Wraps a panic caught from the dedicated git fetch worker thread. fetch runs git fetch on a spawned thread; a catch_unwind converts any panic payload into this anyhow error with code Unknown, since the fetch never produced a normal result.","triggerScenarios":"The fetch worker thread panics — e.g. invalid UTF-8 in unexpected output, an internal assertion/ref parse failure, or a bug in fetch plumbing triggered by an unusual repo state or malformed remote output.","commonSituations":"Repos with exotic ref names or malformed packed-refs entries; corrupted .git directory; git hook or remote output that trips an unwrap inside the worker; version-specific gix bugs.","solutions":["Read the inner panic reason in the error chain to find the panicking assertion.","Check repo integrity (`git fsck`) and retry.","Run `git fetch <remote>` manually to see if plain git also fails.","Report as a bug with the panic reason if the underlying CLI fetch succeeds."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"std::process::Command::new(\"git\").args([\"fetch\", remote]).status()?; // sanity-check repo handles fetch","typeGuard":null,"tryCatchPattern":"match ctx.fetch(remote, None) {\n    Err(e) if e.to_string().contains(\"worker thread panicked\") => {\n        log::error!(\"fetch panicked: {e:#}\"); // inspect chained reason, run git fsck\n    }\n    r => r?,\n}","preventionTips":["Run git fsck periodically to catch corruption that trips internal unwraps.","Keep the library/gitoxide versions updated; panics here are usually bugs.","Report panics with the full error chain to maintainers."],"tags":["git","fetch","panic","worker-thread"],"backgroundTag":"thread-interrupted","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}