elastic/elasticsearch · error · GradleException

IO problem while reading files with API signatures.

Error message

IO problem while reading files with API signatures.

What it means

Thrown by CheckForbiddenApisTask while parsing/reading API signature sources (signaturesFiles and inline signatures) when an IOException bubbles up from checker.parseSignaturesFile or reading the bundled signatures. The forbidden-apis checker could not physically read one of the supplied signature files.

Source

Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/CheckForbiddenApisTask.java:517

                        for (String bs : bundledSignatures) {
                            checker.addBundledSignatures(bs, bundledSigsJavaVersion);
                        }
                    }

                    final FileCollection signaturesFiles = getParameters().getSignaturesFiles();
                    if (signaturesFiles != null) for (final File f : signaturesFiles) {
                        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) {

View on GitHub (pinned to db6a809a66)

Solutions

  1. Run the task with --info and inspect the wrapped IOException for the failing file path.
  2. Confirm every file in signaturesFiles exists on disk at execution time (it should be a task output or a checked-in resource).
  3. Ensure any generated signature file is declared as an input dependency so it is produced before this task runs.
  4. Fix permissions / re-checkout the file if it is corrupted.
Defensive patterns

Strategy: validation

Validate before calling

// At configuration time, assert every signatures file exists
getSignaturesFiles().forEach(f -> {
    if (!f.isFile()) throw new InvalidUserDataException("Signatures file missing: " + f);
});

Try / catch

try {
    // parse signatures
} catch (GradleException e) {
    if (e.getMessage().contains("IO problem while reading files with API signatures")) {
        // inspect cause IOException for the path, regenerate the file, then re-run
    }
    throw e;
}

Prevention

When it happens

Trigger: A signaturesFiles entry that does not exist or is unreadable, or an IO error (permissions, disk) while reading a signatures file or URL passed to the checker.

Common situations: Pointing signaturesFiles at a file that was deleted or never generated; a generated signatures file whose producing task did not run; a checked-in resource with wrong line endings/encoding that triggers a reader fault; file-system permission issues in CI.

Related errors


AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12). Data as JSON: /api/errors/2bfd2e696fe34105. Report an issue: GitHub.