Deploying gnocchi fails on db-init with postgresql root password defined.

Bug #1749177 reported by Marcus Zoller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-helm
Fix Released
Undecided
Marcus Zoller

Bug Description

Deploying gnocchi fails if postgresql was deployed with a root password.

Example:

helm install --name=postgresql ${WORK_DIR}/postgresql --namespace=openstack \
  --set endpoints.postgresql.auth.admin.username="root" \
  --set endpoints.postgresql.auth.admin.password="supersecret"

helm install --name=gnocchi ${WORK_DIR}/gnocchi --namespace=openstack \
  --set endpoints.oslo_db_postgresql.auth.admin.username="root" \
  --set endpoints.oslo_db_postgresql.auth.admin.password="supersecret" \

The gnocchi-db-init-indexer will fail to create the database because _db_init.sh.tpl ignores the configured root password on function pgsql_superuser_cmd. This can be fixed by adding:

  PGPASSWORD=$ROOT_DB_PASS

before executing the pgsql command. PGPASSWORD seems to be deprecated but still works fine.

Tags: gnocchi
Marcus Zoller (coboluxx)
Changed in openstack-helm:
assignee: nobody → Marcus (coboluxx)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-helm (master)

Fix proposed to branch: master
Review: https://review.openstack.org/543973

Marcus Zoller (coboluxx)
Changed in openstack-helm:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-helm (master)

Reviewed: https://review.openstack.org/543973
Committed: https://git.openstack.org/cgit/openstack/openstack-helm/commit/?id=57b3aece1ff394f9b27c765fd2d2f8e278b32bf0
Submitter: Zuul
Branch: master

commit 57b3aece1ff394f9b27c765fd2d2f8e278b32bf0
Author: Marcus <email address hidden>
Date: Tue Feb 13 16:26:44 2018 +0100

    Fixes gnocchi with postgresql deployment if running on different hosts

    a) The db-init method ignores the configured admin password.

    This seems to work if db-init was scheduled to the same host as
    postgresql is running on but fails on a remote connection. This change
    sets the PGPASSWORD variable to the provided admin password.

    b) Fixed liveness and readiness probe for postgresql

    While this seems to work it continously outputs the message
    "psql: FATAL: role "root" does not exist"

    This change adds the admin username as argument to pg_isready
    to stop this message.

    Update: Making the linter happy ;-)

    Change-Id: I59b47a8724065d08203c29172c15350aaa785203
    Closes-Bug: #1749177

Changed in openstack-helm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.