{"record":{"id":"58a12c2797ac0c51","repo":"Pumpkin-MC/Pumpkin","slug":"io-error-0-58a12c","errorCode":null,"errorMessage":"IO error: {0}","messagePattern":"IO error: (.+?)","errorType":"error_code","errorClass":"ManagerError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/plugin/mod.rs","lineNumber":223,"sourceCode":"/// - Windows: Plugin cannot be unloaded, it can be only active or not\nstruct LoadedPlugin {\n    metadata: PluginMetadata,\n    instance: Option<Arc<dyn Plugin>>,\n    loader: Arc<dyn PluginLoader>,\n    loader_data: Option<Box<dyn Any + Send + Sync>>,\n    is_active: bool,\n    context: Arc<Context>,\n    path: PathBuf,\n}\n\n/// Error types for plugin management\n#[derive(Error, Debug)]\npub enum ManagerError {\n    #[error(\"Plugin not found: {0}\")]\n    PluginNotFound(String),\n    #[error(\"Loader error: {0}\")]\n    LoaderError(#[from] LoaderError),\n    #[error(\"IO error: {0}\")]\n    IoError(#[from] std::io::Error),\n    #[error(\"Dependency error: {0}\")]\n    DependencyError(String),\n}\n\nimpl Default for PluginManager {\n    fn default() -> Self {\n        Self::new(true)\n    }\n}\n\nimpl PluginManager {\n    /// Create a new plugin manager with default loaders\n    #[must_use]\n    pub fn new(verify_plugin_signatures: bool) -> Self {\n        Self {\n            plugins: SyncRwLock::new(Vec::new()),\n            loaders: RwLock::new(vec![","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/mod.rs#L205-L241","documentation":"ManagerError::IoError(#[from] std::io::Error) wraps a raw std::io::Error in the plugin manager's error enum, displayed as \"IO error: {0}\". It is produced when filesystem operations performed by the plugin manager fail — reading the plugins directory, opening plugin files, copying/moving files during load/unload. The wrapped io::Error carries the OS-level cause (NotFound, PermissionDenied, etc.).","triggerScenarios":"Plugin directory missing or unreadable at startup scan; a plugin file deleted/locked while loading; disk or permission failures when the manager reads plugin jars or writes state during enable/disable/unload.","commonSituations":"Wrong plugins folder configured; server run under a user lacking read permission on the plugins directory; read-only mounts or containers; antivirus/backup tools locking plugin files on Windows.","solutions":["Check the wrapped io::Error kind and message for the concrete filesystem cause","Verify the plugins directory path exists and the server process has read/write permissions","Ensure no external process (AV, sync client) is locking the plugin files","If the directory is legitimately absent, create it or fix the configured path"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let dir = Path::new(\"plugins\");\nif !dir.is_dir() {\n    std::fs::create_dir_all(dir)?;\n}\nassert!(dir.metadata()?.permissions().readonly() == false);","typeGuard":null,"tryCatchPattern":"match manager.load_all() {\n    Err(ManagerError::IoError(e)) if e.kind() == std::io::ErrorKind::PermissionDenied => {\n        error!(\"fix permissions on plugins directory: {e}\");\n    }\n    Err(ManagerError::IoError(e)) => error!(\"io failure during plugin scan: {e}\"),\n    other => other?,\n}","preventionTips":["Run the server with a user that owns or can read/write the plugins directory","Create the plugins directory before first launch","Exclude the plugins dir from AV/sync tools that lock files","Check disk space and mount status in containerized deployments"],"tags":["plugin-manager","io","filesystem","thiserror"],"backgroundTag":"file-read-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"}