{"record":{"id":"283374380f475029","repo":"immich-app/immich","slug":"extension-names-extension-extension-is-not-ins","errorCode":null,"errorMessage":"${EXTENSION_NAMES[extension]} extension is not installed","messagePattern":"(.+?) extension is not installed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/src/repositories/database.repository.ts","lineNumber":128,"sourceCode":"  async createExtension(extension: DatabaseExtension): Promise<void> {\n    this.logger.log(`Creating ${EXTENSION_NAMES[extension]} extension`);\n    await sql`CREATE EXTENSION IF NOT EXISTS ${sql.raw(extension)} CASCADE`.execute(this.db);\n    if (extension === DatabaseExtension.VectorChord) {\n      const dbName = sql.id(await this.getDatabaseName());\n      await sql`ALTER DATABASE ${dbName} SET vchordrq.probes = 1`.execute(this.db);\n      await sql`SET vchordrq.probes = 1`.execute(this.db);\n    }\n  }\n\n  async dropExtension(extension: DatabaseExtension): Promise<void> {\n    this.logger.log(`Dropping ${EXTENSION_NAMES[extension]} extension`);\n    await sql`DROP EXTENSION IF EXISTS ${sql.raw(extension)}`.execute(this.db);\n  }\n\n  async updateVectorExtension(extension: VectorExtension, targetVersion?: string): Promise<void> {\n    const [{ availableVersion, installedVersion }] = await this.getExtensionVersions([extension]);\n    if (!installedVersion) {\n      throw new Error(`${EXTENSION_NAMES[extension]} extension is not installed`);\n    }\n\n    if (!availableVersion) {\n      throw new Error(`No available version for ${EXTENSION_NAMES[extension]} extension`);\n    }\n    targetVersion ??= availableVersion;\n\n    if (!semver.diff(installedVersion, targetVersion)) {\n      return;\n    }\n\n    await Promise.all([\n      this.db.schema.dropIndex(VectorIndex.Clip).ifExists().execute(),\n      this.db.schema.dropIndex(VectorIndex.Face).ifExists().execute(),\n    ]);\n\n    await sql`ALTER EXTENSION ${sql.raw(extension)} UPDATE TO ${sql.lit(targetVersion)}`.execute(this.db);\n    await Promise.all([this.reindexVectors(VectorIndex.Clip), this.reindexVectors(VectorIndex.Face)]);","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/server/src/repositories/database.repository.ts#L110-L146","documentation":"updateVectorExtension(extension, targetVersion?) fetches installedVersion and availableVersion for the extension. If installedVersion is null the extension is not actually installed in the DB, so it throws <Name> extension is not installed. This is distinct from the extension being available — here it is missing from the database even though an upgrade was attempted.","triggerScenarios":"Triggering a vector-extension upgrade (e.g. during a migration/startup that calls updateVectorExtension) when the extension has not been CREATE EXTENSION'd in the current database, or was dropped.","commonSituations":"Extension was available (so the earlier check passed) but never created in this DB; a prior dropExtension removed it; connected to a different database/schema than expected.","solutions":["Create the extension: CREATE EXTENSION IF NOT EXISTS <extension>; in the Immich database, then restart.","Verify you are connected to the correct database/schema.","Re-run the startup/migration flow that calls updateVectorExtension."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const res = await sql`SELECT extversion FROM pg_extension WHERE extname = '${ext}'`;\nif (res.rows.length === 0) {\n  throw new Error(`${ext} not installed; run CREATE EXTENSION first.`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run CREATE EXTENSION for the vector extension during DB provisioning.","Confirm the same DB/schema Immich connects to actually has the extension.","Avoid manual DROP EXTENSION outside of documented migration steps."],"tags":["database","postgres","vector-extension","migration","startup"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}