{"record":{"id":"36c778eb129ced28","repo":"paperclipai/paperclip","slug":"could-not-allocate-a-runner-diagnostic-temporary-f","errorCode":null,"errorMessage":"could not allocate a runner diagnostic temporary file","messagePattern":"could not allocate a runner diagnostic temporary file","errorType":"error_code","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/runner/crates/runner-core/src/bin/paperclip-runnerd.rs","lineNumber":92,"sourceCode":"        #[cfg(unix)]\n        options.mode(0o600);\n        let mut file = match options.open(&temporary) {\n            Ok(file) => file,\n            Err(error) if error.kind() == io::ErrorKind::AlreadyExists => continue,\n            Err(error) => return Err(error),\n        };\n        let write_result = (|| {\n            file.write_all(contents.as_bytes())?;\n            file.sync_all()?;\n            drop(file);\n            fs::rename(&temporary, &destination)\n        })();\n        if write_result.is_err() {\n            let _ = fs::remove_file(&temporary);\n        }\n        return write_result;\n    }\n    Err(io::Error::new(\n        io::ErrorKind::AlreadyExists,\n        \"could not allocate a runner diagnostic temporary file\",\n    ))\n}\n\nfn install_diagnostic_panic_hook(directory: Option<PathBuf>) {\n    let Some(directory) = directory else {\n        return;\n    };\n    std::panic::set_hook(Box::new(move |panic| {\n        let _ = persist_runner_diagnostic(&directory, &format!(\"paperclip-runnerd panic: {panic}\"));\n    }));\n}\n\nfn install_crypto_provider() {\n    // The production dependency graph enables both rustls crypto backends.\n    // Select the backend declared by this workspace before any TLS builder\n    // asks rustls for the process-level default. An embedding process may have","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/runner/crates/runner-core/src/bin/paperclip-runnerd.rs#L74-L110","documentation":"Guard in the diagnostics temp-file writer in paperclip-runnerd: after exhausting candidate temp file names (each open returning AlreadyExists), no unique temporary file could be created in the diagnostics directory. This is the allocation loop's give-up path — the directory is likely full of stale temp files, full on disk, or has restrictive permissions.","triggerScenarios":"Thrown at packages/paperclip-runner/runner/crates/runner-core/src/bin/paperclip-runnerd.rs:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Clear stale temporary files left in the diagnostics directory","Check disk space and inode availability on the diagnostics filesystem","Verify the runnerd process owns or can write to the diagnostics directory"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}