Bug 1632273
| Summary: | Removing cluster logging failed at TASK [openshift_logging : Cleaning up temp dir] | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | mikolaj.ciecierski |
| Component: | Logging | Assignee: | ewolinet |
| Status: | CLOSED ERRATA | QA Contact: | Qiaoling Tang <qitang> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.10.0 | CC: | aos-bugs, ewolinet, jokerman, mikolaj.ciecierski, mmccomas, rmeggins |
| Target Milestone: | --- | ||
| Target Release: | 3.10.z | ||
| Hardware: | All | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause: Inconsistent user usage when creating and removing temp dirs.
Consequence: Removing can fail if user does not have proper access.
Fix: Update so tasks use same become:false settings
Result: Removing doesn't fail when using different user.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-12-13 17:09:08 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: | |||
Can verify you are using the version of openshift-ansible you're specifying? This commit [1] shows that we have ansible_become: false for the creation of that temp dir. [1] https://github.com/openshift/openshift-ansible/pull/9093/commits/6faa9063e62cacdcb2ceded52ccfc39f28f8d517 I am using openshift-ansible-3.10.47-1.git.0.95bc2d2.el7_5.noarch. I think the problem is in different place, in these two tasks: https://github.com/openshift-cherrypick-robot/openshift-ansible/blob/6faa9063e62cacdcb2ceded52ccfc39f28f8d517/roles/openshift_logging/tasks/main.yaml#L6 https://github.com/openshift-cherrypick-robot/openshift-ansible/blob/6faa9063e62cacdcb2ceded52ccfc39f28f8d517/roles/openshift_logging/tasks/main.yaml#L106 Cleaning up temp dir task removes folder which path is registered in 'mtemp' variable. @Mikolaj, Sorry for the delay. It looks like the issue may be that we create the mktemp dir without 'become: false' but when we clean it up we have 'become: false' on the task. Can you verify that is able to resolve the issue for you? Yes, this fix will resolve my issue. Verified in: openshift-ansible-playbooks-3.10.79-1.git.0.10daf7d.el7.noarch openshift-ansible-docs-3.10.79-1.git.0.10daf7d.el7.noarch ansible-2.4.3.0-1.el7ae.noarch openshift-ansible-roles-3.10.79-1.git.0.10daf7d.el7.noarch openshift-ansible-3.10.79-1.git.0.10daf7d.el7.noarch 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/RHBA-2018:3750 |
Description of problem: Removing logging stack failed at TASK [openshift_logging : Cleaning up temp dir] . Version-Release number of the following components: rpm -q openshift-ansible - openshift-ansible-3.10.47-1.git.0.95bc2d2.el7_5.noarch rpm -q ansible - ansible-2.4.3.0-1.el7ae.noarch ansible --version - ansible 2.4.3.0 How reproducible: Steps to Reproduce: 1.Run playbook responsible for removing logging stack for OCP 3.10 2. 3. Actual results: Temporary folder is not deleted at the end of uninstallation process causing ansible to fail. The temp directory is created as a root in task [openshift_logging : Create temp directory for doing work in], [openshift_logging : Cleaning up temp dir] task has become flag set to false. TASK [openshift_logging : Cleaning up temp dir] ******************************************************** he full traceback is: File "/tmp/ansible_ezDs7G/ansible_module_file.py", line 278, in main shutil.rmtree(b_path, ignore_errors=False) File "/usr/lib64/python2.7/shutil.py", line 239, in rmtree onerror(os.listdir, path, sys.exc_info()) File "/usr/lib64/python2.7/shutil.py", line 237, in rmtree names = os.listdir(path) fatal: [master]: FAILED! => { "changed": false, "invocation": { "module_args": { "attributes": null, "backup": null, "content": null, "delimiter": null, "diff_peek": null, "directory_mode": null, "follow": false, "force": false, "group": null, "mode": null, "original_basename": null, "owner": null, "path": "/tmp/openshift-logging-ansible-bJjNgu", "recurse": false, "regexp": null, "remote_src": null, "selevel": null, "serole": null, "setype": null, "seuser": null, "src": null, "state": "absent", "unsafe_writes": null, "validate": null } }, "msg": "rmtree failed: [Errno 13] Permission denied: '/tmp/openshift-logging-ansible-bJjNgu'" } Expected results: [openshift_logging : Cleaning up temp dir] task removes temp directory. Additional info: