xpipe-io/xpipe · error · ValidationException
valueMustNotBeEmpty
Error message
valueMustNotBeEmpty
What it means
ScriptStore.checkComplete() enforces that a script store actually contains something. After delegating to the text source, it throws ValidationException(AppI18n.get("valueMustNotBeEmpty")) when none of initScript, shellScript, fileScript, or runnableScript are set — i.e. the store is empty and defines no script content of any kind.
Source
Thrown at ext/base/src/main/java/io/xpipe/ext/base/script/ScriptStore.java:127
return ShellScript.of(content);
}
@Override
public List<DataStoreEntryRef<?>> getDependencies() {
var l = DataStoreDependencies.of(scripts);
if (textSource != null) {
l.addAll(textSource.getDependencies());
}
return l;
}
@Override
public void checkComplete() throws Throwable {
if (textSource != null) {
textSource.checkComplete();
}
if (!initScript && !shellScript && !fileScript && !runnableScript) {
throw new ValidationException(AppI18n.get("valueMustNotBeEmpty"));
}
if (scripts != null) {
Validators.contentNonNull(scripts);
for (DataStoreEntryRef<ScriptStore> script : scripts) {
Validators.nonNull(script);
Validators.isType(script, ScriptStore.class);
}
}
}
public void queryFlattenedScripts(LinkedHashSet<DataStoreEntryRef<ScriptStore>> all) {
DataStoreEntryRef<ScriptStore> ref = getSelfEntry().ref();
var added = all.add(ref);
// Prevent loop
if (added) {
getEffectiveScripts().stream()
.filter(scriptStoreDataStoreEntryRef -> !all.contains(scriptStoreDataStoreEntryRef))
.forEach(scriptStoreDataStoreEntryRef -> {View on GitHub (pinned to d85ca821ba)
Solutions
- Set one of the script content modes: provide shell script text, a script file, mark it as an init script, or make it runnable
- Delete the empty script store if it is not needed
- Ensure the textSource content was actually persisted before saving
Example fix
// before var store = new ScriptStore(null, null, false, false, false, false, null); // after var store = new ScriptStore(null, textSource, false, false, false, true, null); // runnable script with content
Defensive patterns
Strategy: validation
Validate before calling
boolean hasContent = initScript || shellScript || fileScript || runnableScript;
if (!hasContent) { /* require content before saving the ScriptStore */ } Try / catch
try { store.checkComplete(); }
catch (ValidationException e) { /* treat as empty script: prompt user for content */ } Prevention
- Never create a script store without entering content or a file
- Validate before persisting stores
When it happens
Trigger: Saving/validating a ScriptStore with all four content modes null/false: no init script, no shell script content, no script file, and not marked runnable.
Common situations: User creates a script entry but never types content or picks a file; a store whose textSource was cleared in an editor; importing/pasting a store definition that lost its content.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Cannot delete category: " + cat.getName()
- Not a toggleable connection
- Directory is a root
- Principal ${name} is not accessible
- Name is empty
AI-assisted analysis of xpipe-io/xpipe@d85ca821ba (2026-09-06).
Data as JSON: /api/errors/ac5f8f638d395b4f.
Report an issue: GitHub.