Bug 1741487

Summary: Cloudforms Files need to be captured by sosreport
Product: Red Hat Enterprise Linux 8 Reporter: Rahul Chincholkar <rchincho>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED NEXTRELEASE QA Contact: Upgrades and Supportability <upgrades-and-supportability>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: agk, bmr, dluong, gavin, plambri, sbradley
Target Milestone: rc   
Target Release: ---   
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-01-15 11:00:02 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 Rahul Chincholkar 2019-08-15 09:42:57 UTC
Description of problem:
The below list of files are not available in RHEL 8.0 sosreport.
~~~
FILE    /var/www/miq/vmdb/BUILD
FILE    /var/www/miq/vmdb/GUID
FILE    /var/www/miq/vmdb/VERSION
FILE    /var/www/miq/vmdb/REGION
FILE    /var/lib/pgsql/data/postgresql.conf
DIR     /var/www/miq/vmdb/log
DIR     /var/www/miq/vmdb/config
DIR     /var/lib/pgsql/data/log
~~~


Version-Release number of selected component (if applicable):
sos-3.6-10.el8_0.3.noarch

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
Those files and directories should be added in sosreport as log and config collection.

Additional info:

Comment 1 Bryn M. Reeves 2019-08-15 12:11:09 UTC
FILE    /var/www/miq/vmdb/BUILD
FILE    /var/www/miq/vmdb/GUID
FILE    /var/www/miq/vmdb/VERSION
FILE    /var/www/miq/vmdb/REGION
FILE    /var/lib/pgsql/data/postgresql.conf
DIR     /var/www/miq/vmdb/log
DIR     /var/www/miq/vmdb/config
DIR     /var/lib/pgsql/data/log

These paths (or the directories that contain them) don't look like they are owned by the CloudForms packages - what packages provide these, so that we can ensure these are added in the most appropriate place?

Comment 2 David Luong 2019-08-15 13:13:14 UTC
I believe this is addressed by https://bugzilla.redhat.com/show_bug.cgi?id=1664464
Does a z-stream of that bug for RHEL 8 need to be opened to ensure this is included? Or should this just be the z-stream of that bug?

It should include all those files except for postgresql.conf, which would be https://github.com/sosreport/sos/commit/6f46afb1786f5d489d3820c85c30a357c8fcd770 (The product will be trying to utilize this dir instead of modifying the default postgresql.conf from now on)

Comment 3 Rahul Chincholkar 2019-08-16 07:17:31 UTC
Bryn, I agree with David.
All files except postgresql.conf are included sosreport created on RHEL 7.7 (sos-3.7-1).

Comment 4 Pavel Moravec 2019-08-16 12:04:18 UTC
So currently, manageiq plugin in RHEL7.7 needs to collect /var/lib/pgsql/data/postgresql.conf only?

And that is achieved by upstream commit https://github.com/sosreport/sos/commit/6f46afb (as /etc/manageiq/postgresql.conf.d/ is a symlink to /var/lib/pgsql/data)?

If both is correct, then this will be fixed in 7.8 "gratis" due to sos rebase to an upstream release soon-to-be-released.

Comment 5 Pavel Moravec 2019-09-04 20:15:01 UTC
A kind reminder of the needinfo ;-)

Comment 6 Rahul Chincholkar 2019-09-05 08:39:49 UTC
Pavel,

Sorry for the delay :)

> So currently, manageiq plugin in RHEL7.7 needs to collect /var/lib/pgsql/data/postgresql.conf only?

Yes, it should collect /var/lib/pgsql/data/postgresql.conf


> And that is achieved by upstream commit https://github.com/sosreport/sos/commit/6f46afb (as /etc/manageiq/postgresql.conf.d/ is a symlink to /var/lib/pgsql/data)?

/etc/manageiq/postgresql.conf.d/ is NOT a symlink to /var/lib/pgsql/data, 
Files in directory `/etc/manageiq/postgresql.conf.d/` loads when postgresql service starts.

   ~~~
   # cat /var/lib/pgsql/data/postgresql.conf | grep postgresql.conf.d
   include_dir = '/etc/manageiq/postgresql.conf.d'
   ~~~

Comment 7 Pavel Moravec 2019-09-05 09:32:40 UTC
I see, thanks.

Could you please check if the file isnt already collected by postgresql plugin? That should be enabled by default when either of packages:

postgresql
rh-postgresql95-postgresql-server
rh-postgresql10-postgresql-server

is installed.

Try simply "sosreport -o postgresql" (or default "sosreport" to see really default behaviour)


I would be hesitant to collect /var/lib/pgsql/data/postgresql.conf by another plugin (that could cause issues to sos in some circumstances). If default "sosreport" does not collect the file, I would rather update postgres plugin as it is its duty to collect its config.

Please run sosreport on http://download-ipv4.eng.brq.redhat.com/brewroot/////packages/sos/3.8/1.el7/noarch/sos-3.8-1.el7.noarch.rpm package and if /var/lib/pgsql/data/postgresql.conf will be missing, provide the generated tarball.

Comment 8 Pavel Moravec 2019-12-11 16:25:55 UTC
(In reply to Pavel Moravec from comment #7)
> I see, thanks.
> 
> Could you please check if the file isnt already collected by postgresql
> plugin?

Optionally, could you please check against the very first draft package for 8.2?


A yum repository for the build of sos-3.8-1.el8 (task 25306382) is available at:

http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.8/1.el8/

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.8/1.el8/sos-3.8-1.el8.repo

RPMs and build logs can be found in the following locations:
http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.8/1.el8/noarch/

The full list of available rpms is:
http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.8/1.el8/noarch/sos-3.8-1.el8.src.rpm
http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.8/1.el8/noarch/sos-3.8-1.el8.noarch.rpm
http://brew-task-repos.usersys.redhat.com/repos/official/sos/3.8/1.el8/noarch/sos-audit-3.8-1.el8.noarch.rpm

Build output will be available for the next 21 days.

Comment 9 Rahul Chincholkar 2020-01-09 04:43:18 UTC
Pavel,

Unfortunately, I am unable to test the draft package.
Currently, the packages are unavailable as it passed 21 days time.

Is it possible to get the draft packages available again?

Thanks!

Comment 12 Pavel Moravec 2020-01-10 07:06:21 UTC
Cloudforms has configured postgres logs to /var/lib/pgsql/data/log ? That is different to default Red Hat location:

/var/lib/pgsql/data/pg_log

Does it mean that /var/lib/pgsql/data/postgresql.conf contains:

log_directory = 'log'

?

If I am right, sosreport should be amended to parse postgresql.conf config and determine log_directory (with the default pg_log), and grab this dir.

Could you please confirm that config change on Cloudforms?

Comment 13 Rahul Chincholkar 2020-01-15 05:57:15 UTC
Pavel,

There is a change in default `log_directory` with postgres versions:

It was `pg_log` for postgres 9.5
and now its `log` for postgres 10

Latest cloudforms appliances uses postgres 10.

Comment 15 Pavel Moravec 2020-01-15 07:36:51 UTC
(In reply to Rahul Chincholkar from comment #13)
> Pavel,
> 
> There is a change in default `log_directory` with postgres versions:
> 
> It was `pg_log` for postgres 9.5
> and now its `log` for postgres 10
> 
> Latest cloudforms appliances uses postgres 10.

Thanks for info, wasnt aware of it. Anyway, postgresql plugin should collect the logfiles even from 'log' dir, see:

https://github.com/sosreport/sos/blob/master/sos/plugins/postgresql.py#L101-L103

So if postgresql plugin was enabled, it should collect all files matching:

find /var/lib/pgsql | grep '\.log$'

What command options did you use for sosreport? Optionally, could you give me access to some system I can check by myself?

Comment 16 Rahul Chincholkar 2020-01-15 07:56:10 UTC
Sorry, that was me, I forgot to enable postgresql plugin.
With postgresql plugin enabled, we are able to get the log files from DIR `/var/lib/pgsql/data/log` in the sosreport.

I apologize for the trouble and thank you so much for your help on this.

Comment 17 Pavel Moravec 2020-01-15 11:00:02 UTC
(In reply to Rahul Chincholkar from comment #16)
> Sorry, that was me, I forgot to enable postgresql plugin.
> With postgresql plugin enabled, we are able to get the log files from DIR
> `/var/lib/pgsql/data/log` in the sosreport.
> 
> I apologize for the trouble and thank you so much for your help on this.

No problem at all.

That functionality will be available since RHEL8.2, so I am closing the bug as fixed in the next release.