Trying to connect Temporal with external yugabyte database

I am trying to connect to external yugabyte database with Temporal. Facing below issue :

temporal | + temporal-sql-tool --plugin postgres --ep <db_ip> -u admin -p <db_port> create --db temporal
temporal-web | [2021-12-07T04:46:53.389Z] Auth is disabled in config
temporal | 2021-12-07T04:46:54.061Z ERROR Unable to create SQL database. {“error”: “unable to connect to DB, tried default DB names: postgres,defaultdb, errors: [pq: no pg_hba.conf entry for host "<ip_address>", user "admin", database "postgres", SSL off pq: no pg_hba.conf entry for host "<ip_address>", user "admin", database "defaultdb", SSL off]”, “logging-call-at”: “handler.go:97”}

Below are the contents of my files :
docker-compose.yml :

version: “3.5”
services:
temporal:
container_name: temporal
environment:
- DB=postgresql
- DB_PORT=****
- POSTGRES_USER=****
- POSTGRES_PWD=****
- POSTGRES_SEEDS=***
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml
image: temporalio/auto-setup:1.13.1
networks:
- temporal-network
ports:
- 7233:7233
volumes:
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
temporal-admin-tools:
container_name: temporal-admin-tools
depends_on:
- temporal
environment:
- TEMPORAL_CLI_ADDRESS=temporal:7233
image: temporalio/admin-tools:1.13.1
networks:
- temporal-network
stdin_open: true
tty: true
temporal-web:
container_name: temporal-web
depends_on:
- temporal
environment:
- TEMPORAL_GRPC_ENDPOINT=temporal:7233
- TEMPORAL_PERMIT_WRITE_API=true
image: temporalio/web:1.13.0
networks:
- temporal-network
ports:
- 8088:8088
networks:
temporal-network:
driver: bridge
name: temporal-network

development.yaml :

frontend.enableClientVersionCheck:

  • value: true
    constraints: {}
    history.persistenceMaxQPS:
  • value: 3000
    constraints: {}
    frontend.persistenceMaxQPS:
  • value: 3000
    constraints: {}
    frontend.historyMgrNumConns:
  • value: 10
    constraints: {}
    frontend.throttledLogRPS:
  • value: 20
    constraints: {}
    history.historyMgrNumConns:
  • value: 50
    constraints: {}
    history.defaultActivityRetryPolicy:
  • value:
    InitialIntervalInSeconds: 1
    MaximumIntervalCoefficient: 100.0
    BackoffCoefficient: 2.0
    MaximumAttempts: 0
    history.defaultWorkflowRetryPolicy:
  • value:
    InitialIntervalInSeconds: 1
    MaximumIntervalCoefficient: 100.0
    BackoffCoefficient: 2.0
    MaximumAttempts: 0
    system.advancedVisibilityWritingMode:
    • value: “off”
      constraints: {}
      persistence:
      defaultStore: default
      visibilityStore: visibility
      numHistoryShards: 512
      datastores:
      default:
      sql:
      pluginName: “postgres”
      databaseName: “temporal”
      connectAddr: ****
      connectProtocol: “tcp”
      user: ****
      password: ****
      visibility:
      sql:
      pluginName: “postgres”
      databaseName: “temporal”
      connectAddr: ****
      connectProtocol: “tcp”
      user: ****
      password: ****

Need help on this. Please guide if I am missing anything.

@tihomir @maxim Request you to please guide on the same

Want to understand if there is any way to set the connection URL parameters with this configuration : ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory or way to pass CA certificate.

Yugabyte posted this blog that might be of interest to you: Getting Started with YugabyteDB, Temporal, and the Temporal-Maru Benchmarking Tool - The Distributed SQL Blog

Hi Poojab,
I work for Yugabyte and based on the error you may need to adjust your yugabytedb as well:
please refer to this doc for setting up the hba__conf_csv with yugabyte;

2 Likes