{"record":{"id":"6293ae007331eef2","repo":"spring-projects/spring-boot","slug":"no-project-type-with-id-check-the-service-c","errorCode":null,"errorMessage":"No project type with id '{}' - check the service capabilities (--list)","messagePattern":"No project type with id '(.+?)' - check the service capabilities \\(--list\\)","errorType":"exception","errorClass":"ReportableException","httpStatus":null,"severity":"error","filePath":"cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java","lineNumber":368,"sourceCode":"\t\t\tif (this.language != null) {\n\t\t\t\tbuilder.setParameter(\"language\", this.language);\n\t\t\t}\n\t\t\tif (this.bootVersion != null) {\n\t\t\t\tbuilder.setParameter(\"bootVersion\", this.bootVersion);\n\t\t\t}\n\n\t\t\treturn builder.build();\n\t\t}\n\t\tcatch (URISyntaxException ex) {\n\t\t\tthrow new ReportableException(\"Invalid service URL (\" + ex.getMessage() + \")\");\n\t\t}\n\t}\n\n\tprotected ProjectType determineProjectType(InitializrServiceMetadata metadata) {\n\t\tif (this.type != null) {\n\t\t\tProjectType result = metadata.getProjectTypes().get(this.type);\n\t\t\tif (result == null) {\n\t\t\t\tthrow new ReportableException(\n\t\t\t\t\t\t(\"No project type with id '\" + this.type + \"' - check the service capabilities (--list)\"));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse if (isDetectType()) {\n\t\t\tMap<String, ProjectType> types = new HashMap<>(metadata.getProjectTypes());\n\t\t\tif (this.build != null) {\n\t\t\t\tfilter(types, \"build\", this.build);\n\t\t\t}\n\t\t\tif (this.format != null) {\n\t\t\t\tfilter(types, \"format\", this.format);\n\t\t\t}\n\t\t\tif (types.size() == 1) {\n\t\t\t\treturn types.values().iterator().next();\n\t\t\t}\n\t\t\telse if (types.isEmpty()) {\n\t\t\t\tthrow new ReportableException(\"No type found with build '\" + this.build + \"' and format '\" + this.format\n\t\t\t\t\t\t+ \"' check the service capabilities (--list)\");","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java#L350-L386","documentation":"Thrown by ProjectGenerationRequest.determineProjectType when --type is set but its id is absent from the server's project-type metadata. The metadata's projectTypes map is keyed by type id; a miss is fatal because the requested type cannot be honored.","triggerScenarios":"Running 'spring init --type foo' where 'foo' is not among the server's advertised type ids.","commonSituations":"Typo in --type; the server version changed or removed a type; an outdated CLI assuming a type id that a newer server no longer exposes.","solutions":["Run 'spring init --list' to see valid type ids","Correct the --type value to match an advertised id","Upgrade the CLI to match the server's available types"],"exampleFix":"// before\n$ spring init --type foobar\n// after\n$ spring init --type maven-project  # per --list output","handlingStrategy":"validation","validationCode":"// Resolve the type against metadata before requesting generation.\nInitializrServiceMetadata md = service.loadMetadata(serviceUrl);\nString type = request.getType();\nif (type != null && !md.getProjectTypes().containsKey(type)) {\n    throw new IllegalArgumentException(\n        \"Unknown type '\" + type + \"'. Valid: \" + md.getProjectTypes().keySet());\n}","typeGuard":null,"tryCatchPattern":"try {\n    request.determineProjectType(metadata);\n} catch (ReportableException ex) {\n    if (ex.getMessage().startsWith(\"No project type with id\")) {\n        Log.error(\"Run 'spring init --list' for valid type ids\");\n    }\n    throw ex;\n}","preventionTips":["Discover type ids with 'spring init --list' before specifying --type","Treat type ids as server-specific; do not hard-code across services","Re-check supported types after upgrading the Initializr server"],"tags":["initializr","project-type","validation","user-input","spring-boot-cli"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}