spring-projects / spring-ai

An Application Framework for AI Engineering
https://docs.spring.io/spring-ai/reference/1.0-SNAPSHOT/index.html
Apache License 2.0
2.52k stars 606 forks source link

Spring AI PG Vector store does not find vector.control #529

Open networkinss opened 3 months ago

networkinss commented 3 months ago

Bug description Setup of Spring AI with PG Vector store fails. It cannot find the file vector.control even if it exists. The problem seems to be that it is looking for a Postgres 14 installation, although PG Vector store is for Postgres 15 or 16. The error message is:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'vectorStore' defined in class path resource [org/springframework/ai/autoconfigure/vectorstore/pgvector/PgVectorStoreAutoConfiguration.class]: StatementCallback; SQL [CREATE EXTENSION IF NOT EXISTS vector]; ERROR: could not open extension control file "/usr/share/postgresql/14/extension/vector.control"

I linked from postgres/14 to postgres/16, so that the path exists. I ensured the file is read/writable. Yet, the error message remains.

Environment

Steps to reproduce

Expected behavior The application shall be able to find the correct vector.control file of the Posgres 15 or 16 version instead of looking for Postgres 14.

Minimal Complete Reproducible example The error occurs with the start.spring.io package setup, link with parameters is provided in the section "Steps to reproduce".

networkinss commented 3 months ago

The error occurs only if Postgres was updated from 14 to 16. After removing Postgres and do a fresh installation from scratch it works fine.