{"record":{"id":"d4bcfa0d88e25cc7","repo":"immich-app/immich","slug":"no-available-version-for-extension-names-extensi","errorCode":null,"errorMessage":"No available version for ${EXTENSION_NAMES[extension]} extension","messagePattern":"No available version for (.+?) extension","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/src/repositories/database.repository.ts","lineNumber":132,"sourceCode":"      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)]);\n  }\n\n  async prewarm(index: VectorIndex): Promise<void> {\n    const vectorExtension = await getVectorExtension(this.db);","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/server/src/repositories/database.repository.ts#L114-L150","documentation":"In updateVectorExtension, after confirming the extension is installed, it checks availableVersion. If the Postgres catalog reports no available (upgradable) version for the extension, it throws No available version for <Name> extension. This indicates the catalog entry is incomplete or the extension packaging is broken.","triggerScenarios":"The extension is installed but pg_available_extensions/pg_available_extension_versions does not expose a version for it — e.g. a partially installed extension, corrupted package, or a packaging bug in the Postgres image.","commonSituations":"Custom-built Postgres image with a half-installed extension; extension shared library missing while the control file exists; mismatch between extension versions shipped and expected.","solutions":["Reinstall the extension package cleanly (vectorchord or pgvector) in the Postgres image.","Verify SELECT * FROM pg_available_extension_versions WHERE name = '<ext>'; returns a row with a version.","Fall back to the official Immich Postgres image which ships a known-good extension."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const res = await sql`SELECT version FROM pg_available_extension_versions WHERE name = '${ext}'`;\nif (res.rows.length === 0) {\n  throw new Error(`No available version for ${ext}; reinstall the extension package.`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the full extension package (control file + shared library) cleanly.","Use the official Immich Postgres image to avoid partial installs.","Validate pg_available_extension_versions during image build."],"tags":["database","postgres","vector-extension","migration","packaging"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}