{"record":{"id":"62b6afa142e88f5e","repo":"rust-lang/rust","slug":"job-failed","errorCode":null,"errorMessage":"Job failed","messagePattern":"Job failed","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/ci/citool/src/main.rs","lineNumber":135,"sourceCode":"        let value = match value {\n            Value::Bool(value) => value.to_string(),\n            Value::Number(value) => value.to_string(),\n            Value::String(value) => value.clone(),\n            _ => panic!(\"Unexpected type for environment variable {key} Only bool/number/string is supported.\")\n        };\n        (key.clone(), value)\n    }));\n\n    init_submodule_if_needed(\"src/llvm-project/\")?;\n\n    let mut cmd = Command::new(Path::new(DOCKER_DIRECTORY).join(\"run.sh\"));\n    cmd.arg(job.image());\n    cmd.envs(custom_env);\n\n    eprintln!(\"Executing {cmd:?}\");\n\n    let result = cmd.spawn()?.wait()?;\n    if !result.success() { Err(anyhow::anyhow!(\"Job failed\")) } else { Ok(()) }\n}\n\nfn upload_ci_metrics(cpu_usage_csv: &Path) -> anyhow::Result<()> {\n    let usage = load_cpu_usage(cpu_usage_csv).context(\"Cannot load CPU usage from input CSV\")?;\n    eprintln!(\"CPU usage\\n{usage:?}\");\n\n    let avg = if !usage.is_empty() { usage.iter().sum::<f64>() / usage.len() as f64 } else { 0.0 };\n    eprintln!(\"CPU usage average: {avg}\");\n\n    upload_datadog_metric(\"avg-cpu-usage\", avg).context(\"Cannot upload Datadog metric\")?;\n\n    Ok(())\n}\n\nfn postprocess_metrics(\n    metrics_path: PathBuf,\n    parent: Option<String>,\n    job_name: Option<String>,","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/ci/citool/src/main.rs#L117-L153","documentation":"Thrown by run_workflow_locally after the spawned docker run.sh process (configured with the job's image and environment) exits with a non-zero status. The message carries no detail because the underlying failure already printed its own output to the inherited stdout/stderr of the docker container.","triggerScenarios":"The job's build/test/CI script inside the Docker container failed: a compilation error, a test failure, a missing dependency, an out-of-memory or disk-space exhaustion, or a network error fetching artifacts.","commonSituations":"Reproducing a failing CI job locally where the same test failure occurs; Docker image out of date relative to the repo; insufficient host resources (disk/RAM) for a dist build; a flaky test.","solutions":["Scroll up through the docker container output to find the real failing command or test output.","Re-run with the same job name after fixing the identified build/test failure.","If the container errored on environment setup, verify the Docker image is current (./x.py setup, or rebuild the image).","Check host resources (df -h, free -h); dist jobs need substantial disk and RAM."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match run_workflow_locally(db, job_type, name) {\n    Ok(()) => {}\n    Err(e) if e.to_string() == \"Job failed\" => {\n        // The real failure was printed by the container; surface exit guidance.\n        eprintln!(\"Local job exited non-zero; review container output above.\");\n        std::process::exit(1);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Run jobs inside the same Docker image CI uses to keep behavior reproducible.","Keep host disk/RAM ample for dist jobs.","Rebuild the Docker image after pulling dependency changes."],"tags":["ci","citool","local-execution","docker","build-failure"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}