{"record":{"id":"d2672343853b2858","repo":"quarkusio/quarkus","slug":"failed-to-load-codestart-spec-resourcename","errorCode":null,"errorMessage":"Failed to load codestart spec: + resourceName","messagePattern":"Failed to load codestart spec: \\+ resourceName","errorType":"exception","errorClass":"CodestartStructureException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartCatalogLoader.java","lineNumber":95,"sourceCode":"        try {\n            return pathLoader.loadResourceAsPath(directoryName,\n                    path -> {\n                        try (final Stream<Path> pathStream = Files.walk(path)) {\n                            return pathStream\n                                    .filter(p -> p.getFileName().toString().matches(\"codestart\\\\.yml$\"))\n                                    .map(p -> {\n                                        final String resourceName = resolveResourceName(directoryName, path, p);\n                                        try {\n                                            final CodestartSpec spec = readCodestartSpec(new String(Files.readAllBytes(p)));\n                                            final String resourceCodestartDirectory = resourceName.replaceAll(\n                                                    \"/?codestart\\\\.yml\",\n                                                    \"\");\n                                            return new Codestart(\n                                                    new PathCodestartResourceAllocator(pathLoader, resourceCodestartDirectory),\n                                                    spec,\n                                                    resolveImplementedLanguages(p.getParent()));\n                                        } catch (IOException | tools.jackson.core.JacksonException e) {\n                                            throw new CodestartStructureException(\n                                                    \"Failed to load codestart spec: \" + resourceName,\n                                                    e);\n                                        }\n                                    }).collect(Collectors.toList());\n                        }\n                    });\n        } catch (IOException e) {\n            return Collections.emptyList();\n        }\n    }\n\n    private static Set<String> resolveImplementedLanguages(Path p) throws IOException {\n        // empty means all\n        try (final Stream<Path> files = Files.list(p)) {\n            return files\n                    .filter(Files::isDirectory)\n                    .map(CodestartCatalogLoader::getDirName)\n                    .filter(l -> !Objects.equals(l, BASE_LANGUAGE))","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartCatalogLoader.java#L77-L113","documentation":"CodestartCatalogLoader.loadCodestarts() wraps IOException and JacksonException when parsing a codestart spec file (codestart.yml) into a CodestartStructureException('Failed to load codestart spec: <resourceName>'). It signals a malformed or unreadable codestart definition in a codestarts directory or jar resource.","triggerScenarios":"A codestart spec YAML under a loaded codestarts directory cannot be read (IOException) or fails Jackson deserialization (JacksonException) — e.g. invalid YAML syntax, wrong schema fields, or a missing/corrupt resource on the classpath.","commonSituations":"Custom codestarts added to a project with YAML typos; wrong spec structure after a Quarkus version change; corrupted jar packaging of custom codestart resources.","solutions":["Validate the codestart.yml syntax (run it through a YAML parser) and fix parse errors.","Check the spec against the expected Codestart schema (name, type, language, required fields).","Verify the resource is correctly packaged and its path/name matches what the catalog loader expects."],"exampleFix":"# before (codestart.yml)\nname: my-codstart\ntype: project  # unknown enum/typo breaks Jackson\n# after\nname: my-codestart\ntype: project","handlingStrategy":"validation","validationCode":"// validate codestart.yml before packaging\ntry (var in = Files.newInputStream(specPath)) {\n    new org.yaml.snakeyaml.Yaml().load(in); // syntax check\n} catch (IOException | org.yaml.snakeyaml.error.YAMLException e) {\n    throw new IllegalStateException(\"Invalid codestart spec: \" + specPath, e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    catalog = CodestartCatalogLoader.loadCodestarts(dir, ...);\n} catch (CodestartStructureException e) {\n    if (e.getMessage().startsWith(\"Failed to load codestart spec\")) {\n        logger.error(\"Fix codestart.yml: \" + e.getCause());\n    }\n    throw e;\n}","preventionTips":["Lint custom codestart.yml files in CI (YAML parse + schema check).","Keep codestart specs matching the Quarkus version's expected schema.","Verify resources are packaged in the jar (check built artifact contents)."],"tags":["codestart","yaml","deserialization","classpath"],"backgroundTag":"codestart-spec-load-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}