immich-app/immich · error

No available version for

Error message

No available version for ${EXTENSION_NAMES[extension]} extension

What it means

During updateVectorExtension, after confirming the extension is installed, Immich checks that a target version is available on the server (from pg_available_extension_versions). If no available version can be resolved, it throws — the requested upgrade cannot proceed because the Postgres server does not expose any (or the target) version of the extension.

Solutions

  1. Omit targetVersion and let Immich pick the server's available version, or pass a version confirmed via SELECT version FROM pg_available_extension_versions WHERE name = 'vector';
  2. Upgrade the Postgres container image to one that ships the desired extension version
  3. Fix the targetVersion string (check exact formatting, e.g. '0.8.0' not 'v0.8.0')
  4. If the extension files were removed, reinstall the extension package on the Postgres server

Example fix

// before
await repo.updateVectorExtension(DatabaseExtension.Vector, '0.99.0');
// after
await repo.updateVectorExtension(DatabaseExtension.Vector); // uses latest available version
Defensive patterns

Strategy: fallback

Validate before calling

const { rows } = await sql`SELECT version FROM pg_available_extension_versions WHERE name = 'vector'`;
if (rows.length === 0) throw new Error('no available versions; upgrade the postgres image');

Try / catch

try {
  await repo.updateVectorExtension(extension, targetVersion);
} catch (e) {
  if ((e as Error).message.includes('No available version')) {
    await repo.updateVectorExtension(extension); // retry letting immich pick the available version
  } else throw e;
}

Prevention

When it happens

Trigger: Calling updateVectorExtension with a targetVersion that is not present in pg_available_extension_versions, or with no targetVersion when the server advertises no available versions for the installed extension.

Common situations: Requesting a specific extension version newer than what the Postgres image ships; extension binaries removed from the server so no versions are available; pinned/older container images where the available version list is restricted; typo in the requested version string.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of immich-app/immich@e55ac299a4 (2026-09-15). Data as JSON: /api/errors/d4bcfa0d88e25cc7. Report an issue: GitHub.

Appendix: source

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

      const dbName = sql.id(await this.getDatabaseName());
      await sql`ALTER DATABASE ${dbName} SET vchordrq.probes = 1`.execute(this.db);
      await sql`SET vchordrq.probes = 1`.execute(this.db);
    }
  }

  async dropExtension(extension: DatabaseExtension): Promise<void> {
    this.logger.log(`Dropping ${EXTENSION_NAMES[extension]} extension`);
    await sql`DROP EXTENSION IF EXISTS ${sql.raw(extension)}`.execute(this.db);
  }

  async updateVectorExtension(extension: VectorExtension, targetVersion?: string): Promise<void> {
    const [{ availableVersion, installedVersion }] = await this.getExtensionVersions([extension]);
    if (!installedVersion) {
      throw new Error(`${EXTENSION_NAMES[extension]} extension is not installed`);
    }

    if (!availableVersion) {
      throw new Error(`No available version for ${EXTENSION_NAMES[extension]} extension`);
    }
    targetVersion ??= availableVersion;

    if (!diff(installedVersion, targetVersion)) {
      return;
    }

    await Promise.all([
      this.db.schema.dropIndex(VectorIndex.Clip).ifExists().execute(),
      this.db.schema.dropIndex(VectorIndex.Face).ifExists().execute(),
    ]);

    await sql`ALTER EXTENSION ${sql.raw(extension)} UPDATE TO ${sql.lit(targetVersion)}`.execute(this.db);
    await Promise.all([this.reindexVectors(VectorIndex.Clip), this.reindexVectors(VectorIndex.Face)]);
  }

  async prewarm(index: VectorIndex): Promise<void> {
    const vectorExtension = await getVectorExtension(this.db);

View on GitHub (pinned to e55ac299a4)