immich-app/immich · critical · Error

No vector extension found. Available extensions: ${VECTOR_EX

Error message

No vector extension found. Available extensions: ${VECTOR_EXTENSIONS.join(', ')}

What it means

getVectorExtension(runner) resolves which pg vector extension to use: first a cached value, then the env-configured database.vectorExtension, finally it queries pg_available_extensions for the supported set (VECTOR_EXTENSIONS = [VectorChord, Vector]). If none of the supported extensions are available in Postgres, it throws. Without a vector extension, smart search and face recognition cannot function.

Source

Thrown at server/src/repositories/database.repository.ts:46

import z from 'zod';

export let cachedVectorExtension: VectorExtension | undefined;
export async function getVectorExtension(runner: Kysely<DB>): Promise<VectorExtension> {
  if (cachedVectorExtension) {
    return cachedVectorExtension;
  }

  cachedVectorExtension = new ConfigRepository().getEnv().database.vectorExtension;
  if (cachedVectorExtension) {
    return cachedVectorExtension;
  }

  const query = `SELECT name FROM pg_available_extensions WHERE name IN (${VECTOR_EXTENSIONS.map((ext) => `'${ext}'`).join(', ')})`;
  const { rows: availableExtensions } = await sql.raw<{ name: VectorExtension }>(query).execute(runner);
  const extensionNames = new Set(availableExtensions.map((row) => row.name));
  cachedVectorExtension = VECTOR_EXTENSIONS.find((ext) => extensionNames.has(ext));
  if (!cachedVectorExtension) {
    throw new Error(`No vector extension found. Available extensions: ${VECTOR_EXTENSIONS.join(', ')}`);
  }
  return cachedVectorExtension;
}

export const probes: Record<VectorIndex, number> = {
  [VectorIndex.Clip]: 1,
  [VectorIndex.Face]: 1,
};

@Injectable()
export class DatabaseRepository {
  private readonly asyncLock = new AsyncLock();

  constructor(
    @InjectKysely() private db: Kysely<DB>,
    private logger: LoggingRepository,
    private configRepository: ConfigRepository,
  ) {

View on GitHub (pinned to 199723261c)

Solutions

  1. Install a supported extension in Postgres (CREATE EXTENSION vector; for pgvector, or the VectorChord package) and confirm SELECT name FROM pg_available_extensions WHERE name IN ('vectorchord','vector'); returns a row.
  2. Use the official Immich Postgres image which ships the required extension.
  3. Pin the extension explicitly via the env database.vectorExtension setting once one is available.
Defensive patterns

Strategy: validation

Validate before calling

// run against the target DB before starting Immich
const res = await sql`SELECT name FROM pg_available_extensions WHERE name IN ('vectorchord','vector')`;
if (res.rows.length === 0) {
  throw new Error('No supported vector extension available; install pgvector or VectorChord.');
}

Prevention

When it happens

Trigger: Starting Immich against a Postgres instance that has neither vectorchord nor vector installed/available; the extension binaries are present but not listed by pg_available_extensions.

Common situations: Fresh DB without the pgvector extension installed; custom Postgres image missing the extension; wrong DB server targeted; extension present in a different Postgres cluster.

Related errors


AI-assisted analysis of immich-app/immich@199723261c (2026-08-12). Data as JSON: /api/errors/bbfb304fd7f38117. Report an issue: GitHub.