Helm chart installation /w Postgres

I’m using helm to deploy the Temporal server - preferred method as I’m full gitops + argocd.

I’ve gone ahead and set up a values.yaml to use my Azure postgresql flexible server:

      persistence:
        default:
          driver: "sql"

          sql:
            driver: "postgres12"
            host: myservername.postgres.database.azure.com
            port: 5432
            database: temporal
            user: myadmin
            password: mypassword
            maxConns: 20
            maxIdleConns: 20
            maxConnLifetime: "1h"
            tls:
              enabled: true
              enableHostVerification: true
              serverName: myservername.postgres.database.azure.com

        visibility:
          driver: "sql"

          sql:
            driver: "postgres12"
            host: myservername.postgres.database.azure.com
            port: 5432
            database: temporal_visibility
            user: myadmin
            password: mypassword
            maxConns: 20
            maxIdleConns: 20
            maxConnLifetime: "1h"
            tls:
              enabled: true
              enableHostVerification: true
              serverName: myservername.postgres.database.azure.com

.......

  schema:
    createDatabase:
      enabled: true
    setup:
      enabled: true
      backoffLimit: 100
    update:
      enabled: true
      backoffLimit: 100

It looks like from first glace the schema for the main temporal database has deployed - I can see 37 tables.

The temporal_visibility database has been made and the schema has created 3 tables as well.

However on the worker pod logs I’m seeing:

[Fx] RUN	provide: go.temporal.io/server/temporal.ServerOptionsProvider() in 136.071165ms
[Fx] Error returned: received non-nil error from function "go.temporal.io/server/temporal".ServerOptionsProvider
	/home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:159:
sql schema version compatibility check failed: version mismatch for keyspace/database: "temporal_visibility". Expected version: 1.9 cannot be greater than Actual version: 1.1
[Fx] ERROR		Failed to initialize custom logger: could not build arguments for function "go.uber.org/fx".(*module).constructCustomLogger.func2
	/home/runner/go/pkg/mod/go.uber.org/fx@v1.23.0/module.go:294:
failed to build fxevent.Logger:
could not build arguments for function "go.temporal.io/server/temporal".init.func6
	/home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:1008:
failed to build log.Logger:
received non-nil error from function "go.temporal.io/server/temporal".ServerOptionsProvider
	/home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:159:
sql schema version compatibility check failed: version mismatch for keyspace/database: "temporal_visibility". Expected version: 1.9 cannot be greater than Actual version: 1.1
Unable to create server. Error: could not build arguments for function "go.uber.org/fx".(*module).constructCustomLogger.func2 (/home/runner/go/pkg/mod/go.uber.org/fx@v1.23.0/module.go:294): failed to build fxevent.Logger: could not build arguments for function "go.temporal.io/server/temporal".init.func6 (/home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:1008): failed to build log.Logger: received non-nil error from function "go.temporal.io/server/temporal".ServerOptionsProvider (/home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:159): sql schema version compatibility check failed: version mismatch for keyspace/database: "temporal_visibility". Expected version: 1.9 cannot be greater than Actual version: 1.1.

Presuambly connectivity is fine to Azure but ongoing access to temporal_visibility seems to be problematic? So while the schemas has scaffolded on the database there seems to still be a problem - is is related to using Azure Database for PostgreSQL flexible server (v16.9)?

Tried google-fu and can’t seem to figure out why.

The fix is to ensure that the ‘btree_gin’ extension is installed

Azure Postgres (Portal) → Server parameters → ‘azure.extensions’ → In the dropdown select ‘btree_gin’ → Save

You cannot install this extension using SQL which is what the database schema attempts to do in:

schema\postgresql\v12\visibility\versioned\v1.2\advanced_visibility.sql

Have to admit it was a pain to figure out as I has to run the temporal-sql-tool manually as the schema pod logs didn’t give enough information. Might be useful if they could be output for users.

Anyway this might help someone in the future :slight_smile: