{"record":{"id":"c25d319c88a2740d","repo":"Pumpkin-MC/Pumpkin","slug":"failed-to-write-cache-file-for-plugin-0","errorCode":null,"errorMessage":"Failed to write cache file for plugin: {0}","messagePattern":"Failed to write cache file for plugin: (.+?)","errorType":"exception","errorClass":"PluginInitError","httpStatus":null,"severity":"warning","filePath":"crates/pumpkin/src/plugin/loader/wasm/wasm_host/mod.rs","lineNumber":35,"sourceCode":"pub mod signature;\npub mod state;\npub mod wit;\n\n#[derive(Error, Debug)]\npub enum PluginInitError {\n    #[error(\"Engine creation failed: {0}\")]\n    EngineCreationFailed(wasmtime::Error),\n    #[error(\"Failed to setup linker: {0}\")]\n    LinkerSetupFailed(wasmtime::Error),\n    #[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,","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/loader/wasm/wasm_host/mod.rs#L17-L53","documentation":"This is `PluginInitError::ComponentCacheWriteFailed`, wrapping `std::io::Error`. The serialized compiled component was produced but writing it to the cache file on disk failed. The plugin may still load, but caching is broken and startup will recompile every time.","triggerScenarios":"`std::fs::write` of the `.cwasm` cache artifact fails — read-only filesystem, missing cache directory, disk full, or permission denied on the cache path.","commonSituations":"Server running under a user without write access to its data directory, Docker volume mounted read-only, full disk, cache dir deleted while server running.","solutions":["Ensure the cache/plugins directory exists and is writable by the server user (mkdir + chown/chmod)","Free disk space if the disk is full","Fix container/volume mounts so the data dir is not read-only","If writes can't be enabled, run without the cache (accept recompilation cost)"],"exampleFix":"# before: PermissionDenied on ./cache\nmkdir -p cache && chown -R minecraft:minecraft cache\n# or in Docker: drop :ro from the volume mount","handlingStrategy":"fallback","validationCode":"let dir = Path::new(cache_dir);\nif !dir.exists() { std::fs::create_dir_all(dir)?; }\nlet probe = dir.join(\".write-probe\");\nstd::fs::write(&probe, b\"ok\").map_err(|e| format!(\"cache dir not writable: {e}\"))?;\nlet _ = std::fs::remove_file(&probe);","typeGuard":"fn cache_writable(dir: &Path) -> bool { dir.is_dir() && std::fs::write(dir.join(\".probe\"), b\"\").is_ok() }","tryCatchPattern":"match init::write_cache(&artifact, cache_path) {\n    Err(PluginInitError::ComponentCacheWriteFailed(e)) => {\n        warn!(\"cannot write plugin cache {}: {e}; continuing without cache\", cache_path.display());\n    }\n    other => other,\n}","preventionTips":["Ensure the server's data directory is writable by its runtime user","Avoid read-only volume mounts for server data dirs","Monitor disk space on the host"],"tags":["io","cache","file-write","plugin"],"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"}