Bifrost image's mysqldb module is broken

Bug #1673420 reported by Thomas O'Neill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Invalid
Undecided
Unassigned

Bug Description

When this is ran from the bifrost bootstrap playbook:

/bifrost/scripts/env-setup.sh && source /bifrost/env-vars && cp /etc/bifrost/rabbitmq-env.conf /etc/rabbitmq/rabbitmq-env.conf && ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target /bifrost/playbooks/install.yaml -e @/etc/bifrost/bifrost.yml -e @/etc/bifrost/dib.yml -e skip_package_install=true

This error is produced:

TASK [bifrost-ironic-install : MySQL - Creating DB] ****************************
task path: /bifrost-base-source/bifrost-3.0.1.dev49/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml:83
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1489660210.61-247573632927940 `" && echo ansible-tmp-1489660210.61-247573632927940="` echo $HOME/.ansible/tmp/ansible-tmp-1489660210.61-247573632927940 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpRiWG5Y TO /root/.ansible/tmp/ansible-tmp-1489660210.61-247573632927940/mysql_db
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1489660210.61-247573632927940/ /root/.ansible/tmp/ansible-tmp-1489660210.61-247573632927940/mysql_db && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 http_proxy='"'"''"'"' LC_MESSAGES=en_US.UTF-8 https_proxy='"'"''"'"' /var/lib/kolla/venv/bin/python /root/.ansible/tmp/ansible-tmp-1489660210.61-247573632927940/mysql_db; rm -rf "/root/.ansible/tmp/ansible-tmp-1489660210.61-247573632927940/" > /dev/null 2>&1 && sleep 0'
fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"collation": "", "config_file": "/root/.my.cnf", "connect_timeout": 30, "encoding": "utf8", "login_host": "localhost", "login_password": "", "login_port": 3306, "login_unix_socket": null, "login_user": "root", "name": "ironic", "quick": true, "single_transaction": false, "ssl_ca": null, "ssl_cert": null, "ssl_key": null, "state": "present", "target": null}, "module_name": "mysql_db"}, "msg": "the python mysqldb module is required"}

This is resolved by re-installing the MySQL-python package (weirdly an attempt at downgrading this package from 1.2.5 to 1.2.4 results in a strange runtime/IO error see here http://termbin.com/zj6k ).

And a more isolated test:

()[root@b19b32a664c9 bifrost-3.0.1.dev49]# ansible localhost, -m mysql_db -a "name=ironic"
 [WARNING]: Host file not found: /etc/ansible/hosts

 [WARNING]: provided hosts list is empty, only localhost is available

localhost | FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "the python mysqldb module is required"
}

pip uninstall MySQL-python
pip install MySQL-python

And it is resolved

()[root@b19b32a664c9 bifrost-3.0.1.dev49]# ansible localhost, -m mysql_db -a "name=ironic"
localhost | FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "unable to find /root/.my.cnf. Exception message: (2002, \"Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)\")"
}

Looks like a python egg/packaging issue. Can this be confirmed by others?

Revision history for this message
Thomas O'Neill (tomatopeel) wrote :
Download full text (5.3 KiB)

Image history:

IMAGE CREATED CREATED BY SIZE COMMENT
6504a0b85a0d 51 minutes ago /bin/sh -c #(nop) CMD ["/sbin/init"] 0 B
40b522a4e00e 51 minutes ago /bin/sh -c apt-get -y install --no-install... 0 B
b9fb39b10aed 52 minutes ago /bin/sh -c rm -f $(find /lib/systemd/syste... 0 B
61ad3ed1370e 52 minutes ago /bin/sh -c #(nop) ENV container=docker 0 B
c0d7696b2e28 52 minutes ago /bin/sh -c #(nop) MAINTAINER Kolla Projec... 0 B
77be2364a256 52 minutes ago /bin/sh -c chmod 750 /etc/sudoers.d &&... 70 B
81a9d4c5b5ca 52 minutes ago /bin/sh -c #(nop) COPY file:af6825f1e9c206... 31 B
7fa8255758c2 52 minutes ago /bin/sh -c bash -c './scripts/env-setup.sh... 698 MB
3d2b2e6a0745 59 minutes ago /bin/sh -c sed -e "s/.*mariadb.*//Ig" -i /... 751 kB
a4e7d6345be2 59 minutes ago /bin/sh -c #(nop) WORKDIR /bifrost 0 B
2113e85fa5e7 59 minutes ago /bin/sh -c ln -s bifrost-base-source/* bif... 96.6 kB
cc38b286889f 59 minutes ago /bin/sh -c #(nop) COPY file:6c7beb4546887a... 88 B
cb9121081407 59 minutes ago /bin/sh -c #(nop) ADD file:d33442b6202c78a... 585 kB
de02eb0719d9 59 minutes ago /bin/sh -c #(nop) ENV VENV=/var/lib/kolla... 0 B
f8bcc118f7b8 59 minutes ago /bin/sh -c usermod --append --home /var/li... 14.2 kB
c4134bcf8295 59 minutes ago /bin/sh -c #(nop) MAINTAINER Kolla Projec... 0 B
b5da2a7f0ea9 22 hours ago /bin/sh -c pip --no-cache-dir install --up... 145 MB
89dbf2be8c36 22 hours ago /bin/sh -c #(nop) ENV PATH=/var/lib/kolla... 0 B
960bc7f0bbdb 22 hours ago /bin/sh -c ln -s openstack-base-source/* /... 15.4 MB
6f5e7f0a8e8b 22 hours ago /bin/sh -c #(nop) ADD file:fc7bf8880d1b81e... 409 kB
03c2c08ecc79 22 hours ago /bin/sh -c curl https://bootstrap.pypa.io/... 11.4 MB
4844d35206ea 22 hours ago /bin/sh -c apt-get -y install --no-install... 300 MB
0320db143706 22 hours ago /bin/sh -c #(nop) MAINTAINER Kolla Projec... 0 B
f033550c4534 22 hours ago /bin/sh -c #(nop) CMD ["kolla_start"] 0 B
9780bf024878 22 hours ago /bin/sh -c touch /usr/local/bin/kolla_exte... 15.4 kB
48052352c611 22 hours ago /bin/sh -c curl -sSL https://github.com/Ye... 43.3 kB
50d611b30d0e 22 hours ago /bin/sh -c #(nop) COPY file:7e421a8be68369... 154 B
512f39b040af 22 hours ago /bin/sh -c #(nop) COPY file:fc65d796db70a9... 799 B
74fb1f76d996 22 hours ago /bin/sh -c #(nop) COPY file:891f327524f4f2... 699 B
48fbe07173f6 22 hours ago /bin/sh -c #(nop) COPY file:f28083ac686652... 13.9 kB
6793d5929242 22 hours ago /bin/sh -c sed -i -e "s|\('purelib... 28 kB
16af0c0849c3 22 hours ago /bin/sh -c apt-get update && apt-get -... 92 MB
d66915619a07 22 hours ago /bin/sh -c apt-key adv --...

Read more...

Revision history for this message
sayantani (sayantani.goswami) wrote :

There is already a bug open for the issue:
https://bugs.launchpad.net/kolla-ansible/+bug/1658840

I have a patch open for the same here:
https://review.openstack.org/#/c/424391/

Changed in kolla:
status: New → Confirmed
Revision history for this message
Thomas O'Neill (tomatopeel) wrote :

I've also submitted a fix: https://review.openstack.org/446609

Different to yours, but also resolves the missing iptables dependency and I think this addresses the problem at a more root-cause level, however the hackish sed line is still in play here, perhaps it ought to be re-thought.

Changed in kolla:
status: Confirmed → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla (master)

Change abandoned by Mark Goddard (<email address hidden>) on branch: master
Review: https://review.opendev.org/446609
Reason: Very old

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.