{"record":{"id":"35f84513dee19d49","repo":"windmill-labs/windmill","slug":"could-not-create-build-dir-for-rust-e-e","errorCode":null,"errorMessage":"Could not create build dir for rust.\ne: {e}","messagePattern":"Could not create build dir for rust\\.\ne: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-worker/src/rust_executor.rs","lineNumber":384,"sourceCode":"                    ))\n                }\n            }\n        })\n        .unwrap_or((\n            format!(\"{}/build/{}\", *RUST_CACHE_DIR, Uuid::new_v4()),\n            false,\n        ));\n\n    {\n        let (t, r, g) = (\n            create_dir_all(format!(\"{}/target\", &bd)).await,\n            create_dir_all(format!(\"{}/registry\", &bd)).await,\n            create_dir_all(format!(\"{}/git\", &bd)).await,\n        );\n\n        t.and(r)\n            .and(g)\n            .map_err(|e| anyhow::anyhow!(\"Could not create build dir for rust.\\ne: {e}\"))?;\n    }\n\n    if run_sweep {\n        // Also run sweep to make sure target isn't using too much disk\n        let mut sweep_cmd = Command::new(CARGO_PATH.as_str());\n        let sweep_path = format!(\"{}/bin:{}\", CARGO_HOME.as_str(), PATH_ENV.as_str());\n        sweep_cmd\n            .current_dir(job_dir)\n            .env_clear()\n            .env(\"PATH\", &sweep_path)\n            .env(\"CARGO_HOME\", CARGO_HOME.as_str())\n            .env(\"HOME\", HOME_ENV.as_str())\n            .env(\"CARGO_TARGET_DIR\", &(bd.clone() + \"/target\"))\n            .env(\"RUSTUP_HOME\", RUSTUP_HOME.as_str())\n            .args([\"sweep\", \"--maxsize\", SWEEP_MAXSIZE.as_str()])\n            .stdout(Stdio::piped())\n            .stderr(Stdio::piped());\n","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-worker/src/rust_executor.rs#L366-L402","documentation":"Raised in get_build_dir when create_dir_all fails on any of the target/, registry/ or git/ subdirectories of the per-build Rust cache directory under RUST_CACHE_DIR. It is a filesystem-level failure (permissions, read-only volume, disk full) on the worker host, not a cargo error; the first failing create_dir_all is chained into an anyhow error.","triggerScenarios":"Thrown at backend/windmill-worker/src/rust_executor.rs:384 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that RUST_CACHE_DIR (and its parent volume) is writable by the worker process","Free disk space or raise the volume size on the worker host","If running in a container, ensure the cache dir is a writable mount and not overlay-locked","Retry the job once — transient NFS/mount glitches can surface here"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}