{"record":{"id":"bf008b10268c77e3","repo":"spring-projects/spring-ai","slug":"required-properties-for-titanembeddingbedrockapi-a","errorCode":null,"errorMessage":"Required properties for TitanEmbeddingBedrockApi are missing.","messagePattern":"Required properties for TitanEmbeddingBedrockApi are missing\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/main/java/org/springframework/ai/model/bedrock/titan/autoconfigure/BedrockTitanEmbeddingAutoConfiguration.java","lineNumber":65,"sourceCode":" */\n@AutoConfiguration\n@ConditionalOnClass(TitanEmbeddingBedrockApi.class)\n@EnableConfigurationProperties({ BedrockTitanEmbeddingProperties.class, BedrockAwsConnectionProperties.class })\n@ConditionalOnProperty(name = SpringAIModelProperties.EMBEDDING_MODEL, havingValue = SpringAIModels.BEDROCK_TITAN,\n\t\tmatchIfMissing = true)\n@Import(BedrockAwsConnectionConfiguration.class)\npublic class BedrockTitanEmbeddingAutoConfiguration {\n\n\t@Bean\n\t@ConditionalOnMissingBean\n\t@ConditionalOnBean({ AwsCredentialsProvider.class, AwsRegionProvider.class })\n\tpublic TitanEmbeddingBedrockApi titanEmbeddingBedrockApi(AwsCredentialsProvider credentialsProvider,\n\t\t\tAwsRegionProvider regionProvider, BedrockTitanEmbeddingProperties properties,\n\t\t\tBedrockAwsConnectionProperties awsProperties, JsonMapper jsonMapper) {\n\n\t\t// Validate required properties\n\t\tif (properties.getModel() == null || awsProperties.getTimeout() == null) {\n\t\t\tthrow new IllegalArgumentException(\"Required properties for TitanEmbeddingBedrockApi are missing.\");\n\t\t}\n\n\t\treturn new TitanEmbeddingBedrockApi(properties.getModel(), credentialsProvider, regionProvider.getRegion(),\n\t\t\t\tjsonMapper, awsProperties.getTimeout());\n\t}\n\n\t@Bean\n\t@ConditionalOnMissingBean\n\t@ConditionalOnBean(TitanEmbeddingBedrockApi.class)\n\tpublic BedrockTitanEmbeddingModel titanEmbeddingModel(TitanEmbeddingBedrockApi titanEmbeddingApi,\n\t\t\tBedrockTitanEmbeddingProperties properties, ObjectProvider<ObservationRegistry> observationRegistry) {\n\n\t\t// Validate required properties\n\t\tif (properties.getInputType() == null) {\n\t\t\tthrow new IllegalArgumentException(\"InputType property for BedrockTitanEmbeddingModel is missing.\");\n\t\t}\n\n\t\treturn new BedrockTitanEmbeddingModel(titanEmbeddingApi,","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/main/java/org/springframework/ai/model/bedrock/titan/autoconfigure/BedrockTitanEmbeddingAutoConfiguration.java#L47-L83","documentation":"The Bedrock Titan embedding auto-configuration validates mandatory settings before constructing TitanEmbeddingBedrockApi. If the model id (spring.ai.bedrock.titan.embedding.model) or the AWS connection timeout (spring.ai.bedrock.aws.timeout) is null, it refuses to build the bean and throws this IllegalArgumentException so the failure is fail-fast with a clear message.","triggerScenarios":"titanEmbeddingBedrockApi bean method runs with properties.getModel() == null or awsProperties.getTimeout() == null — i.e. no spring.ai.bedrock.titan.embedding.model set, or no spring.ai.bedrock.aws.timeout set, while the auto-configuration is active.","commonSituations":"Enabling Bedrock Titan embedding without specifying a Titan model id (e.g. amazon.titan-embed-text-v1); forgetting the aws.timeout property; property misplacement under the wrong prefix so nothing binds.","solutions":["Set spring.ai.bedrock.titan.embedding.model to a valid Titan embedding model id (e.g. amazon.titan-embed-text-v2:0).","Set spring.ai.bedrock.aws.timeout (e.g. 5m or PT5M depending on binding).","Verify the properties are under the correct prefixes (spring.ai.bedrock.titan.embedding.* and spring.ai.bedrock.aws.*) and the YAML/properties file is actually loaded."],"exampleFix":"// before\nspring.ai.bedrock.aws.region=us-east-1\n// after\nspring.ai.bedrock.aws.region=us-east-1\nspring.ai.bedrock.aws.timeout=5m\nspring.ai.bedrock.titan.embedding.model=amazon.titan-embed-text-v2:0","handlingStrategy":"validation","validationCode":"if (env.getProperty(\"spring.ai.bedrock.titan.embedding.model\") == null)\n    throw new IllegalStateException(\"Set spring.ai.bedrock.titan.embedding.model before enabling Titan embedding\");\nif (env.getProperty(\"spring.ai.bedrock.aws.timeout\") == null)\n    throw new IllegalStateException(\"Set spring.ai.bedrock.aws.timeout\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set both model id and aws.timeout whenever the Titan embedding auto-configuration is on the classpath.","Use application.yml templates for Bedrock properties in new services."],"tags":["bedrock","titan","embedding","missing-config"],"backgroundTag":"missing-required-config-field","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}