Bug description
Dependency conflict between spring-ai-redis-store-spring-boot-starter
and spring-boot-starter-data-redis
also spring-boot-starter-data-redis-reactive
.
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
implementation 'org.springframework.ai:spring-ai-redis-store-spring-boot-starter'
Environment Spring Boot version: 3.2.5 Spring AI version: 1.0.0-SNAPSHOT Java version: 21 Redis vector store
Steps to reproduce
I want to use both RedisTemplate
and RedisVectorStore
at the same time, but I got this error.
***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'redisConnectionDetails', defined in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/ai/autoconfigure/vectorstore/redis/RedisVectorStoreAutoConfiguration.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
After adding spring.main.allow-bean-definition-overriding=true
in application.properties
got this error.
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 2 of method vectorStore in org.springframework.ai.autoconfigure.vectorstore.redis.RedisVectorStoreAutoConfiguration required a bean of type 'org.springframework.ai.autoconfigure.vectorstore.redis.RedisConnectionDetails' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.ai.autoconfigure.vectorstore.redis.RedisConnectionDetails' in your configuration.
Minimal Complete Reproducible example
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.5'
id 'io.spring.dependency-management' version '1.1.4'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '21'
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
ext {
set('springAiVersion', "1.0.0-SNAPSHOT")
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
implementation 'org.springframework.ai:spring-ai-redis-store-spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
dependencyManagement {
imports {
mavenBom "org.springframework.ai:spring-ai-bom:${springAiVersion}"
}
}
tasks.named('test') {
useJUnitPlatform()
}
Comment From: eddumelendez
Hi @Mr-LiuDC, I've raised #1067 in order to fix this and rely on the implementations provided by spring-boot.
I talked with @tzolov about it couple of weeks ago and agree that the Redis Vector Store implementation should rely on existing Redis AutoConfiguration.
Comment From: tzolov
Thanks to @eddumelendez , ,this should be resolved by 0a07f65d6ab3873ecfcc6006a4afd631ab1507b7
Feel free to reopen the issue if the issue is still present.
Comment From: Mr-LiuDC
Hi @eddumelendez , It seems that JedisClient
authorization not pick up. here is similar issue #1128
java.lang.RuntimeException: Could not add document: redis.clients.jedis.exceptions.JedisDataException: ERR Protocol error: unauthenticated bulk length