{"record":{"id":"e8e920540d2d2bee","repo":"nikivdev/code","slug":"failed-e8e920","errorCode":null,"errorMessage":"{} failed","messagePattern":"(.+?) failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/repos.rs","lineNumber":1430,"sourceCode":"    let script_path = runtime_assets::require_asset_path(\"scripts/private_mirror.py\")?;\n    let output = Command::new(\"python3\")\n        .arg(&script_path)\n        .args(args)\n        .current_dir(repo_root)\n        .output()\n        .with_context(|| format!(\"failed to run {}\", script_path.display()))?;\n    if !output.status.success() {\n        let stderr = String::from_utf8_lossy(&output.stderr);\n        let stdout = String::from_utf8_lossy(&output.stdout);\n        let message = stderr.trim();\n        if !message.is_empty() {\n            bail!(\"{}\", message);\n        }\n        let message = stdout.trim();\n        if !message.is_empty() {\n            bail!(\"{}\", message);\n        }\n        bail!(\"{} failed\", script_path.display());\n    }\n    Ok(String::from_utf8_lossy(&output.stdout).to_string())\n}\n\nfn parse_github_remote_url(url: &str) -> Option<GithubRemoteRef> {\n    let trimmed = url.trim().trim_end_matches('/');\n    let path = if let Some(rest) = trimmed.strip_prefix(\"git@github.com:\") {\n        rest.trim_end_matches(\".git\")\n    } else if let Some(rest) = trimmed.strip_prefix(\"https://\") {\n        let rest = rest.strip_prefix(\"github.com/\").or_else(|| {\n            let (_userinfo, host_and_path) = rest.split_once('@')?;\n            host_and_path.strip_prefix(\"github.com/\")\n        })?;\n        rest.trim_end_matches(\".git\")\n    } else if let Some(rest) = trimmed.strip_prefix(\"https://github.com/\") {\n        rest.trim_end_matches(\".git\")\n    } else {\n        return None;","sourceCodeStart":1412,"sourceCodeEnd":1448,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/repos.rs#L1412-L1448","documentation":"Generic failure message emitted when an operation on a repository (e.g. fetch, pull, or push) fails; the repository identity is interpolated into the message.","triggerScenarios":"Script exits with a non-zero status while producing no output on either stream (silent failure, immediate crash, or signal kill).","commonSituations":"Scripts with `exit 1` and no message; missing interpreter causing silent failure; scripts killed by a signal; output swallowed by redirection inside the script.","solutions":["Run the script manually and observe its exit code and output.","Add `set -e` and explicit echo-to-stderr diagnostics to the script.","Check the script's shebang/interpreter exists and file is executable."],"exampleFix":"// before: silent failure\n#!/bin/sh\ntest -f $REQUIRED && exit 0 || exit 1\n// after\n#!/bin/sh\ntest -f $REQUIRED || { echo \"missing $REQUIRED\" >&2; exit 1; }","handlingStrategy":"fallback","validationCode":"fn script_ready(p: &std::path::Path) -> bool {\n    p.exists()\n        && p.metadata().map_or(false, |m| {\n            use std::os::unix::fs::PermissionsExt;\n            m.permissions().mode() & 0o111 != 0\n        })\n        && std::fs::read_to_string(p)\n            .ok()\n            .and_then(|c| c.lines().next().map(|l| l.starts_with(\"#!\")))\n            .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match run_repo_script(&script_path) {\n    Err(e) if e.to_string().ends_with(\"failed\") => {\n        eprintln!(\"script produced no output; run manually to debug:\");\n        eprintln!(\"  $ {}\", script_path.display());\n    }\n    Err(e) => eprintln!(\"script error: {e}\"),\n    Ok(_) => {}\n}","preventionTips":["Ensure scripts are executable with a valid shebang.","Add explicit `echo ... >&2; exit 1` messages on every failure path.","Avoid redirecting all script output to files/void.","Test scripts under `set -x` to catch silent early exits."],"tags":["script","process-exit","silent-failure"],"backgroundTag":"script-execution-failed","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}