louis-e/arnis · error · BedrockSaveError
'{}' already exists and was not created by Arnis. Rename or
Error message
'{}' already exists and was not created by Arnis. Rename or move it, or choose a different Bedrock save path. What it means
When generating a Bedrock world, prepare_output_dir prepares the staging/output directory. If the directory already exists but is not recognized as an Arnis staging directory (is_arnis_staging_dir returns false), it refuses to touch it and returns BedrockSaveError::Io with ErrorKind::AlreadyExists and this message — protecting user data (a real save or unrelated folder) from being overwritten. Callers write_world and parallel_chunk_encode_writes_expected_records propagate this error.
Source
Thrown at src/world_editor/bedrock.rs:219
emit_gui_progress_update(92.0, "Saving Bedrock world...");
self.write_chunks_to_db(world)?;
emit_gui_progress_update(97.0, "Saving Bedrock world...");
self.write_metadata(world, xzbbox, llbbox)?;
emit_gui_progress_update(98.0, "Saving Bedrock world...");
self.package_mcworld()?;
emit_gui_progress_update(99.0, "Saving Bedrock world...");
self.cleanup_temp_dir()?;
Ok(())
}
/// Prepares the staging directory, reusing leftovers but never deleting foreign data.
fn prepare_output_dir(&self) -> Result<(), BedrockSaveError> {
if self.output_dir.exists() {
if !is_arnis_staging_dir(&self.output_dir) {
return Err(BedrockSaveError::Io(std::io::Error::new(
std::io::ErrorKind::AlreadyExists,
format!(
"'{}' already exists and was not created by Arnis. \
Rename or move it, or choose a different Bedrock save path.",
self.output_dir.display()
),
)));
}
fs::remove_dir_all(&self.output_dir)?;
}
if self.mcworld_path.exists() {
fs::remove_file(&self.mcworld_path)?;
}
fs::create_dir_all(&self.output_dir)?;
fs::write(self.output_dir.join(STAGING_MARKER), b"")?;
// db directory will be created by LevelDB
Ok(())View on GitHub (pinned to 34048924d9)
Solutions
- Pick a different output directory or rename the target path before generating
- Manually move/rename or delete the existing directory if you are sure it is not needed (back up real saves first)
- If the directory is a leftover from a crashed Arnis run whose marker was lost, move it aside manually — Arnis will never delete foreign-looking data itself
- Check the path for typos (e.g. pointing at minecraftWorlds instead of a fresh folder)
- Re-run generation after clearing the path; if it's a previous Arnis output you want to overwrite, remove the whole staging directory
Example fix
// before: output points at an existing world output_dir = "/home/user/.minecraft/com.mojang/minecraftWorlds/MyWorld" // after: use a fresh, non-existent path output_dir = "/home/user/.minecraft/com.mojang/minecraftWorlds/arnis-city-2026-09-03"
Defensive patterns
Strategy: validation
Validate before calling
fn output_path_is_free(dir: &std::path::Path) -> Result<(), String> {
if dir.exists() {
Err(format!(
"'{}' already exists — rename/move it or pick another Bedrock save path",
dir.display()
))
} else { Ok(()) }
}
// call before invoking write_world / generation Try / catch
match editor.write_world() {
Ok(()) => println!("World written"),
Err(BedrockSaveError::Io(e)) if e.kind() == std::io::ErrorKind::AlreadyExists => {
eprintln!("Target exists and is not an Arnis staging dir: {e}");
// prompt user for a different path, do not delete anything
}
Err(e) => eprintln!("Bedrock export failed: {e}"),
} Prevention
- Check output_dir.exists() in the UI before starting generation and ask for a new path
- Never point output at an existing minecraftWorlds/<save> directory
- Don't delete Arnis marker files from previous staging dirs if you want them reused
- Back up real Bedrock saves before any export; Arnis will never delete foreign data for you
- Use timestamped output directory names to avoid collisions between runs
When it happens
Trigger: Calling write_world with an output_dir path that already exists on disk and was not created by Arnis — e.g. pointing at an existing Minecraft Bedrock save folder, an existing world you exported before with another tool, or any leftover directory lacking Arnis's staging marker.
Common situations: Choosing the same Bedrock save path as an existing world in the GUI; re-running generation after a partially deleted previous run where the Arnis marker file was removed; pointing output at a directory like Minecraft's com.mojang/minecraftWorlds/<existing world>; two generation runs racing on the same path.
Related errors
- select_level_for_cell_size called with empty levels
- Failed to get main window
- Error while starting the application UI (Tauri)
- Failed to fetch data
- Error in defining coordinate transformation: {e}
AI-assisted analysis of louis-e/arnis@34048924d9 (2026-09-03).
Data as JSON: /api/errors/b77ebdfeb18fbfda.
Report an issue: GitHub.