elastic/elasticsearch · error · InvalidUserDataException
No signatures were added to task; use properties 'signatures
Error message
No signatures were added to task; use properties 'signatures', 'bundledSignatures', 'signaturesURLs', and/or 'signaturesFiles' to define those!
What it means
Thrown after signature parsing when checker.hasNoSignatures() is true AND checker.noSignaturesFilesParsed() — meaning the task was configured with no signature sources at all (no 'signatures', 'bundledSignatures', 'signaturesURLs', or 'signaturesFiles'). The task refuses to run because a forbidden-apis check with zero rules would silently pass on everything, hiding violations.
Source
Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/CheckForbiddenApisTask.java:524
checker.parseSignaturesFile(f);
}
final List<String> signatures = getParameters().getSignatures().get();
if ((signatures != null) && !signatures.isEmpty()) {
final StringBuilder sb = new StringBuilder();
for (String line : signatures) {
sb.append(line).append(NL);
}
checker.parseSignaturesString(sb.toString());
}
} catch (IOException ioe) {
throw new GradleException("IO problem while reading files with API signatures.", ioe);
} catch (ParseException pe) {
throw new InvalidUserDataException("Parsing signatures failed: " + pe.getMessage(), pe);
}
if (checker.hasNoSignatures()) {
if (checker.noSignaturesFilesParsed()) {
throw new InvalidUserDataException(
"No signatures were added to task; use properties 'signatures', 'bundledSignatures', 'signaturesURLs', and/or 'signaturesFiles' to define those!"
);
} else {
logger.info("Skipping execution because no API signatures are available.");
return;
}
}
try {
checker.addClassesToCheck(getParameters().getClassFiles());
} catch (IOException ioe) {
throw new GradleException("Failed to load one of the given class files.", ioe);
}
checker.run();
writeMarker(getParameters().getSuccessMarker().getAsFile().get());
} catch (ForbiddenApiException e) {
throw new VerificationException("Forbidden API verification failed", e);
} catch (Exception e) {View on GitHub (pinned to db6a809a66)
Solutions
- Add at least one signature source, most commonly bundledSignatures: task.bundledSignatures = ['jdk-system-out', 'jdk-unsafe'].
- Or add signaturesFiles / signatures / signaturesURLs as appropriate.
- If the task is intentionally a no-op, remove the task registration rather than leaving an empty one.
Example fix
// before
tasks.named('forbiddenApisMain', CheckForbiddenApisTask) {
// no signatures
}
// after
tasks.named('forbiddenApisMain', CheckForbiddenApisTask) {
bundledSignatures = ['jdk-system-out', 'jdk-unsafe', 'jdk-deprecated']
} Defensive patterns
Strategy: validation
Validate before calling
// Assert at configuration time that at least one signature source is set
boolean hasAny = (bundledSignatures != null && !bundledSignatures.isEmpty())
|| (signatures != null && !signatures.isEmpty())
|| (signaturesFiles != null && !signaturesFiles.isEmpty())
|| (signaturesURLs != null && !signaturesURLs.isEmpty());
if (!hasAny) throw new InvalidUserDataException("forbidden-apis task needs at least one signature source"); Prevention
- Always set bundledSignatures when registering a forbidden-apis task.
- Delete rather than empty-out an unused forbidden-apis task.
- Review task registrations during refactor to confirm signature wiring survives.
When it happens
Trigger: A CheckForbiddenApisTask registration where none of the four signature-supplying properties were set, or all were set to empty.
Common situations: Registering a forbidden-apis task as a placeholder and forgetting to add bundledSignatures; a refactor that removed the signatures block; copying a task config and dropping the bundledSignatures line.
Related errors
- IO problem while reading files with API signatures.
- Parsing signatures failed: {}
- Missing 'classesDirs' or 'classpath' property.
- Failed to load one of the given class files.
- Forbidden API verification failed
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/73b81b68995b2dfa.
Report an issue: GitHub.