xpipe-io/xpipe · error · ValidationException
${invalidPathMessage}
Error message
${invalidPathMessage} What it means
ScriptCollectionSource.checkComplete() requires a non-null path and verifies it can be converted to a valid local file path. If path.toLocalAbsoluteFilePath().asLocalPath() throws InvalidPathException, the underlying exception message is rethrown as a ValidationException (the "${invalidPathMessage}" is the platform-specific InvalidPathException message).
Source
Thrown at ext/base/src/main/java/io/xpipe/ext/base/script/ScriptCollectionSource.java:79
entry -> DataStorage.get().local().equals(entry),
true),
path)
.nonNull()
.bind(
() -> Directory.builder()
.path(path.get() != null ? ContextualFileReference.of(path.get()) : null)
.build(),
property);
}
@Override
public void checkComplete() throws ValidationException {
Validators.nonNull(path);
// Check if path is invalid
try {
path.toLocalAbsoluteFilePath().asLocalPath();
} catch (InvalidPathException e) {
throw new ValidationException(e.getMessage());
}
}
@Override
public void prepare() {
if (!Files.isDirectory(getLocalPath())) {
throw ErrorEventFactory.expected(
new IllegalStateException("Source directory " + path + " does not exist"));
}
}
@Override
public Path getLocalPath() {
return path.toLocalAbsoluteFilePath().asLocalPath();
}
@Override
public String toSummary() {View on GitHub (pinned to d85ca821ba)
Solutions
- Correct the path in the script source so it is a syntactically valid local path for the current OS
- Use an absolute path without illegal characters
- Verify the path converts with java.nio.file.Path.of(value) before saving
- On Windows, ensure drive letters and separators are correct (C:\\scripts\\...)
Example fix
// before
source.setPath(FilePath.of("~/scripts/:foo")); // invalid on Windows
// after
source.setPath(FilePath.of("C:\\Users\\me\\scripts\\deploy")); Defensive patterns
Strategy: validation
Validate before calling
try {
java.nio.file.Path.of(pathValue);
} catch (java.nio.file.InvalidPathException e) {
// reject the path before calling checkComplete()
} Try / catch
try { source.checkComplete(); }
catch (ValidationException e) {
// show e.getMessage() (InvalidPathException text) to the user
} Prevention
- Validate paths with java.nio.file.Path.of before saving
- Avoid OS-illegal characters in script paths
- Prefer absolute paths
When it happens
Trigger: Calling checkComplete() on a script collection source whose path field is set to a string that the local filesystem provider rejects as a path (illegal characters, wrong syntax, or path containing null/invalid chars).
Common situations: Windows-illegal characters (<>|:?*") in a script path entered by the user; Unix-style paths pasted on Windows or vice versa; environment-variable expansion producing a malformed path; empty or whitespace-only path segments.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- Directory is a root
- Separator character ${SEPARATOR} is not allowed in the names
- Cannot delete category: " + cat.getName()
- Path ${path} does not exist
- Not a toggleable connection
AI-assisted analysis of xpipe-io/xpipe@d85ca821ba (2026-09-06).
Data as JSON: /api/errors/151a1bc2191fffc0.
Report an issue: GitHub.