Pumpkin-MC/Pumpkin · critical · WorldInfoError

Info not found!

Error message

Info not found!

What it means

WorldInfoError::InfoNotFound indicates that no world info could be located for the level folder — neither level.dat nor its backup yielded usable LevelData. The WorldInfoReader contract (world_info/mod.rs:21) returns this when the reader cannot find the world info store at all.

Solutions

  1. Verify the configured world path points at the actual world folder containing level.dat.
  2. Restore level.dat from level.dat_old or a backup of the world.
  3. If intentionally starting a new world, let the server create fresh world info instead of reading an uninitialized folder.
  4. Check file permissions so an existing level.dat is actually readable (a permission failure can surface as not-found in the reader flow).

Example fix

// before: assuming the folder is a world
let level = reader.read_world_info(&args.path)?;
// after: verify level.dat exists first
if !args.path.join("level.dat").is_file() {
    bail!("{} is not a Minecraft world folder", args.path.display());
}
let level = reader.read_world_info(&args.path)?;
Defensive patterns

Strategy: validation

Validate before calling

fn ensure_world_folder(path: &Path) -> Result<(), String> {
    if !path.join("level.dat").is_file() {
        if path.join("level.dat_old").is_file() {
            std::fs::copy(path.join("level.dat_old"), path.join("level.dat")).map_err(|e| e.to_string())?;
        } else {
            return Err(format!("{} has no level.dat; not a world folder", path.display()));
        }
    }
    Ok(())
}

Type guard

fn is_world_dir(path: &Path) -> bool {
    path.join("level.dat").is_file() || path.join("level.dat_old").is_file()
}

Try / catch

match reader.read_world_info(&path) {
    Err(WorldInfoError::InfoNotFound) => {
        eprintln!("no world info at {} — creating a new world", path.display());
        create_fresh_world(&path)?;
    }
    other => { other?; }
}

Prevention

When it happens

Trigger: WorldInfoReader::read_world_info is called on a directory that has no level.dat and no readable level.dat_old (e.g. an empty or wrong folder passed as the world path, or both files failed to load).

Common situations: Pointing the server at the wrong directory (parent folder instead of the world folder); a world folder that was created but never initialized; a wiped/corrupted world directory where both level.dat and level.dat_old were deleted.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of Pumpkin-MC/Pumpkin@8d4639e25a (2026-09-09). Data as JSON: /api/errors/5d081721d39d3c07. Report an issue: GitHub.

Appendix: source

Thrown at crates/pumpkin-world/src/world_info/mod.rs:365

    ) -> Self {
        let mut data = Self::default(seed);
        let spawn_pos = generator.find_spawn_position();
        data.spawn_x = spawn_pos.0.x;
        data.spawn_z = spawn_pos.0.z;
        data
    }

    pub const fn set_pos(&mut self, x: i32, z: i32) {
        self.spawn_x = x;
        self.spawn_z = z;
    }
}

#[derive(Error, Debug)]
pub enum WorldInfoError {
    #[error("Io error: {0}")]
    IoError(std::io::ErrorKind),
    #[error("Info not found!")]
    InfoNotFound,
    #[error("Deserialization error: {0}")]
    DeserializationError(String),
    #[error(
        "No world seed found: neither level.dat nor data/minecraft/world_gen_settings.dat contains one"
    )]
    MissingWorldSeed,
    #[error("Serialization error: {0}")]
    SerializationError(String),
    #[error("Unsupported world data version: {0}")]
    UnsupportedDataVersion(i32),
    #[error("Unsupported world level version: {0}")]
    UnsupportedLevelVersion(i32),
}

impl From<std::io::Error> for WorldInfoError {
    fn from(value: std::io::Error) -> Self {
        match value.kind() {

View on GitHub (pinned to 8d4639e25a)