{"record":{"id":"bbfb304fd7f38117","repo":"immich-app/immich","slug":"no-vector-extension-found-available-extensions","errorCode":null,"errorMessage":"No vector extension found. Available extensions: ${VECTOR_EXTENSIONS.join(', ')}","messagePattern":"No vector extension found\\. Available extensions: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/src/repositories/database.repository.ts","lineNumber":46,"sourceCode":"import z from 'zod';\n\nexport let cachedVectorExtension: VectorExtension | undefined;\nexport async function getVectorExtension(runner: Kysely<DB>): Promise<VectorExtension> {\n  if (cachedVectorExtension) {\n    return cachedVectorExtension;\n  }\n\n  cachedVectorExtension = new ConfigRepository().getEnv().database.vectorExtension;\n  if (cachedVectorExtension) {\n    return cachedVectorExtension;\n  }\n\n  const query = `SELECT name FROM pg_available_extensions WHERE name IN (${VECTOR_EXTENSIONS.map((ext) => `'${ext}'`).join(', ')})`;\n  const { rows: availableExtensions } = await sql.raw<{ name: VectorExtension }>(query).execute(runner);\n  const extensionNames = new Set(availableExtensions.map((row) => row.name));\n  cachedVectorExtension = VECTOR_EXTENSIONS.find((ext) => extensionNames.has(ext));\n  if (!cachedVectorExtension) {\n    throw new Error(`No vector extension found. Available extensions: ${VECTOR_EXTENSIONS.join(', ')}`);\n  }\n  return cachedVectorExtension;\n}\n\nexport const probes: Record<VectorIndex, number> = {\n  [VectorIndex.Clip]: 1,\n  [VectorIndex.Face]: 1,\n};\n\n@Injectable()\nexport class DatabaseRepository {\n  private readonly asyncLock = new AsyncLock();\n\n  constructor(\n    @InjectKysely() private db: Kysely<DB>,\n    private logger: LoggingRepository,\n    private configRepository: ConfigRepository,\n  ) {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/server/src/repositories/database.repository.ts#L28-L64","documentation":"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.","triggerScenarios":"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.","commonSituations":"Fresh DB without the pgvector extension installed; custom Postgres image missing the extension; wrong DB server targeted; extension present in a different Postgres cluster.","solutions":["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.","Use the official Immich Postgres image which ships the required extension.","Pin the extension explicitly via the env database.vectorExtension setting once one is available."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// run against the target DB before starting Immich\nconst res = await sql`SELECT name FROM pg_available_extensions WHERE name IN ('vectorchord','vector')`;\nif (res.rows.length === 0) {\n  throw new Error('No supported vector extension available; install pgvector or VectorChord.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the official Immich Postgres image which ships the extension.","Pre-install the extension in any custom Postgres image.","Pin the extension in env (database.vectorExtension) once confirmed available."],"tags":["database","postgres","vector-extension","pgvector","startup"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}