Bug 1450370 - [containers] Minimal overcloud deployment failed due to MariaDB issues - mysqld: unknown option '--wsrep-new-cluster'
Summary: [containers] Minimal overcloud deployment failed due to MariaDB issues - mys...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-containers
Version: 12.0 (Pike)
Hardware: x86_64
OS: Linux
high
high
Target Milestone: Upstream M2
: 12.0 (Pike)
Assignee: Chris Jones
QA Contact: Alexander Chuzhoy
Andrew Burden
URL:
Whiteboard:
: 1456977 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-12 10:56 UTC by Artem Hrechanychenko
Modified: 2017-12-13 19:14 UTC (History)
10 users (show)

Fixed In Version: openstack-mariadb-docker-12.0-20170615.2
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2017-12-13 19:14:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
/var/log/messages from controller node (2.31 MB, text/plain)
2017-05-12 12:02 UTC, Artem Hrechanychenko
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1691697 0 None None None 2017-05-18 08:46:17 UTC
Red Hat Product Errata RHEA-2017:3457 0 normal SHIPPED_LIVE Red Hat OpenStack Platform 12.0 Containers Enhancement Advisory 2017-12-14 04:45:51 UTC

Description Artem Hrechanychenko 2017-05-12 10:56:55 UTC
Description of problem:
I tried to deploy minimal(1 controller + 1 compute) overcloud OSP12 with containerized openstack services and received failure.
http://pastebin.test.redhat.com/483599


Version-Release number of selected component (if applicable):
RHOSP 12

How reproducible:
Always

Steps to Reproduce:
1.Execute steps from http://etherpad.corp.redhat.com/testing-osp12-containers
2.Before Overcloud deployment - apply workaround for bug - https://bugzilla.redhat.com/show_bug.cgi?id=1448482http://paste.openstack.org/show/609370/
3.

Actual results:
Heat Stack create failed.

Expected results:

Heat Stack created 
Additional info:

Comment 1 Red Hat Bugzilla Rules Engine 2017-05-12 10:57:00 UTC
This bugzilla has been removed from the release and needs to be reviewed and Triaged for another Target Release.

Comment 2 Artem Hrechanychenko 2017-05-12 12:02:17 UTC
Created attachment 1278144 [details]
/var/log/messages from controller node

/var/log/messages from controller node

Comment 3 Jiri Stransky 2017-05-12 12:35:48 UTC
The mysql_bootstrap returned 1 but mysql container happily runs:

http://pastebin.test.redhat.com/483771

Comment 4 Jiri Stransky 2017-05-12 12:41:35 UTC
I dug up the log file from the stopped mysql_bootstrap container. The root cause is:

170512 10:39:47 [ERROR] /usr/libexec/mysqld: unknown option '--wsrep-new-cluster'

Looks like the downstream binary we're using doesn't support galera clustering.


170512 10:39:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170512 10:39:45 [Warning] option 'open_files_limit': unsigned value 18446744073709551615 adjusted to 4294967295
170512 10:39:45 [Warning] option 'open_files_limit': unsigned value 18446744073709551615 adjusted to 4294967295
170512 10:39:45 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process 566 ...
170512 10:39:45 InnoDB: The InnoDB memory heap is disabled
170512 10:39:45 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170512 10:39:45 InnoDB: Compressed tables use zlib 1.2.7
170512 10:39:45 InnoDB: Using Linux native AIO
170512 10:39:45 InnoDB: Initializing buffer pool, size = 128.0M
170512 10:39:45 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
170512 10:39:45  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
170512 10:39:45  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
170512 10:39:45  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
170512 10:39:46  InnoDB: Waiting for the background threads to start
170512 10:39:47 Percona XtraDB (http://www.percona.com) 5.5.49-MariaDB-38.0 started; log sequence number 0
170512 10:39:47 [Note] Plugin 'FEEDBACK' is disabled.
170512 10:39:47 [ERROR] /usr/libexec/mysqld: unknown option '--wsrep-new-cluster'
170512 10:39:47 [ERROR] Aborting

170512 10:39:47  InnoDB: Starting shutdown...
170512 10:39:47  InnoDB: Shutdown completed; log sequence number 1597945
170512 10:39:47 [Note] /usr/libexec/mysqld: Shutdown complete

170512 10:39:47 mysqld_safe mysqld from pid file /var/lib/mysql/mariadb.pid ended
~

Comment 5 Jiri Stransky 2017-05-12 12:51:33 UTC
Yea `/usr/libexec/mysqld --verbose --help | grep wsrep` doesn't print anything, while on upstream environment it prints the replication-related options.

Comment 6 Jiri Stransky 2017-05-12 12:57:36 UTC
()[mysql@overcloud-controller-0 /var/lib/mysql]$ rpm -qa | grep maria
mariadb-libs-5.5.52-1.el7.x86_64
mariadb-server-5.5.52-1.el7.x86_64
mariadb-5.5.52-1.el7.x86_64

()[mysql@overcloud-controller-0 /var/lib/mysql]$ rpm -qa | grep galera                            
galera-25.3.5-7.el7ost.x86_64

Damien/Michele, can either of you tell what we're doing wrong that we don't have clustering support in our MariaDB server?

Comment 7 Martin André 2017-05-12 18:33:23 UTC
For upstream containers we're using mariadb 10 coming from RDO, if I'm not mistaken.

(undercloud) [stack@undercloud ~]$ docker images | grep maria
192.168.24.1:8787/tripleoupstream/centos-binary-mariadb                         latest              71036f555ff5        10 hours ago        598.6 MB
docker.io/tripleoupstream/centos-binary-mariadb                                 latest              1f6497469546        9 days ago          599.1 MB
192.168.24.1:8787/tripleoupstream/centos-binary-mariadb                         <none>              1f6497469546        9 days ago          599.1 MB
(undercloud) [stack@undercloud ~]$ docker run -ti --rm 71036f555ff5 bash
()[mysql@e6c68ba13a2c /]$ rpm -qa *mariadb*
mariadb-config-10.1.20-1.el7.x86_64
mariadb-libs-10.1.20-1.el7.x86_64
mariadb-server-10.1.20-1.el7.x86_64
mariadb-common-10.1.20-1.el7.x86_64
mariadb-errmsg-10.1.20-1.el7.x86_64
mariadb-10.1.20-1.el7.x86_64
()[mysql@e6c68ba13a2c /]$ rpm -qa *galera*
galera-25.3.16-1.el7.x86_64

()[mysql@e6c68ba13a2c /]$ yum info mariadb-server
Loaded plugins: fastestmirror, ovl, priorities
ovl: Error while doing RPMdb copy-up:
[Errno 13] Permission denied: '/var/lib/rpm/.dbenv.lock'
Loading mirror speeds from cached hostfile
 * base: centos.mirrors.ovh.net
 * epel: mirror.uni-trier.de
 * extras: centos.mirror.fr.planethoster.net
 * updates: centos.mirror.fr.planethoster.net
27 packages excluded due to repository priority protections
Installed Packages
Name        : mariadb-server
Arch        : x86_64
Epoch       : 3
Version     : 10.1.20
Release     : 1.el7
Size        : 92 M
Repo        : installed
From repo   : delorean-pike-testing
Summary     : The MariaDB server and related files
URL         : http://mariadb.org
License     : GPLv2 with exceptions and LGPLv2 and BSD
Description : MariaDB is a multi-user, multi-threaded SQL database server. It is a
            : client/server implementation consisting of a server daemon (mysqld)
            : and many different client programs and libraries. This package contains
            : the MariaDB server and some accompanying files and directories.
            : MariaDB is a community developed branch of MySQL.

Comment 8 Damien Ciabrini 2017-05-15 11:11:12 UTC
The ongoing reviews we have for overcloud HA don't use mariadb-server in the mysql kolla image, they use mariadb-server-galera [1]

It looks like this is necessary as well for default non-HA overcloud deployments?

Could you perhaps update the mysql image you're using on your local registry to use mariadb-server-galera and see if deploys passes?
 
[1] https://review.openstack.org/#/c/456174/5/container-images/tripleo_kolla_template_overrides.j2

Comment 9 Alexander Chuzhoy 2017-05-17 20:17:10 UTC
Reproduced.
Checking the overcloud stack for failures the following is shown under stderr:

  deploy_stderr: |
    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__:Writing out command to execute
    INFO:__main__:Setting permission for /var/lib/mysql
    170517 19:46:35 [Warning] option 'open_files_limit': unsigned value 18446744073709551615 adjusted to 4294967295
    170517 19:46:35 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process 51 ...
    170517 19:46:35 [Warning] option 'open_files_limit': unsigned value 18446744073709551615 adjusted to 4294967295
    170517 19:46:35 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process 59 ...


The error in comment #4 is found in /var/log/containers/mysql/mariadb.log:

170517 19:46:37 [ERROR] /usr/libexec/mysqld: unknown option '--wsrep-new-cluster'

Comment 10 Jiri Stransky 2017-05-18 09:46:03 UTC
Thanks Damien! You were right, and we produced a workaround with Artem today (the only difference is that the downstream package is called mariadb-galera-server).

After downloading images from registry, right before deploying the overcloud, build an image which has the correct package installed inside, and push it to the undercloud registry:

https://paste.fedoraproject.org/paste/aMscm5CV1VPhz-4AYVyoXl5M1UNdIGYhyRLivL9gydE=/raw

After that, edit docker-osp12.yaml file to point to the correct image tag:

  DockerMysqlImage: openstack-mariadb-docker:workaround

And then deploy the overcloud. All mariadb containers look fine:

[root@overcloud-controller-0 ~]# docker ps -a | grep mariadb
808760d1b2fa        192.168.24.1:8787/rhosp12/openstack-mariadb-docker:workaround       "kolla_start"            11 minutes ago      Up 11 minutes                                   mysql
2e7898d79a55        192.168.24.1:8787/rhosp12/openstack-mariadb-docker:workaround       "bash -c 'test -e /va"   11 minutes ago      Exited (0) 11 minutes ago                       mysql_bootstrap
6c8321d59ccc        192.168.24.1:8787/rhosp12/openstack-mariadb-docker:workaround       "/bin/bash -c 'chown "   11 minutes ago      Exited (0) 11 minutes ago                       mysql_init_logs

Comment 11 Alexander Chuzhoy 2017-05-18 14:42:19 UTC
I had to restart mariadb on the undercloud before re-running the overcloud deployment, following the workaround. Otherwise the OC deployment fails right away with:
Started Mistral Workflow tripleo.validations.v1.check_pre_deployment_validations. Execution ID: 6607c30a-5dc3-43b0-864d-1bd4c2e72f1f
{u'body': {u'exception': u'(pymysql.err.OperationalError) (2006, "MySQL server has gone away (error(32, \'Broken pipe\'))") [SQL: u\'INSERT INTO `Queues` (project, name, metadata) VALUES (%(project)s, %(name)s, %(metadata)s)\'] [parameters: {\'project\': u\'1257fc583b28440aa6db50b81278ded7\', \'name\': u\'45e36286-7cc6-4290-9058-b48912c0e525\', \'metadata\': bytearray(b\'{}\')}]', u'error': u'Unexpected error.'}, u'headers': {u'status': 500}, u'request': {u'action': u'queue_create', u'body': {u'queue_name': u'45e36286-7cc6-4290-9058-b48912c0e525'}, u'api': u'v2', u'headers': {u'Client-ID': u'c2cca7a4-f844-44c9-b382-ff91f097b240', u'X-Project-ID': u'1257fc583b28440aa6db50b81278ded7'}}}

Comment 12 Artem Hrechanychenko 2017-05-18 15:03:36 UTC
Yeah, I also had to restart mariadb, forgot to write this info. Thx!

Comment 13 Michele Baldessari 2017-05-19 06:50:52 UTC
About the mariadb hiccup..I see that one as well from time to time. I opened this upstream bug to track it: https://bugs.launchpad.net/tripleo/+bug/1691951

Comment 14 Jiri Stransky 2017-05-26 08:59:18 UTC
Apparently fpaste expires in a very short time nowadays, the workaround from #10 is gone. Pasting it here instead, it's not that long after all.

mkdir -p mariadb-workaround
echo > mariadb-workaround/Dockerfile \
'FROM 192.168.24.1:8787/rhosp12/openstack-mariadb-docker:2017-05-02.2

USER root
RUN curl -O http://rhos-release.virt.bos.redhat.com/repos/rhos-release/rhos-release-latest.noarch.rpm && rpm -ivh rhos-release-latest.noarch.rpm && rhos-release 12-director -d
RUN yum -y remove mariadb-server && yum -y install mariadb-galera-server
USER mysql
'

docker build --rm -t 192.168.24.1:8787/rhosp12/openstack-mariadb-docker:workaround ~/mariadb-workaround
docker push 192.168.24.1:8787/rhosp12/openstack-mariadb-docker:workaround

Comment 15 Martin André 2017-05-31 10:02:19 UTC
*** Bug 1456977 has been marked as a duplicate of this bug. ***

Comment 16 Alexander Chuzhoy 2017-05-31 14:03:46 UTC
In addition to comment #14:
After that, edit docker-osp12.yaml file to point to the correct image tag:

  DockerMysqlImage: openstack-mariadb-docker:workaround


(this was already mentioned in comment #10).

Comment 17 Damien Ciabrini 2017-06-16 14:44:38 UTC
Quick update here, the next openstack-mariadb-docker image will contain the fix discussed in comment #14.

Comment 18 Dan Prince 2017-06-16 15:12:24 UTC
Assigning to Chris as UA. Thanks for the updates Damien.

Comment 19 Omri Hochman 2017-06-19 13:18:04 UTC
(In reply to Alexander Chuzhoy from comment #16)
> In addition to comment #14:
> After that, edit docker-osp12.yaml file to point to the correct image tag:
> 
>   DockerMysqlImage: openstack-mariadb-docker:workaround
> 
> 
> (this was already mentioned in comment #10).

I think it's already included,  what takes this bug to ON_QA ?

Comment 22 Alexander Chuzhoy 2017-06-19 18:17:51 UTC
Verified:
openstack-mariadb-docker                     2017-06-15.2

The reported issue doesn't reproduce.

Comment 27 errata-xmlrpc 2017-12-13 19:14:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:3457


Note You need to log in before you can comment on or make changes to this bug.