{"id":"2007b838a0a096f1","repo":"spring-projects/spring-boot","slug":"file-file-is-not-readable","errorCode":null,"errorMessage":"File '${file}' is not readable","messagePattern":"File '(.+?)' is not readable","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchive.java","lineNumber":83,"sourceCode":"\tpublic void writeTo(OutputStream outputStream) throws IOException {\n\t\tTarArchiveOutputStream tar = new TarArchiveOutputStream(outputStream);\n\t\ttar.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);\n\t\ttry (ZipFile zipFile = ZipFile.builder().setFile(this.zip).get()) {\n\t\t\tEnumeration<ZipArchiveEntry> entries = zipFile.getEntries();\n\t\t\twhile (entries.hasMoreElements()) {\n\t\t\t\tZipArchiveEntry zipEntry = entries.nextElement();\n\t\t\t\tcopy(zipEntry, zipFile.getInputStream(zipEntry), tar);\n\t\t\t}\n\t\t}\n\t\ttar.finish();\n\t}\n\n\tprivate void assertArchiveHasEntries(File file) {\n\t\ttry (ZipFile zipFile = ZipFile.builder().setFile(file).get()) {\n\t\t\tAssert.state(zipFile.getEntries().hasMoreElements(), () -> \"Archive file '\" + file + \"' is not valid\");\n\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tthrow new IllegalStateException(\"File '\" + file + \"' is not readable\", ex);\n\t\t}\n\t}\n\n\tprivate void copy(ZipArchiveEntry zipEntry, InputStream zip, TarArchiveOutputStream tar) throws IOException {\n\t\tTarArchiveEntry tarEntry = convert(zipEntry);\n\t\ttar.putArchiveEntry(tarEntry);\n\t\tif (tarEntry.isFile()) {\n\t\t\tStreamUtils.copyRange(zip, tar, 0, tarEntry.getSize());\n\t\t}\n\t\ttar.closeArchiveEntry();\n\t}\n\n\tprivate TarArchiveEntry convert(ZipArchiveEntry zipEntry) {\n\t\tbyte linkFlag = (zipEntry.isDirectory()) ? TarConstants.LF_DIR : TarConstants.LF_NORMAL;\n\t\tString entryName = zipEntry.getName();\n\t\tPath entryPath = Path.of(entryName);\n\t\tAssert.state(entryPath.toAbsolutePath().equals(entryPath.toAbsolutePath().normalize()),\n\t\t\t\t() -> \"Malformed zip entry name '%s'\".formatted(entryName));","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/5b2dbdbb8be64415eb6552f81ff7c449c8d251e6/buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchive.java#L65-L101","documentation":"Error \"File '${file}' is not readable\" thrown in spring-projects/spring-boot.","triggerScenarios":"Thrown at buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchive.java:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"5b2dbdbb8be64415eb6552f81ff7c449c8d251e6","analyzedAt":"2026-08-04T18:53:14.967Z","schemaVersion":2}