{"record":{"id":"25c35ae652bbf0fb","repo":"quarkusio/quarkus","slug":"failed-to-read-s","errorCode":null,"errorMessage":"Failed to read %s","messagePattern":"Failed to read (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java","lineNumber":324,"sourceCode":"                sb.append(System.lineSeparator());\n                for (String s : missingService.getValue()) {\n                    sb.append(\"- \").append(s);\n                }\n            }\n            log.warn(sb.toString());\n\n            final Map<String, List<String>> allConfigServices = new HashMap<>(unavailableConfigServices.size());\n            final Map<String, byte[]> allowedConfigServices = new HashMap<>(unavailableConfigServices.size());\n            final Map<String, byte[]> bannedConfigServices = new HashMap<>(unavailableConfigServices.size());\n            for (Map.Entry<String, List<String>> appModuleServices : unavailableConfigServices.entrySet()) {\n                final String service = appModuleServices.getKey();\n                try {\n                    ClassPathUtils.consumeAsPaths(deploymentClassLoader, service, p -> {\n                        try {\n                            allConfigServices.computeIfAbsent(service, k -> new ArrayList<>())\n                                    .addAll(Files.readAllLines(p));\n                        } catch (IOException e) {\n                            throw new UncheckedIOException(\"Failed to read \" + p, e);\n                        }\n                    });\n                } catch (IOException e) {\n                    throw new CodeGenException(\"Failed to read resources from classpath\", e);\n                }\n                final List<String> allServices = allConfigServices.getOrDefault(service, new ArrayList<>());\n                allServices.removeAll(appModuleServices.getValue());\n                if (allServices.isEmpty()) {\n                    bannedConfigServices.put(service, new byte[0]);\n                } else {\n                    final StringJoiner joiner = new StringJoiner(System.lineSeparator());\n                    allServices.forEach(joiner::add);\n                    allowedConfigServices.put(service, joiner.toString().getBytes());\n                }\n            }\n\n            // we don't want to load config services from the current module because they haven't been compiled yet\n            final QuarkusClassLoader.Builder configClBuilder = QuarkusClassLoader.builder(\"CodeGenerator Config ClassLoader\",","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java#L306-L342","documentation":"An UncheckedIOException thrown inside readConfig while reading a META-INF/services configuration service file from the deployment classpath via ClassPathUtils.consumeAsPaths. Files.readAllLines on a resolved service-file path failed with an IOException, so the resource exists on the classpath but cannot be read. The UncheckedIOException propagates and aborts configuration initialization for code generation.","triggerScenarios":"During readConfig, when unavailable config services were detected, each service file listed on the deployment classpath is read with Files.readAllLines(p); an IOException (I/O error, permission problem, broken jar entry) while reading path p produces 'Failed to read <p>'.","commonSituations":"Corrupted or partially downloaded jar in the local Maven/Gradle cache; file permission issues on the build machine; disk full; antivirus locking jar files on Windows; build running against a jar that was overwritten mid-build.","solutions":["Identify the jar/file in the message, delete it from the local repository (or target/ dir) and rebuild so it is re-downloaded/re-created","Check file permissions and that the build process can read the file path in the message","Check disk space and antivirus/locking software that may block jar reads","Run a clean build to regenerate all build artifacts"],"exampleFix":"# before\nrm ~/.m2/repository/com/example/broken-artifact/1.0/broken-artifact-1.0.jar  # corrupt jar\nmvn quarkus:build\n# after: Maven re-downloads a good copy\nmvn clean quarkus:build","handlingStrategy":"validation","validationCode":"// Pre-check that all config service files on the classpath are readable\nfor (URL u : Collections.list(cl.getResources(\"META-INF/services/io.quarkus.runtime.configuration.ConfigSource\"))) {\n    Path p = Paths.get(u.toURI());\n    if (!Files.isReadable(p)) throw new IllegalStateException(\"Unreadable service file: \" + p);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the local repository clean; use -U to refresh suspicious artifacts","Avoid antivirus tools locking jar files during builds on Windows","Ensure sufficient disk space on build machines","Don't mutate jars (deploy/install) while a build is running"],"tags":["quarkus","io","classpath","service-files"],"backgroundTag":"unreadable-classpath-resource","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}