{"record":{"id":"2bfd2e696fe34105","repo":"elastic/elasticsearch","slug":"io-problem-while-reading-files-with-api-signatures","errorCode":null,"errorMessage":"IO problem while reading files with API signatures.","messagePattern":"IO problem while reading files with API signatures\\.","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/CheckForbiddenApisTask.java","lineNumber":517,"sourceCode":"                        for (String bs : bundledSignatures) {\n                            checker.addBundledSignatures(bs, bundledSigsJavaVersion);\n                        }\n                    }\n\n                    final FileCollection signaturesFiles = getParameters().getSignaturesFiles();\n                    if (signaturesFiles != null) for (final File f : signaturesFiles) {\n                        checker.parseSignaturesFile(f);\n                    }\n                    final List<String> signatures = getParameters().getSignatures().get();\n                    if ((signatures != null) && !signatures.isEmpty()) {\n                        final StringBuilder sb = new StringBuilder();\n                        for (String line : signatures) {\n                            sb.append(line).append(NL);\n                        }\n                        checker.parseSignaturesString(sb.toString());\n                    }\n                } catch (IOException ioe) {\n                    throw new GradleException(\"IO problem while reading files with API signatures.\", ioe);\n                } catch (ParseException pe) {\n                    throw new InvalidUserDataException(\"Parsing signatures failed: \" + pe.getMessage(), pe);\n                }\n\n                if (checker.hasNoSignatures()) {\n                    if (checker.noSignaturesFilesParsed()) {\n                        throw new InvalidUserDataException(\n                            \"No signatures were added to task; use properties 'signatures', 'bundledSignatures', 'signaturesURLs', and/or 'signaturesFiles' to define those!\"\n                        );\n                    } else {\n                        logger.info(\"Skipping execution because no API signatures are available.\");\n                        return;\n                    }\n                }\n\n                try {\n                    checker.addClassesToCheck(getParameters().getClassFiles());\n                } catch (IOException ioe) {","sourceCodeStart":499,"sourceCodeEnd":535,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/CheckForbiddenApisTask.java#L499-L535","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run the task with --info and inspect the wrapped IOException for the failing file path.","Confirm every file in signaturesFiles exists on disk at execution time (it should be a task output or a checked-in resource).","Ensure any generated signature file is declared as an input dependency so it is produced before this task runs.","Fix permissions / re-checkout the file if it is corrupted."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// At configuration time, assert every signatures file exists\ngetSignaturesFiles().forEach(f -> {\n    if (!f.isFile()) throw new InvalidUserDataException(\"Signatures file missing: \" + f);\n});","typeGuard":null,"tryCatchPattern":"try {\n    // parse signatures\n} catch (GradleException e) {\n    if (e.getMessage().contains(\"IO problem while reading files with API signatures\")) {\n        // inspect cause IOException for the path, regenerate the file, then re-run\n    }\n    throw e;\n}","preventionTips":["Generate signature files from tasks declared as inputs so they exist before this task runs.","Check in signature resources rather than referencing generated paths unless wired correctly.","Use --info to see the wrapped IOException path."],"tags":["gradle","forbidden-apis","precommit","io","signatures"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:17:08.281Z"}