Hi All, I'm trying to deploy DataHub with Postgres...
# all-things-deployment
e
Hi All, I'm trying to deploy DataHub with Postgres.
postgresqlSetupJob
is failing to start, the username(dev_datahub_app_user) is passed as database name. Below is the error
Copy code
psql: error: connection to server at "<http://dev-datahub.cluster-cbcjxpl7jfef.us-east-1.rds.amazonaws.com|dev-datahub.cluster-cbcjxpl7jfef.us-east-1.rds.amazonaws.com>" (10.26.203.144), port 5432 failed: FATAL:  database "dev_datahub_app_user" does not exit

psql: error: connection to server at "<http://dev-datahub.cluster-cbcjxpl7jfef.us-east-1.rds.amazonaws.com|dev-datahub.cluster-cbcjxpl7jfef.us-east-1.rds.amazonaws.com>" (10.26.203.144), port 5432 failed: FATAL:  database "datahub" does not exist
2022/07/18 19:14:57 Command exited with error: exit status 2
Copy code
postgresqlSetupJob:
  enabled: true
  tolerations:
    - key: "app.lucid.cloud/tolerate-app"
      operator: "Equal"
      value: "generic"
      effect: "NoSchedule"
  image:
    repository: acryldata/datahub-postgres-setup
    tag: "v0.8.40"
  podSecurityContext:
    fsGroup: 1000
  securityContext:
    runAsUser: 1000

sql:
    enabled: true
    datasource:
      host: "${datahub_postgres_endpoint}:5432"
      hostForpostgresqlClient: "${datahub_postgres_endpoint}"
      port: "5432"
      url: "jdbc:postgres://${datahub_postgres_endpoint}:5432/datahub"
      driver: "org.postgresql.Driver"
      database: postgres
      username: "dev_datahub_app_user"
      password:
        secretRef: ${datahub_postgres_secrets}
        secretKey: ${datahub_postgres_password}
Datahub is expecting to have
db_name
same as
db_user
name, once I created the db_name same as db_user name it worked
😵 1
b
Hi Vamsi, you can remove entry "database: postgres"from above yaml file , database name is appended in sql.datasource.url after port which is 'datahub' in this case
e
Hi Navin, ya removed that. by creating database and db_user with same name solved the issue, Thank You!
w
@bumpy-needle-3184 is there a way to explicitly set the database name as opposed to assume it has the same name as the DB user?
As per @elegant-evening-28502’s logs the setup job complains about both a missing database “datahub” and “dev_datahub_app_user”