{"record":{"id":"07fee0a4efd4a4dc","repo":"Pumpkin-MC/Pumpkin","slug":"failed-to-create-cache-0","errorCode":null,"errorMessage":"Failed to create cache: {0}","messagePattern":"Failed to create cache: (.+?)","errorType":"exception","errorClass":"PluginInitError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/plugin/loader/wasm/wasm_host/mod.rs","lineNumber":45,"sourceCode":"    #[error(\"Plugin is built against a different API version: {0}\")]\n    ApiVersionMismatch(wasmtime::Error),\n    #[error(\"Failed to read plugin file: {0}\")]\n    FileReadFailed(std::io::Error),\n    #[error(\"Failed to load plugin as component: {0}\")]\n    ComponentNewFailed(wasmtime::Error),\n    #[error(\"Failed to create cache data for plugin: {0}\")]\n    ComponentCacheSerializeFailed(wasmtime::Error),\n    #[error(\"Failed to write cache file for plugin: {0}\")]\n    ComponentCacheWriteFailed(std::io::Error),\n    #[error(\"Failed to instantiate plugin: {0}\")]\n    InstantiationFailed(wasmtime::Error),\n    #[error(\"Calling `init_plugin` failed: {0}\")]\n    CallInitPluginFailed(wasmtime::Error),\n    #[error(\"Calling `get_metadata` failed: {0}\")]\n    CallGetMetadataFailed(wasmtime::Error),\n    #[error(\"Failed to get absolute path: {0}\")]\n    PathResolutionFailed(std::io::Error),\n    #[error(\"Failed to create cache: {0}\")]\n    CacheCreationFailed(wasmtime::Error),\n}\n\n#[derive(Clone, Copy, Default)]\nstruct SocketPolicy {\n    tcp_connect: bool,\n    tcp_bind: bool,\n    udp_send: bool,\n    udp_receive: bool,\n    udp_bind: bool,\n    loopback_only: bool,\n}\n\nimpl SocketPolicy {\n    const fn allows(self, addr: SocketAddr, reason: SocketAddrUse) -> bool {\n        // Wasmtime performs a wildcard bind before an outbound connect/send.\n        // Permit only that precursor here; the later destination check still\n        // enforces the actual protocol and loopback policy.","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/loader/wasm/wasm_host/mod.rs#L27-L63","documentation":"`CacheCreationFailed` wraps a wasmtime::Error from creating the wasmtime compilation cache used to speed up plugin loading. Wasmtime could not initialize its cache (config or cache directory problem).","triggerScenarios":"Configuring the wasmtime Engine with a cache config that points to an unwritable/nonexistent directory, or an invalid cache config setting.","commonSituations":"Read-only or missing cache directory (e.g. in containers or restricted $HOME); invalid cache config file; disk full.","solutions":["Ensure the wasmtime cache directory exists and is writable by the server process","Fix or remove the cache config so wasmtime runs without a cache","Check disk space and mount permissions","Point the cache dir to a writable location via env/config"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"let cache_dir = std::path::Path::new(&cache_path); if !cache_dir.is_dir() { std::fs::create_dir_all(cache_dir)?; } // verify write: std::fs::write(cache_dir.join(\".t\"), b\"\")?","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-create and pre-chmod the wasmtime cache directory","Use a writable path in containers (not a read-only mount)","Disable the cache if the environment cannot support it"],"tags":["wasmtime","cache","plugin-loader","filesystem"],"backgroundTag":"file-write-failed","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}