[upgrade] MySQL upgrade tasks failing during upgrade

Bug #1853162 reported by Jose Luis Franco
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Jose Luis Franco

Bug Description

When running the upgrade from Rocky to Stein it did fail again with :

TASK [Upgrade Mysql database from a temporary container] ***********************
Tuesday 19 November 2019 09:26:01 -0500 (0:00:00.308) 0:09:07.672 ******
fatal: [controller-0]: FAILED! => {"changed": true, "cmd": "podman run --rm --log-driver=k8s-file --log-opt path=LOG_DIR/db-upgrade.log -u root --net=host -e \"KOLLA_CONFIG_
STRATEGY=COPY_ALWAYS\" -v /etc/hosts:/etc/hosts:ro -v /etc/localtime:/etc/localtime:ro -v /etc/pki/ca-trust/extracted:/etc/pki/ca-trust/extracted:ro -v /etc/pki/ca-trust/sou
rce/anchors:/etc/pki/ca-trust/source/anchors:ro -v /etc/pki/tls/certs/ca-bundle.crt:/etc/pki/tls/certs/ca-bundle.crt:ro -v /etc/pki/tls/certs/ca-bundle.trust.crt:/etc/pki/tl
s/certs/ca-bundle.trust.crt:ro -v /etc/pki/tls/cert.pem:/etc/pki/tls/cert.pem:ro -v /dev/log:/dev/log -v /etc/ssh/ssh_known_hosts:/etc/ssh/ssh_known_hosts:ro -v /etc/puppet:
/etc/puppet:ro -v /var/lib/kolla/config_files/mysql.json:/var/lib/kolla/config_files/config.json:rw,z -v /var/lib/config-data/puppet-generated/mysql/:/var/lib/kolla/config_f
iles/src:ro,z -v /var/lib/mysql:/var/lib/mysql:rw,z -v /tmp/mariadb-upgrade:/var/log/mariadb:rw,z \"192.168.24.1:8787/rh-osbs/rhosp15-openstack-mariadb:pcmklatest\" /bin/bas
h -ecx \"kolla_set_configs; if mysqladmin ping --silent; then exit 0; fi; chown -R mysql:mysql /var/lib/mysql; chown -R mysql:mysql /var/log/mariadb; mysqld_safe --user=mysq
l --wsrep-provider=none --skip-networking --wsrep-on=off & timeout 60 sh -c 'while ! mysqladmin ping --silent; do sleep 1; done'; mysql_upgrade; mysqladmin shutdown\"", "del
ta": "0:00:01.113447", "end": "2019-11-19 14:26:01.884729", "msg": "non-zero return code", "rc": 127, "start": "2019-11-19 14:26:00.771282", "stderr": "[conmon:e]: Failed to
 open log file No such file or directory\nError: write child: broken pipe", "stderr_lines": ["[conmon:e]: Failed to open log file No such file or directory", "Error: write c
hild: broken pipe"], "stdout": "", "stdout_lines": []}

NO MORE HOSTS LEFT *************************************************************

PLAY RECAP *********************************************************************
controller-0 : ok=146 changed=59 unreachable=0 failed=1 skipped=245 rescued=0 ignored=1

Tuesday 19 November 2019 09:26:02 -0500 (0:00:01.365) 0:09:09.038 ******
===============================================================================

It seems there is a typo in the fix and the LOG_DIR parameter didn't get replaced: https://review.opendev.org/#/c/693773/2/deployment/database/mysql-pacemaker-puppet.yaml@598 as the parameter was named LOGDIR.

Doing some manual testing in the env passing the right log directory made the command succeed:

[root@controller-0 heat-admin]# podman run --rm --log-driver=k8s-file --log-opt path=/var/log/containers/mysql/db-upgrade.log -u root --net=host -e "KOLLA_CONFIG_STRATEGY=CO
PY_ALWAYS" -v /etc/hosts:/etc/hosts:ro -v /etc/localtime:/etc/localtime:ro -v /etc/pki/ca-trust/extracted:/etc/pki/ca-trust/extracted:ro -v /etc/pki/ca-trust/source/anchors:
/etc/pki/ca-trust/source/anchors:ro -v /etc/pki/tls/certs/ca-bundle.crt:/etc/pki/tls/certs/ca-bundle.crt:ro -v /etc/pki/tls/certs/ca-bundle.trust.crt:/etc/pki/tls/certs/ca-b
undle.trust.crt:ro -v /etc/pki/tls/cert.pem:/etc/pki/tls/cert.pem:ro -v /dev/log:/dev/log -v /etc/ssh/ssh_known_hosts:/etc/ssh/ssh_known_hosts:ro -v /etc/puppet:/etc/puppet:
ro -v /var/lib/kolla/config_files/mysql.json:/var/lib/kolla/config_files/config.json:rw,z -v /var/lib/config-data/puppet-generated/mysql/:/var/lib/kolla/config_files/src:ro,
z -v /var/lib/mysql:/var/lib/mysql:rw,z -v /tmp/mariadb-upgrade:/var/log/mariadb:rw,z "192.168.24.1:8787/rh-osbs/rhosp15-openstack-mariadb:pcmklatest" /bin/bash -ecx "kolla_
set_configs; if mysqladmin ping --silent; then exit 0; fi; chown -R mysql:mysql /var/lib/mysql; chown -R mysql:mysql /var/log/mariadb; mysqld_safe --user=mysql --wsrep-provi
der=none --skip-networking --wsrep-on=off & timeout 60 sh -c 'while ! mysqladmin ping --silent; do sleep 1; done'; mysql_upgrade; mysqladmin shutdown"
+ kolla_set_configs
INFO:__main__:Loading config file at /var/lib/kolla/config_files/config.json
INFO:__main__:Validating config file
INFO:__main__:Kolla config strategy set to: COPY_ALWAYS
INFO:__main__:Copying service configuration files
INFO:__main__:Copying /dev/null to /etc/libqb/force-filesystem-sockets
INFO:__main__:Setting permission for /etc/libqb/force-filesystem-sockets
INFO:__main__:Deleting /etc/my.cnf.d/galera.cnf
INFO:__main__:Copying /var/lib/kolla/config_files/src/etc/my.cnf.d/galera.cnf to /etc/my.cnf.d/galera.cnf
INFO:__main__:Copying /var/lib/kolla/config_files/src/etc/sysconfig/clustercheck to /etc/sysconfig/clustercheck
INFO:__main__:Copying /var/lib/kolla/config_files/src/root/.my.cnf to /root/.my.cnf
INFO:__main__:Writing out command to execute
+ mysqladmin ping --silent
+ chown -R mysql:mysql /var/lib/mysql
+ chown -R mysql:mysql /var/log/mariadb
+ timeout 60 sh -c 'while ! mysqladmin ping --silent; do sleep 1; done'
+ mysqld_safe --user=mysql --wsrep-provider=none --skip-networking --wsrep-on=off
191119 15:22:30 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.opendev.org/695017

Changed in tripleo:
assignee: nobody → Jose Luis Franco (jfrancoa)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.opendev.org/695017
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=94aca797e009e3f6ab22ade9350a87ddfd14f588
Submitter: Zuul
Branch: master

commit 94aca797e009e3f6ab22ade9350a87ddfd14f588
Author: Jose Luis Franco Arza <email address hidden>
Date: Tue Nov 19 16:39:30 2019 +0100

    Fix typo in MySQL upgrade tasks.

    The upgrade tasks are failing because podman can't locate
    the log output file during the MySQL upgrade step. The
    parameter LOG_DIR was misswritten into LOGDIR and Heat
    could not subsitute it.

    Change-Id: I19a7b8495a4510bff59feff43a6042da0e74eb5a
    Closes-Bug: #1853162

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/695110

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/695111

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/train)

Reviewed: https://review.opendev.org/695110
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=819d577b82ae3f392769a41485f094de6b414bd6
Submitter: Zuul
Branch: stable/train

commit 819d577b82ae3f392769a41485f094de6b414bd6
Author: Jose Luis Franco Arza <email address hidden>
Date: Tue Nov 19 16:39:30 2019 +0100

    Fix typo in MySQL upgrade tasks.

    The upgrade tasks are failing because podman can't locate
    the log output file during the MySQL upgrade step. The
    parameter LOG_DIR was misswritten into LOGDIR and Heat
    could not subsitute it.

    Change-Id: I19a7b8495a4510bff59feff43a6042da0e74eb5a
    Closes-Bug: #1853162
    (cherry picked from commit 94aca797e009e3f6ab22ade9350a87ddfd14f588)

tags: added: in-stable-train
tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/stein)

Reviewed: https://review.opendev.org/695111
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=4d99d7bddde757e7430a60bb024bd74bf6c73622
Submitter: Zuul
Branch: stable/stein

commit 4d99d7bddde757e7430a60bb024bd74bf6c73622
Author: Jose Luis Franco Arza <email address hidden>
Date: Tue Nov 19 16:39:30 2019 +0100

    Fix typo in MySQL upgrade tasks.

    The upgrade tasks are failing because podman can't locate
    the log output file during the MySQL upgrade step. The
    parameter LOG_DIR was misswritten into LOGDIR and Heat
    could not subsitute it.

    Change-Id: I19a7b8495a4510bff59feff43a6042da0e74eb5a
    Closes-Bug: #1853162
    (cherry picked from commit 94aca797e009e3f6ab22ade9350a87ddfd14f588)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 12.0.0

This issue was fixed in the openstack/tripleo-heat-templates 12.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 10.6.2

This issue was fixed in the openstack/tripleo-heat-templates 10.6.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 11.3.1

This issue was fixed in the openstack/tripleo-heat-templates 11.3.1 release.

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.