{"record":{"id":"00df5f5efd2aa28e","repo":"Pumpkin-MC/Pumpkin","slug":"io-error-0-00df5f","errorCode":null,"errorMessage":"Io error: {0}","messagePattern":"Io error: (.+?)","errorType":"error_code","errorClass":"ChunkReadingError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin-world/src/chunk/mod.rs","lineNumber":30,"sourceCode":"\nuse std::sync::RwLock;\nuse std::sync::atomic::AtomicBool;\nuse std::sync::atomic::AtomicU64;\nuse thiserror::Error;\n\npub mod format;\npub mod io;\npub mod palette;\n\n// TODO\npub const CHUNK_WIDTH: usize = BlockPalette::SIZE;\npub const CHUNK_AREA: usize = CHUNK_WIDTH * CHUNK_WIDTH;\npub const BIOME_VOLUME: usize = BiomePalette::VOLUME;\npub const SUBCHUNK_VOLUME: usize = CHUNK_AREA * CHUNK_WIDTH;\n\n#[derive(Error, Debug)]\npub enum ChunkReadingError {\n    #[error(\"Io error: {0}\")]\n    IoError(std::io::Error),\n    #[error(\"Invalid header\")]\n    InvalidHeader,\n    #[error(\"Region is invalid\")]\n    RegionIsInvalid,\n    #[error(\"Compression error {0}\")]\n    Compression(CompressionError),\n    #[error(\"Tried to read chunk which does not exist\")]\n    ChunkNotExist,\n    #[error(\"Failed to parse chunk from bytes: {0}\")]\n    ParsingError(ChunkParsingError),\n}\n\n#[derive(Error, Debug)]\npub enum ChunkWritingError {\n    #[error(\"Io error: {0}\")]\n    IoError(std::io::Error),\n    #[error(\"Compression error {0}\")]","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin-world/src/chunk/mod.rs#L12-L48","documentation":"`ChunkReadingError::IoError` wraps a std::io::Error raised while reading chunk/region files from disk (defined via thiserror in pumpkin-world's chunk module). It surfaces low-level I/O failures — missing files, permission problems, or device errors — during chunk deserialization.","triggerScenarios":"Any I/O operation during region/chunk file reading that returns std::io::Error — e.g. opening the region file fails, read_exact hits EOF mid-header, or seek fails.","commonSituations":"Missing or deleted region file in the world directory; wrong permissions on the world folder; disk full or I/O errors; corrupted world directory structure.","solutions":["Check the world/region file exists at the expected path (ls the region directory)","Fix filesystem permissions on the world directory","Check disk space and dmesg/SMART for hardware I/O errors","Recover the chunk/world from a backup if files are corrupted","Match on ChunkReadingError::IoError to surface the inner std::io::Error for diagnosis"],"exampleFix":"// before\nlet chunk = ChunkReader::read(...)?;\n// after\nmatch ChunkReader::read(...) {\n    Ok(c) => c,\n    Err(ChunkReadingError::IoError(e)) => {\n        log::error!(\"chunk io failure: {e}\");\n        regenerate_or_skip_chunk();\n    }\n    Err(e) => return Err(e.into()),\n}","handlingStrategy":"try-catch","validationCode":"let path = region_file_path(coords);\nif !path.exists() {\n    return Err(WorldError::RegionMissing(path));\n}","typeGuard":null,"tryCatchPattern":"match chunk::read(&path) {\n    Ok(c) => c,\n    Err(ChunkReadingError::IoError(e)) => {\n        log::error!(\"chunk io: {e}\");\n        skip_or_regen_chunk();\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Back up world/region directories regularly","Run the server with filesystem permissions covering the world dir","Monitor disk space and health where region files live"],"tags":["io","world","chunk","filesystem"],"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"}