Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1133621 - Automatic provisioning ignores db password supplied in answer file
Summary: Automatic provisioning ignores db password supplied in answer file
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: ---
: 3.5.0
Assignee: Simone Tiraboschi
QA Contact: Pavel Stehlik
URL:
Whiteboard: integration
Depends On:
Blocks: 1139211 rhev3.5beta 1156165
TreeView+ depends on / blocked
 
Reported: 2014-08-25 15:05 UTC by Petr Beňas
Modified: 2015-02-12 14:08 UTC (History)
14 users (show)

Fixed In Version: vt3
Doc Type: Bug Fix
Doc Text:
Previously DB parameters passed to rhevm-setup using an answer file were not honored when automatic provisioning was selected. now DB parameters passed by answer file are honored also when automatic provisioning is selected
Clone Of:
: 1139211 1332892 (view as bug list)
Environment:
Last Closed: 2015-02-12 14:08:57 UTC
oVirt Team: ---
Target Upstream Version:


Attachments (Terms of Use)
first answerfile (deleted)
2014-08-25 15:05 UTC, Petr Beňas
no flags Details
cleanup answerfile (deleted)
2014-08-25 15:05 UTC, Petr Beňas
no flags Details
third answerfile (deleted)
2014-08-25 15:06 UTC, Petr Beňas
no flags Details
second setup logfile (deleted)
2014-08-25 15:07 UTC, Petr Beňas
no flags Details


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 32036 master MERGED packaging: setup: honouring engine DB parameters from answer file Never
oVirt gerrit 32041 ovirt-engine-3.5 MERGED packaging: setup: honouring engine DB parameters from answer file Never
oVirt gerrit 32067 ovirt-engine-3.4 MERGED packaging: setup: honouring engine DB parameters from answer file Never
oVirt gerrit 32646 None None None Never
oVirt gerrit 32649 None None None Never
oVirt gerrit 32651 None None None Never

Description Petr Beňas 2014-08-25 15:05:17 UTC
Created attachment 930569 [details]
first answerfile

Description of problem:
[ INFO  ] Stage: Misc configuration
[ INFO  ] Creating Engine database schema
[ ERROR ] Failed to execute stage 'Misc configuration': Command '/usr/share/ovirt-engine/dbscripts/create_schema.sh' failed to execute
[ INFO  ] Yum Performing yum transaction rollback
[ INFO  ] Rolling back database schema
[ INFO  ] Clearing Engine database engine
[ ERROR ] Engine database rollback failed: FATAL:  password authentication failed for user "engine" FATAL:  password authentication failed for user "engine" 

Version-Release number of selected component (if applicable):
av11.1

How reproducible:
100%, automatically and manually

Steps to Reproduce:
1. rhevm-setup --config-append=working 
2. rhevm-cleanup --config-append=cleanup 
3. rhevm-setup --config-append=setup 

Actual results:


Expected results:


Additional info:
Found by automated testing, probably introduced with av11.1

Comment 1 Petr Beňas 2014-08-25 15:05:48 UTC
Created attachment 930570 [details]
cleanup answerfile

Comment 2 Petr Beňas 2014-08-25 15:06:11 UTC
Created attachment 930571 [details]
third answerfile

Comment 3 Petr Beňas 2014-08-25 15:07:04 UTC
Created attachment 930572 [details]
second setup logfile

Comment 4 Petr Beňas 2014-08-25 15:08:03 UTC
[root@localhost ~]# tail /var/lib/pgsql/data/pg_hba.conf
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               ident
host    engine          engine          0.0.0.0/0               md5
host    engine          engine          ::0/0                   md5
# IPv4 local connections:
host    all         all         127.0.0.1/32          ident
# IPv6 local connections:
host    all         all         ::1/128               ident

Comment 6 Petr Beňas 2014-08-25 16:26:11 UTC
Found simplier reproducing vector: 

[ INFO  ] Execution of setup completed successfully
[root@localhost ~]# export PGPASSWORD=123456; psql -d engine -U engine -h localhost -t -A -c '--'
psql: FATAL:  password authentication failed for user "engine"
[root@localhost ~]# history | tail -n 5
    5  2014-08-25 18:19:22 hostname
    6  2014-08-25 18:19:32 vim working 
    7  2014-08-25 18:19:53 rhevm-setup --config-append=working 
    8  2014-08-25 18:24:16 export PGPASSWORD=123456; psql -d engine -U engine -h localhost -t -A -c '--'
    9  2014-08-25 18:24:51 history | tail -n 5

Comment 7 David Caro 2014-08-25 17:10:40 UTC
The bug is actually that setting the postgres provisioning to true, generates the database password even if it was specified in the answerfile, changing the option:

OVESETUP_PROVISIONING/postgresProvisioningEnabled=bool:True

to

OVESETUP_PROVISIONING/postgresProvisioningEnabled=bool:False

in the first setup answerfile works as expected.

Comment 8 Petr Beňas 2014-08-26 08:07:34 UTC
I don't see any change in behaviour when trying postgresProvisioning set to False....

http://jenkins.qa.lab.tlv.redhat.com:8080/view/RhevmCore/view/3.4-All/job/3.4-git-rhevmCore-infra_tools_setup/29/console

Comment 9 Petr Beňas 2014-08-26 10:42:09 UTC
Tried manually running on freshly installed system with the OVESETUP_PROVISIONING/postgresProvisioningEnabled=bool:False
and got following result. It looks one would have to create the db manually in such case. 

 INFO  ] Creating Engine database schema
[ ERROR ] Failed to execute stage 'Misc configuration': Command '/usr/share/ovirt-engine/dbscripts/create_schema.sh' failed to execute
[ INFO  ] Yum Performing yum transaction rollback
[ INFO  ] Rolling back database schema
[ INFO  ] Clearing Engine database engine
[ ERROR ] Engine database rollback failed: could not connect to server: Connection refused      Is the server running on host "localhost" and accepting      TCP/IP connections on port 5432? could not connect to server: Connection refused     Is the server running on host "localhost" and accepting         TCP/IP connections on port 5432? 

So my guess is that if OVESETUP_PROVISIONING/postgresProvisioningEnabled=bool:True is set, the password from answerfile is ignored and new password is generated.

Comment 11 Yedidyah Bar David 2014-09-08 12:10:39 UTC
As discussed, we should also refrain from writing to the answer file the randomly-generated password.

This way, mere use of setup-generated answer file will keep the existing behavior (generate a new password), while special cases will still be able to supply their own password even if auto provisioning.

Comment 12 Eyal Edri 2014-09-10 21:29:04 UTC
bug fixed in vt3.
if you think it's not included in latest build, please contact rhev-integ@redhat.com

Comment 13 Petr Beňas 2014-09-11 14:58:11 UTC
in vt3

Comment 14 Yedidyah Bar David 2014-10-12 09:55:00 UTC
Simone - did you check this also on dwh/reports?

Comment 15 Simone Tiraboschi 2014-10-13 07:57:09 UTC
(In reply to Yedidyah Bar David from comment #14)
> Simone - did you check this also on dwh/reports?

Engine DB password should now be handled correctly also installing DWH and reports, didn't try what happens with DWH and reports DB password.
I'll check.

Comment 16 Yedidyah Bar David 2014-11-23 07:40:07 UTC
Perhaps take parts or all of the doctext from the 3.4 clone:

Previously, rhevm-setup with automatic provisioning ignored a database password if one was supplied in the answer file. A new random password was generated and written to the generated answer file. Now, for automatic provisioning, if a password is supplied in the answer file, it is not ignored, and the password is not written to the answer file that is generated at the end.


Note You need to log in before you can comment on or make changes to this bug.