{"record":{"id":"3e355de826ab7eaf","repo":"Pumpkin-MC/Pumpkin","slug":"failed-to-create-cache-data-for-plugin-0","errorCode":null,"errorMessage":"Failed to create cache data for plugin: {0}","messagePattern":"Failed to create cache data for plugin: (.+?)","errorType":"exception","errorClass":"PluginInitError","httpStatus":null,"severity":"warning","filePath":"crates/pumpkin/src/plugin/loader/wasm/wasm_host/mod.rs","lineNumber":33,"sourceCode":"pub mod concurrent_store;\npub mod logging;\npub 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,","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/loader/wasm/wasm_host/mod.rs#L15-L51","documentation":"This is `PluginInitError::ComponentCacheSerializeFailed`, wrapping a `wasmtime::Error`. Pumpkin precompiles plugin components to a on-disk cache; serializing the compiled artifact (`Component::serialize`) failed. This is a cache-optimization failure, not a plugin-correctness problem.","triggerScenarios":"Calling `Component::serialize` on the compiled component fails — typically version incompatibility between the wasmtime that produced the artifact and the serializer, or unsupported caching configuration.","commonSituations":"Stale cache format after a server/wasmtime upgrade, exotic wasmtime feature flags whose artifacts can't be serialized, disk or memory errors during serialization.","solutions":["Delete the plugin cache directory and let the server rebuild it","Ensure the server was fully rebuilt after a wasmtime version bump (mixed artifacts)","Disable wasmtime caching/serialization in config if not needed — plugins will still load via normal compilation","Report/inspect the wrapped wasmtime::Error if serialization is consistently unsupported"],"exampleFix":"// before: cache/teleport.cwasm (stale, old wasmtime)\n// after:  rm -rf cache/*.cwasm && restart server","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match component.serialize() {\n    Err(PluginInitError::ComponentCacheSerializeFailed(e)) => {\n        warn!(\"cache serialization failed ({e}); falling back to normal compilation\");\n        // continue loading the component without the cache\n    }\n    other => other,\n}","preventionTips":["Clear the cache directory after server/wasmtime upgrades","Fully rebuild the server so artifact versions match","Treat cache failures as non-fatal — fall back to regular compilation"],"tags":["wasmtime","cache","serialization","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"}