Better error message when instance.volumes does not specify the accumulo directory (#1921)
diff --git a/core/src/main/java/org/apache/accumulo/core/volume/VolumeImpl.java b/core/src/main/java/org/apache/accumulo/core/volume/VolumeImpl.java
index 0c8dd87..78cb026 100644
--- a/core/src/main/java/org/apache/accumulo/core/volume/VolumeImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/volume/VolumeImpl.java
@@ -124,6 +124,13 @@
String p = requireNonNull(pathString).strip();
p = p.startsWith("/") ? p.substring(1) : p;
String reason;
+ if (basePath.isBlank()) {
+ log.error("Basepath is empty. Make sure instance.volumes is set to a correct path");
+ throw new IllegalArgumentException(
+ "Accumulo cannot be initialized because basepath is empty. "
+ + "This probably means instace.volumes is an incorrect value");
+ }
+
if (p.isBlank()) {
return fs.makeQualified(new Path(basePath));
} else if (p.startsWith("/")) {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java
index dffc151..fec7a00 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java
@@ -205,7 +205,7 @@
}
log.debug("Trying to read instance id from {}", instanceDirectory);
if (files == null || files.length == 0) {
- log.error("unable obtain instance id at {}", instanceDirectory);
+ log.error("unable to obtain instance id at {}", instanceDirectory);
throw new RuntimeException(
"Accumulo not initialized, there is no instance id at " + instanceDirectory);
} else if (files.length != 1) {