timescale / pgvectorscale

A complement to pgvector for high performance, cost efficient vector search on large workloads.
PostgreSQL License
960 stars 41 forks source link

Extension "vectorscale" is not available in timescaledb:latest-pg16 #112

Open AlexanderFillbrunn opened 1 month ago

AlexanderFillbrunn commented 1 month ago

Hi! I am trying to run the Docker image timescale/timescaledb:latest-pg16 with a fresh volume, but CREATE EXTENSION IF NOT EXISTS vectorscale CASCADE; fails:

postgres-1  | waiting for server to start....2024-07-23 08:27:56.339 UTC [43] LOG:  starting PostgreSQL 16.3 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 13.2.1_git20240309) 13.2.1 20240309, 64-bit
postgres-1  | 2024-07-23 08:27:56.340 UTC [43] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres-1  | 2024-07-23 08:27:56.345 UTC [46] LOG:  database system was shut down at 2024-07-23 08:27:56 UTC
postgres-1  | 2024-07-23 08:27:56.350 UTC [43] LOG:  database system is ready to accept connections
postgres-1  | 2024-07-23 08:27:56.352 UTC [49] LOG:  TimescaleDB background worker launcher connected to shared catalogs
postgres-1  |  done
postgres-1  | server started
postgres-1  | 
postgres-1  | /usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/000_install_timescaledb.sh
postgres-1  | CREATE EXTENSION
postgres-1  | CREATE EXTENSION
postgres-1  | 2024-07-23 08:27:56.883 UTC [64] ERROR:  TimescaleDB background worker connected to template database, exiting
postgres-1  | 
postgres-1  | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/001_timescaledb_tune.sh
postgres-1  | 2024-07-23 08:27:56.884 UTC [43] LOG:  background worker "TimescaleDB Background Worker Scheduler" (PID 64) exited with exit code 1

[...]

postgres-1  | 2024-07-23 08:27:57.054 UTC [73] ERROR:  extension "vectorscale" is not available
postgres-1  | 2024-07-23 08:27:57.054 UTC [73] DETAIL:  Could not open extension control file "/usr/local/share/postgresql/extension/vectorscale.control": No such file or directory.
postgres-1  | 2024-07-23 08:27:57.054 UTC [73] HINT:  The extension must first be installed on the system where PostgreSQL is running.
postgres-1  | 2024-07-23 08:27:57.054 UTC [73] STATEMENT:  CREATE EXTENSION IF NOT EXISTS vectorscale CASCADE;
postgres-1  | psql:/docker-entrypoint-initdb.d/init.sql:201: ERROR:  extension "vectorscale" is not available
postgres-1  | DETAIL:  Could not open extension control file "/usr/local/share/postgresql/extension/vectorscale.control": No such file or directory.
postgres-1  | HINT:  The extension must first be installed on the system where PostgreSQL is running.
postgres-1 exited with code 3

Running SELECT * FROM pg_extension; only returns plpgsql and timescaledb and checking inside the container there is no vectorscale.control in /usr/local/share/postgresql/extension/. I do see vector.control and timescaledb.control there, though.

This is my experimental docker compose service for TimescaleDB:

postgres:
    image: timescale/timescaledb:latest-pg16
    restart: always
    volumes:
      - type: bind
        source: ${PWD}/init.sql
        target: /docker-entrypoint-initdb.d/init.sql
      - ${PWD}/db_data:/var/lib/postgresql/data
    ports:
      - ${DB_PORT}:${DB_PORT}
    environment:
      POSTGRES_DB: ${DB_DATABASE}
      POSTGRES_USER: ${DB_USER}
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_HOST_AUTH_METHOD: trust
      PGDATA: /var/lib/postgresql/data/pgdata

Any hint how to get this running is appreciated. Happy to test your suggestions.

Coderik commented 1 month ago

I had the same issue. The extension is available in the timescale/timescaledb-ha images. To be fair, the link in the README points to a guide, where the correct image is specified. Maybe it should be clarified in the docs?

AlexanderFillbrunn commented 1 month ago

Thanks @Coderik for the hint! I am going to use the -ha image for now. IMHO rather than adjusting the docs, the extension should also be available in the non-HA image. I do not see a reason to only provide it with high availability.

cevian commented 1 month ago

yes we only have it in timescale/timescaledb-ha we'll try to get it into the other image as well. Will leave this open until that happens.

AlexanderFillbrunn commented 1 month ago

Hi @cevian, thank you! Are the Dockerfiles for timescaledb-ha and timescaledb available somewhere? I could maybe give it a shot myself.