Bug 2000121

Summary: docs/comments/etc misguide about postgresql credentials defaults
Product: [oVirt] ovirt-log-collector Reporter: Yedidyah Bar David <didi>
Component: GeneralAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED CURRENTRELEASE QA Contact: Guilherme Santos <gdeolive>
Severity: medium Docs Contact:
Priority: medium    
Version: ---CC: abeljame1303, bugs, lynndaleolagard, nsednev
Target Milestone: ovirt-4.5.0Keywords: FieldEngineering, ZStream
Target Release: 4.4.5Flags: sbonazzo: ovirt-4.5+
sbonazzo: devel_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-log-collector-4.4.5 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-28 09:26:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2050566    

Description Yedidyah Bar David 2021-09-01 12:46:45 UTC
Description of problem:

ovirt-log-collector says in multiple places, including at least '--help' and comments in the default conf file, that the default for 'pg-user' is 'postgres'. This might have been true in very old versions (3.1 or so) but is wrong and misleading now. We should clarify everywhere that the default is not hard-coded but is taken from the configuration created by 'engine-setup', and should normally never need to be changed/set/passed.

TODO:
1. Consider updating the documentation - create a doc bug if needed
2. Consider checking this in engine-setup and warn the user - create a bug on engine-setup, if needed

Comment 1 Sandro Bonazzola 2021-12-21 10:35:36 UTC
Reviewed the code and:
- added a note in the configuration file as suggested
- the --help provides as default the value of engine_config.get('ENGINE_DB_USER') so if ovirt-log-collector is executed on the engine host, it should already show the right user.

Comment 2 Sandro Bonazzola 2022-01-26 09:15:50 UTC
Updated the PR after first round of reviews.

Comment 3 Nikolai Sednev 2022-04-12 19:44:45 UTC
During HE deployment, the latest ovirt-engine-setup-4.5.0.2-0.7.el8ev.noarch being used and it still reports an old defaults as appears bellow:
 PostgreSQL Database Configuration:
    The log collector will connect to the oVirt Engine PostgreSQL database
    and dump the data for inclusion in the log report unless --no-
    postgresql is specified. The PostgreSQL user ID and database name can
    be specified if they are different from the defaults. If the
    PostgreSQL database is not on the localhost set pg-dbhost, provide a
    pg-ssh-user, and optionally supply pg-host-key and the log collector
    will gather remote PostgreSQL logs. The PostgreSQL SOS plug-in must be
    installed on pg-dbhost for successful remote log collection.

    --no-postgresql     This option causes the tool to skip the postgresql
                        collection (default=false)
    --pg-user=postgres  PostgreSQL database user name (default=postgres)
    --pg-dbname=engine  PostgreSQL database name (default=engine)
    --pg-dbhost=localhost
                        PostgreSQL database hostname or IP address
                        (default=localhost)
    --pg-dbport=5432    PostgreSQL server port number (default=5432)
    --pg-ssh-user=root  the SSH user that will be used to connect to the
                        server upon which the remote PostgreSQL database
                        lives. (default=root)
    --pg-host-key=none  the identity file (private key) to be used for
                        accessing the host upon which the PostgreSQL database
                        lives (default=not needed if using localhost)

Return values:
    0: The program ran to completion with no errors.
    1: The program encountered a critical failure and stopped.
    2: The program encountered a problem gathering data but was able to continue.


ovirt-log-collector-4.4.5-1.el8ev.noarch

Comment 4 Sandro Bonazzola 2022-04-13 06:36:55 UTC
(In reply to Nikolai Sednev from comment #3)
> During HE deployment, the latest ovirt-engine-setup-4.5.0.2-0.7.el8ev.noarch
> being used and it still reports an old defaults as appears bellow:

please open separate bz for engine-setup, thanks

Comment 6 Sandro Bonazzola 2022-04-28 09:26:34 UTC
This bugzilla is included in oVirt 4.5.0 release, published on April 20th 2022.

Since the problem described in this bug report should be resolved in oVirt 4.5.0 release, it has been closed with a resolution of CURRENT RELEASE.

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

Comment 8 raspberrymole 2023-11-17 06:42:49 UTC Comment hidden (spam)