Bug 1746941
| Summary: | Glob not working as expected for ManageIQ plugin | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | David Luong <dluong> |
| Component: | sos | Assignee: | Pavel Moravec <pmoravec> |
| Status: | CLOSED ERRATA | QA Contact: | Miroslav HradĂlek <mhradile> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.7 | CC: | agk, bmr, jjansky, mhradile, plambri, sbradley |
| Target Milestone: | rc | Keywords: | OtherQA |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | sos-3.9-2.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-09-29 20:55:10 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: | |||
|
Description
David Luong
2019-08-29 14:39:01 UTC
manageiq plugin collects by default these log files:
/var/www/miq/vmdb/log/*.log
/var/www/miq/vmdb/log/apache/*.log
/var/www/miq/vmdb/log/*.txt
By default, it collects 25MB of data of each type. Sosreport orders files from newest to oldest (per mtime), and collects them. Once the 25MB limit is reached, the latest file is tailed only - that's why:
ansible_tower.log -> ../../../../../sos_strings/manageiq/var.www.miq.vmdb.log.ansible_tower.log.tailed
as this was the first file over the limit.
Workaround: call sosreport with option --log-size 40 (or whatever limit works for you, in MB)
Resolution:
- either increase the limit by default (trivial change),
- or impose it more granularly. Currently the limit is applied per the 3 logfile patterns individually. It is possible to apply it per individual files (that would have to be enumerated each and every one, or via some file pattern)
Could you please state what granularity and what size limits should be used to collect the logfiles?
To play with the stuff, see /usr/lib/python2.7/site-packages/sos/plugins/manageiq.py and miq_log_dir / miq_log_files / namely:
self.add_copy_spec([
os.path.join(self.miq_log_dir, x) for x in self.miq_log_files
])
(one can add sizelimit=40 as add_copy_spec method argument, or make the list more granular, or call add_copy_spec more times (with different sizelimit, optionally))
Please provide specification how to modify the current behaviour.
Hey Pavel, Thanks for the advice, I got around this by listing the specific log files individually for the ones that I can't predict the size for, eg, evm.log, production.log, etc. However, for the glob, it also looks like it limits it to 4 items. Any way to bypass this? Nevermind, there was something wrong with my pattern matching. (In reply to David Luong from comment #5) > Nevermind, there was something wrong with my pattern matching. Let me know if I can help here any way. (In reply to David Luong from comment #5) > Nevermind, there was something wrong with my pattern matching. Can you please confirm if this was just wrong pattern matching and we can close this BZ or if you still need our assistance? I think I solved this problem in one of the 2 PRs I submitted below (the changes are merged already) https://github.com/sosreport/sos/pull/1779 https://github.com/sosreport/sos/pull/1802 If those changes are in RHEL 7 already then this BZ can be closed out. Both PRs are merged and linked with release 3.9.1 which means those PRs should be present in rhel 7.9 (sos 3.9.1). Hello, thanks for the availability to test the fix. Please use below repository / package: A yum repository for the build of sos-3.9-2.el7 (task 28860092) is available at: http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.9/2.el7/ You can install the rpms locally by putting this .repo file in your /etc/yum.repos.d/ directory: http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.9/2.el7/sos-3.9-2.el7.repo RPMs and build logs can be found in the following locations: http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.9/2.el7/noarch/ The full list of available rpms is: http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.9/2.el7/noarch/sos-3.9-2.el7.src.rpm http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.9/2.el7/noarch/sos-3.9-2.el7.noarch.rpm The repository will be available for the next 60 days. Scratch build output will be deleted earlier, based on the Brew scratch build retention policy. Tested and works as expected. 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 (sos bug fix and enhancement update), 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-2020:4034 |