alibaba/spring-ai-alibaba · error · InvalidProjectRequestException
Invalid Spring Boot version '${platformVersion}', Spring Boo
Error message
Invalid Spring Boot version '${platformVersion}', Spring Boot compatibility range is ${range} What it means
validatePlatformVersion() parses the requested Spring Boot version and checks it against the Initializr metadata's platform compatibility range. If the version falls outside the supported range, an InvalidProjectRequestException is thrown. This guards project generation against Boot versions the initializr metadata does not support.
Source
Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/generator/GraphProjectReqToDescConverter.java:130
*/
protected String cleanInputValue(String value) {
return StringUtils.hasText(value) ? Normalizer.normalize(value, Normalizer.Form.NFKD).replaceAll("\\p{M}", "")
: value;
}
private void validate(ProjectRequest request, InitializrMetadata metadata) {
validatePlatformVersion(request, metadata);
validateType(request.getType(), metadata);
validateLanguage(request.getLanguage(), metadata);
validatePackaging(request.getPackaging(), metadata);
validateDependencies(request, metadata);
}
private void validatePlatformVersion(ProjectRequest request, InitializrMetadata metadata) {
Version platformVersion = Version.safeParse(request.getBootVersion());
InitializrConfiguration.Platform platform = metadata.getConfiguration().getEnv().getPlatform();
if (platformVersion != null && !platform.isCompatibleVersion(platformVersion)) {
throw new InvalidProjectRequestException("Invalid Spring Boot version '" + platformVersion
+ "', Spring Boot compatibility range is " + platform.determineCompatibilityRangeRequirement());
}
}
private void validateType(String type, InitializrMetadata metadata) {
if (type != null) {
Type typeFromMetadata = metadata.getTypes().get(type);
if (typeFromMetadata == null) {
throw new InvalidProjectRequestException("Unknown type '" + type + "' check project metadata");
}
if (!typeFromMetadata.getTags().containsKey("build")) {
throw new InvalidProjectRequestException(
"Invalid type '" + type + "' (missing build tag) check project metadata");
}
}
}
private void validateLanguage(String language, InitializrMetadata metadata) {View on GitHub (pinned to f82da0b50f)
Solutions
- Pass a supported bootVersion (e.g. a 3.x release matching the platform's compatibility range) in the ProjectRequest
- Refresh the initializr metadata so its platform compatibility range includes the desired Boot version
- Omit bootVersion entirely — validatePlatformVersion skips the check when Version.safeParse yields null/default
- Check spring.initializr config (application.yml initializr -> env -> platform) and widen the compatibility range
Example fix
// before
request.setBootVersion("1.5.9.RELEASE");
// after
request.setBootVersion("3.2.5"); Defensive patterns
Strategy: validation
Validate before calling
String bootVersion = request.getBootVersion();
if (bootVersion != null && !bootVersion.matches("3\\..+")) {
throw new IllegalArgumentException("bootVersion " + bootVersion + " outside supported 3.x range");
} Try / catch
try {
converter.validate(request);
} catch (InvalidProjectRequestException e) {
// surface a 400 with the message to the API caller
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage());
} Prevention
- Default bootVersion to a metadata-listed default instead of hard-coding
- Refresh initializr metadata when new Spring Boot versions ship
- Validate versions client-side against the metadata endpoint
When it happens
Trigger: Calling the project-generator validate/convert flow with ProjectRequest.setBootVersion() set to a version outside metadata.getConfiguration().getEnv().getPlatform().determineCompatibilityRangeRequirement() — e.g. bootVersion '1.5.9' or an unreleased '4.x' while metadata supports 2.x–3.x.
Common situations: Hard-coded or stale bootVersion in scripts or CI, users submitting an old Boot version to the studio admin generator, initializr metadata not updated for a newly released Spring Boot version.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- MISSING_PARAMS
- Unknown type '${type}' check project metadata
- Unknown language '${language}' check project metadata
- Unknown packaging '${packaging}' check project metadata
- Unknown dependency '${dep}' check project metadata
AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09).
Data as JSON: /api/errors/645b23d1f13cb212.
Report an issue: GitHub.