Bug 1735558

Summary: mysql-open-files-limit validation fails with failed to find container
Product: Red Hat OpenStack Reporter: Amit Ugol <augol>
Component: openstack-tripleo-validationsAssignee: Gaël Chamoulaud <gchamoul>
Status: CLOSED ERRATA QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: medium    
Version: 15.0 (Stein)CC: aschultz, beth.white, gchamoul, jbuchta, jjoyce, jschluet, pweeks, slinaber, tvignaud
Target Milestone: betaKeywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-08 16:54:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1731107    
Bug Blocks:    

Description Amit Ugol 2019-08-01 05:32:02 UTC
Description of problem:
Running mysql-open-files-limit validation fails because of failing to find a container called /bin/bash

<trim>
    b'SubjectAltNameWarning'
    b' [WARNING]: Could not match supplied host pattern, ignoring: Database'
    b"Task 'mysql-open-files-limit : Get the open_files_limit value' failed:"
    b'Host: controller-1'
    b'Message: Command `"podman" exec -u root $("podman" ps -q --filter "name=mysql|galera-bundle" | head -1) /bin/bash -c \'ulimit -n\'` exited with code: 125: non-zero return code'
    b'stderr:'
    b'    unable to exec into /bin/bash: no container with name or ID /bin/bash found: no such container'
    b"Task 'mysql-open-files-limit : Get the open_files_limit value' failed:"
    b'Host: controller-0'
    b'Message: Command `"podman" exec -u root $("podman" ps -q --filter "name=mysql|galera-bundle" | head -1) /bin/bash -c \'ulimit -n\'` exited with code: 125: non-zero return code'
    b'stderr:'
    b'    unable to exec into /bin/bash: no container with name or ID /bin/bash found: no such container'
    b"Task 'mysql-open-files-limit : Get the open_files_limit value' failed:"
    b'Host: controller-2'
    b'Message: Command `"podman" exec -u root $("podman" ps -q --filter "name=mysql|galera-bundle" | head -1) /bin/bash -c \'ulimit -n\'` exited with code: 125: non-zero return code'
    b'stderr:'
    b'    unable to exec into /bin/bash: no container with name or ID /bin/bash found: no such container'
    b'Failure! The validation failed for all hosts:'
    b'* controller-0'
    b'* controller-1'
    b'* controller-2'



Version-Release number of selected component (if applicable):
openstack-tripleo-validations-10.5.1-0.20190724100449.23ebc8a.el8ost.noarch

How reproducible:
100%

Steps to Reproduce:
1. run the mysql-open-files-limit validation

Comment 1 Gaël Chamoulaud 2019-08-01 11:00:15 UTC
This issue will be resolved once podman will support ps filter regular expressions.

https://github.com/containers/libpod/pull/3599
https://bugzilla.redhat.com/show_bug.cgi?id=1731107

Comment 3 Gaël Chamoulaud 2020-01-15 15:09:19 UTC
Works upstream with podman 1.5.1 and should work downstream as well.

(undercloud) [stack@undercloud ~]$ podman -v
podman version 1.5.1
(undercloud) [stack@undercloud ~]$ rpm -qa | grep podman
podman-manpages-1.5.1-3.el7.noarch
podman-1.5.1-3.el7.x86_64

(undercloud) [stack@undercloud ~]$ run-validations.sh --validation-name mysql-open-files-limit --ansible-default-callback --debug
ansible-playbook 2.8.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/usr/share/openstack-tripleo-validations/library']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /usr/bin/tripleo-ansible-inventory as it did not pass it's verify_file() method
Parsed /usr/bin/tripleo-ansible-inventory inventory source with script plugin
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc
Loading callback plugin fail_if_no_hosts of type old, v2.0 from /usr/share/openstack-tripleo-validations/callback_plugins/fail_if_no_hosts.pyc

PLAYBOOK: mysql-open-files-limit.yaml ********************************************************************************************************************
Positional arguments: /usr/share/openstack-tripleo-validations/playbooks/mysql-open-files-limit.yaml
...
...
...
...
ok: [overcloud-controller-0] => {
    "changed": false, 
    "cmd": "\"podman\" exec -u root $(\"podman\" ps -q --filter \"name=mysql|galera-bundle\" | head -1) /bin/bash -c 'ulimit -n'", 
    "delta": "0:00:02.013901", 
    "end": "2020-01-15 15:06:20.195362", 
    "invocation": {
        "module_args": {
            "_raw_params": "\"podman\" exec -u root $(\"podman\" ps -q --filter \"name=mysql|galera-bundle\" | head -1) /bin/bash -c 'ulimit -n'", 
            "_uses_shell": true, 
            "argv": null, 
            "chdir": null, 
            "creates": null, 
            "executable": null, 
            "removes": null, 
            "stdin": null, 
            "stdin_add_newline": true, 
            "strip_empty_ends": true, 
            "warn": true
        }
    }, 
    "rc": 0, 
    "start": "2020-01-15 15:06:18.181461", 
    "stderr": "", 
    "stderr_lines": [], 
    "stdout": "1048576", 
    "stdout_lines": [
        "1048576"
    ]
}

TASK [mysql-open-files-limit : Test the open-files-limit value] ******************************************************************************************
task path: /usr/share/openstack-tripleo-validations/roles/mysql-open-files-limit/tasks/main.yml:15
ok: [overcloud-controller-0] => {
    "changed": false, 
    "failed_when_result": false, 
    "msg": "The open_files_limit option for mysql must be higher than 16384. Right now it's 1048576.\n"
}
META: ran handlers
META: ran handlers

PLAY RECAP ***********************************************************************************************************************************************
overcloud-controller-0     : ok=4    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0