spring-projects/spring-ai · error · IllegalArgumentException

Required properties for TitanEmbeddingBedrockApi are missing

Error message

Required properties for TitanEmbeddingBedrockApi are missing.

What it means

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.

Source

Thrown at auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/main/java/org/springframework/ai/model/bedrock/titan/autoconfigure/BedrockTitanEmbeddingAutoConfiguration.java:65

 */
@AutoConfiguration
@ConditionalOnClass(TitanEmbeddingBedrockApi.class)
@EnableConfigurationProperties({ BedrockTitanEmbeddingProperties.class, BedrockAwsConnectionProperties.class })
@ConditionalOnProperty(name = SpringAIModelProperties.EMBEDDING_MODEL, havingValue = SpringAIModels.BEDROCK_TITAN,
		matchIfMissing = true)
@Import(BedrockAwsConnectionConfiguration.class)
public class BedrockTitanEmbeddingAutoConfiguration {

	@Bean
	@ConditionalOnMissingBean
	@ConditionalOnBean({ AwsCredentialsProvider.class, AwsRegionProvider.class })
	public TitanEmbeddingBedrockApi titanEmbeddingBedrockApi(AwsCredentialsProvider credentialsProvider,
			AwsRegionProvider regionProvider, BedrockTitanEmbeddingProperties properties,
			BedrockAwsConnectionProperties awsProperties, JsonMapper jsonMapper) {

		// Validate required properties
		if (properties.getModel() == null || awsProperties.getTimeout() == null) {
			throw new IllegalArgumentException("Required properties for TitanEmbeddingBedrockApi are missing.");
		}

		return new TitanEmbeddingBedrockApi(properties.getModel(), credentialsProvider, regionProvider.getRegion(),
				jsonMapper, awsProperties.getTimeout());
	}

	@Bean
	@ConditionalOnMissingBean
	@ConditionalOnBean(TitanEmbeddingBedrockApi.class)
	public BedrockTitanEmbeddingModel titanEmbeddingModel(TitanEmbeddingBedrockApi titanEmbeddingApi,
			BedrockTitanEmbeddingProperties properties, ObjectProvider<ObservationRegistry> observationRegistry) {

		// Validate required properties
		if (properties.getInputType() == null) {
			throw new IllegalArgumentException("InputType property for BedrockTitanEmbeddingModel is missing.");
		}

		return new BedrockTitanEmbeddingModel(titanEmbeddingApi,

View on GitHub (pinned to 98a7beda4f)

Solutions

  1. Set spring.ai.bedrock.titan.embedding.model to a valid Titan embedding model id (e.g. amazon.titan-embed-text-v2:0).
  2. Set spring.ai.bedrock.aws.timeout (e.g. 5m or PT5M depending on binding).
  3. 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.

Example fix

// before
spring.ai.bedrock.aws.region=us-east-1
// after
spring.ai.bedrock.aws.region=us-east-1
spring.ai.bedrock.aws.timeout=5m
spring.ai.bedrock.titan.embedding.model=amazon.titan-embed-text-v2:0
Defensive patterns

Strategy: validation

Validate before calling

if (env.getProperty("spring.ai.bedrock.titan.embedding.model") == null)
    throw new IllegalStateException("Set spring.ai.bedrock.titan.embedding.model before enabling Titan embedding");
if (env.getProperty("spring.ai.bedrock.aws.timeout") == null)
    throw new IllegalStateException("Set spring.ai.bedrock.aws.timeout");

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of spring-projects/spring-ai@98a7beda4f (2026-09-11). Data as JSON: /api/errors/bf008b10268c77e3. Report an issue: GitHub.