EngineHub/WorldGuard

StorageException: Failed to rename temporary regions file to

MarvinKlar opened this issue · 1 comments

WorldEdit Version

7.2.6

WorldGuard Version

7.0.6

Platform Version

git-Paper-84 (MC: 1.17.1)

Confirmations

  • I am using the most recent Minecraft release.
  • I am using a version of WorldEdit compatible with my Minecraft version.
  • I am using a version of WorldGuard compatible with my Minecraft version.
  • I am using the latest or recommended version of my platform software.
  • I am NOT using a hybrid server, e.g. a server that combines Bukkit and Forge. Examples include Arclight, Mohist, and Cardboard.
  • I am NOT using a fork of WorldEdit, such as FastAsyncWorldEdit (FAWE) or AsyncWorldEdit (AWE)

Bug Description

I encountered the following error when creating a region via WorldGuard API: https://pastebin.com/njpTDw8h

The code I used was:

import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;

[...]

            BlockVector3 upperLimit = BlockVector3
                    .at(location.getBlockX() + regionRadius, location.getBlockY() + regionRadius,
                            location.getBlockZ() + regionRadius);
            BlockVector3 lowerLimit = BlockVector3
                    .at(location.getBlockX() - regionRadius, location.getBlockY() - regionRadius,
                            location.getBlockZ() - regionRadius);
            regionContainer.addRegion(new ProtectedCuboidRegion(regionName, upperLimit, lowerLimit));
            try {
                regionContainer.saveChanges();
            } catch (Exception e) {
                Bukkit.getLogger().log(Level.SEVERE, "Unable to save region '" + regionName + "'!", e);
            }

Expected Behavior

I expect this error not to occour and the region to be saved.

Reproduction Steps

  1. Install WorldGuard and execute the mentioned code. This error does occour sporadically.

Optional WorldGuard-Report

No response

Anything Else?

No response

You shouldn't save the regions yourself. WorldGuard already performs the save process periodically in an async thread. You shouldn't do that in your sync thread. Just add the region to the regionContainer and you're done.