# Temporal version 1.22.4: Unable to start server. Error: sql schema version compatibility check failed

**URL:** <https://community.temporal.io/t/temporal-version-1-22-4-unable-to-start-server-error-sql-schema-version-compatibility-check-failed/13184>\
**Category:** Community Support\
**Created:** [August 16, 2024, 11:16am UTC](https://community.temporal.io/t/temporal-version-1-22-4-unable-to-start-server-error-sql-schema-version-compatibility-check-failed/13184 "2024-08-16T11:16:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ujala\_Singh](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/ujala_singh/32/5728_2.png) [@Ujala\_Singh](https://community.temporal.io/u/Ujala_Singh)\
**Post date:** [August 16, 2024, 11:16am UTC](https://community.temporal.io/t/temporal-version-1-22-4-unable-to-start-server-error-sql-schema-version-compatibility-check-failed/13184/1 "2024-08-16T11:16:28Z")

</div>

Hi all,  
I’m having an issue to startup the k8s environment with temporal 1.22.4.

### Description:

I’m encountering an issue while provisioning the Temporal server (version `1.22.4`) on a k3d cluster locally. The Temporal server fails to start due to a SQL schema version compatibility check error.  
I followed the steps mentioned here [GitHub - temporalio/helm-charts: Temporal Helm charts](https://github.com/temporalio/helm-charts?tab=readme-ov-file#install-with-your-own-postgresql.This) is the config I am using for postgres: [helm-charts/charts/temporal/values/values.postgresql.yaml at main · temporalio/helm-charts · GitHub](https://github.com/temporalio/helm-charts/blob/main/charts/temporal/values/values.postgresql.yaml)  
The detailed error message is as follows:

```auto
sql schema version compatibility check failed: pq: pg_hba.conf rejects connection for host "10.42.0.21", user "postgres", database "temporal", SSL off
Unable to create server. Error: could not build arguments for function "go.uber.org/fx".(*module).constructCustomLogger.func2 (/go/pkg/mod/go.uber.org/fx@v1.20.0/module.go:251): failed to build fxevent.Logger: could not build arguments for function "go.temporal.io/server/temporal".glob..func8 (/home/builder/temporal/temporal/fx.go:1037): failed to build log.Logger: received non-nil error from function "go.temporal.io/server/temporal".ServerOptionsProvider (/home/builder/temporal/temporal/fx.go:173): sql schema version compatibility check failed: pq: pg_hba.conf rejects connection for host "10.42.0.21", user "postgres", database "temporal", SSL off.

```

### Environment Details:

- **Temporal Version** : 1.22.4
- **Deployment** : k3d cluster (local)
- **Database** : PostgreSQL

### Issue

The error suggests that the connection to the PostgreSQL database is being rejected due to SSL being off. It appears that the Temporal server is unable to perform the SQL schema version compatibility check because the `pg_hba.conf` configuration on the PostgreSQL database is rejecting the connection.

I am using the recommended version only. So I have installed the zalando postgres operator. And deployed a 3 instance postgres cluster with the below config:

```auto
apiVersion: "acid.zalan.do/v1"
kind: postgresql
metadata:
  name: temporal-backend
  namespace: temporal
spec:
  teamId: "temporal"
  volume:
    size: 10Gi
  numberOfInstances: 3
  users:
    temporal_admin:
    - superuser
    - createdb
  databases:
    temporal: temporal_admin
    temporal_visibility: temporal_admin
  postgresql:
    version: "12"

```

Later once it was up, I initialized it with the below script and tables got created:

```auto
# in https://github.com/temporalio/temporal git repo dir
export SQL_PLUGIN=postgres12
export SQL_HOST=postgresql_host
export SQL_PORT=5432
export SQL_USER=postgresql_user
export SQL_PASSWORD=postgresql_password

make temporal-sql-tool

./temporal-sql-tool --database temporal create-database
SQL_DATABASE=temporal ./temporal-sql-tool setup-schema -v 0.0
SQL_DATABASE=temporal ./temporal-sql-tool update -schema-dir schema/postgresql/v12/temporal/versioned

./temporal-sql-tool --database temporal_visibility create-database
SQL_DATABASE=temporal_visibility ./temporal-sql-tool setup-schema -v 0.0
SQL_DATABASE=temporal_visibility ./temporal-sql-tool update -schema-dir schema/postgresql/v12/visibility/versioned

```

### Steps to Reproduce:

1. Deploy a Temporal server (version `1.22.4`) on a k3d cluster locally.
2. Configure the Temporal server to connect to a PostgreSQL database.
3. Attempt to start the Temporal server.

### Expected Behavior:

The Temporal server should connect to the PostgreSQL database, perform the schema compatibility check, and start successfully.

### Actual Behavior:

The server fails to start due to the connection being rejected by the PostgreSQL `pg_hba.conf` configuration when SSL is off.

### Additional Information:

It seems like the Temporal server may require SSL for the PostgreSQL connection, or there may be a misconfiguration in the PostgreSQL `pg_hba.conf` file. Any guidance on how to resolve this issue would be greatly appreciated.

Great thanks for your support  
Regards  
Ujala Singh

---

<div class="post-metadata">

**Author:** ![Ramu\_Yarru](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/ramu_yarru/32/6187_2.png) [@Ramu\_Yarru](https://community.temporal.io/u/Ramu_Yarru)\
**Post date:** [October 25, 2024, 7:41pm UTC](https://community.temporal.io/t/temporal-version-1-22-4-unable-to-start-server-error-sql-schema-version-compatibility-check-failed/13184/2 "2024-10-25T19:41:20Z")

</div>

@Ujala_Singh: Were you able to solve the issue? If so, kindly let us know how to solve it

---

<div class="post-metadata">

**Author:** ![Ujala\_Singh](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/ujala_singh/32/5728_2.png) [@Ujala\_Singh](https://community.temporal.io/u/Ujala_Singh)\
**Post date:** [February 18, 2025, 12:49pm UTC](https://community.temporal.io/t/temporal-version-1-22-4-unable-to-start-server-error-sql-schema-version-compatibility-check-failed/13184/3 "2025-02-18T12:49:00Z")

</div>

@Ramu_Yarru I don’t know why it was not working with the zalando postgres operator. Later I switched to Cloudnative-pg operator for k8s [https://cloudnative-pg.io/](https://cloudnative-pg.io/) and it worked for me and there were no errors while bootstraping.

---

<div class="post-metadata">

**Author:** ![Smruti](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/smruti/32/7089_2.png) [@Smruti](https://community.temporal.io/u/Smruti)\
**Post date:** [April 1, 2025, 5:19pm UTC](https://community.temporal.io/t/temporal-version-1-22-4-unable-to-start-server-error-sql-schema-version-compatibility-check-failed/13184/4 "2025-04-01T17:19:40Z")

</div>

In pg\_hba.conf just edit nossl request rejected to md5. It will solve this issue.  
When you will open pg\_hba.conf , you will see (hostnossl all all all rejected). Just change rejected section to (hostnossl all all all md5). And it will work.  
And you have to make sure that only patroni can overwrite pg\_hba.conf.
