Bug 1006950

Summary: Setup - Generated user and password are not saved immediately and are lost upon failure.
Product: Red Hat Enterprise Virtualization Manager Reporter: Yaniv Lavi <ylavi>
Component: ovirt-engine-dwhAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED ERRATA QA Contact: Barak Dagan <bdagan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, bdagan, iheim, obasan, oschreib, pstehlik, Rhev-m-bugs, srevivo, yeylon
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: integration
Fixed In Version: rhevm-dwh-3.3.0-15.el6ev.noarch.rpm Doc Type: Bug Fix
Doc Text:
The created role 'engine_history' user and password were only saved to the configuration file at the end of the setup, and could be lost if the setup failed halfway. This could block reinstallation due to a missing password. rhevm-dwh-setup now saves these entities right after they are created.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 14:59:40 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:
Attachments:
Description Flags
rhevm-dwh-setup.log
none
rhevm-dwh-setup.log none

Description Yaniv Lavi 2013-09-11 14:45:18 UTC
Description of problem:
Only at the end of the setup is the created role 'engine_history' user and password saved to config fail. This can block reinstallation due to missing password. Setup should save this right after the creation.

Version-Release number of selected component (if applicable):
IS14-3.3.0

How reproducible:
sometimes

Steps to Reproduce:
1. Run setup
2. Fail the setup after role creation, but before config file is created. 

Actual results:
Reinstall doesn't work.

Expected results:
Should save to file upon creation of role.

Additional info:

Comment 2 Barak Dagan 2013-11-13 13:49:53 UTC
Verification failed on IS22:

rhevm-dwh-3.3.0-20.el6ev.noarch

# rhevm-dwh-setup 
Welcome to ovirt-engine-dwh setup utility

In order to proceed the installer must stop the ovirt-engine service
Would you like to stop the ovirt-engine service (yes|no): yes
Stopping ovirt-engine...                              [ DONE ]

This utility can configure a read only user for DB access. Would you like to do so? (yes|no): y
Provide a username for read-only user : ^CError encountered while installing rhevm-dwh, please consult the log file: /var/log/ovirt-engine/rhevm-dwh-setup-2013_11_13_18_25_27.log

# rhevm-dwh-setup 
Welcome to ovirt-engine-dwh setup utility


This utility can configure a read only user for DB access. Would you like to do so? (yes|no): yes
Provide a username for read-only user : readonly
Provide a password for read-only user: 
Warning: Weak Password.
Re-type password: 
Should postgresql be setup with secure connection? (yes|no): no
Creating DB...                                        [ ERROR ]
Error encountered while installing rhevm-dwh, please consult the log file: /var/log/ovirt-engine/rhevm-dwh-setup-2013_11_13_18_30_01.log


log:
2013-11-13 18:30:29::ERROR::rhevm-dwh-setup::598::root:: Exception caught!
2013-11-13 18:30:29::ERROR::rhevm-dwh-setup::599::root:: Traceback (most recent call last):
  File "/usr/bin/rhevm-dwh-setup", line 545, in main
    createDbSchema(db_dict)
  File "/usr/share/ovirt-engine-dwh/decorators.py", line 28, in wrapped_f
    raise Exception(instance)
Exception: Error while trying to create ovirt_engine_history db


database state:


 psql -l
could not change directory to "/root"
                                          List of databases
         Name         |     Owner      | Encoding |  Collation  |    Ctype    |   Access privileges   
----------------------+----------------+----------+-------------+-------------+-----------------------
 engine               | engine         | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 ovirt_engine_history | engine_history | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 postgres             | postgres       | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0            | postgres       | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                                              : postgres=CTc/postgres
 template1            | postgres       | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                                              : postgres=CTc/postgres
(5 rows)

Comment 3 Barak Dagan 2013-11-13 13:50:55 UTC
Created attachment 823460 [details]
rhevm-dwh-setup.log

Comment 4 Alex Lourie 2013-11-13 16:03:12 UTC
Please attach /var/log/ovirt-engine/rhevm-dwh-setup-2013_11_13_18_30_01.log from the system.

The attached bug displays a completely different and unrelated problem.

Comment 5 Barak Dagan 2013-11-14 09:17:07 UTC
Created attachment 823824 [details]
rhevm-dwh-setup.log

Sorry for the wrong log.

Comment 6 Alex Lourie 2013-11-14 09:41:46 UTC
Again, wrong log.

Comment 7 Barak Dagan 2013-11-14 12:08:27 UTC
(In reply to Alex Lourie from comment #6)
> Again, wrong log.

comment #5: rhevm-dwh-setup-2013_11_13_18_30_01.log (text/plain), 13.86 KB, created by Barak Dagan on 2013-11-14 04:17 EST. Seems to be what was asked in comment #4 ?

Comment 8 Alex Lourie 2013-11-14 16:13:19 UTC
Barak:

First log has this:

2013-11-13 18:30:29::DEBUG::rhevm-dwh-setup::151::root:: ovirt engine history db creation is logged at /var/log/ovirt-engine/ovirt-history-db-install-2013_11_13_18_30_29.log

Second log has this:

2013-11-13 18:30:29::DEBUG::rhevm-dwh-setup::151::root:: ovirt engine history db creation is logged at /var/log/ovirt-engine/ovirt-history-db-install-2013_11_13_18_30_29.log

Which is the same thing. I would like to see the log that ends with 18:30:01, not 18:30:29.

Thanks.

Comment 9 Barak Dagan 2013-11-14 20:50:53 UTC
Verification passed on IS23, rhevm-dwh-3.3.0-21.el6ev.noarch:


# rhevm-dwh-setup 
Welcome to ovirt-engine-dwh setup utility

In order to proceed the installer must stop the ovirt-engine service
Would you like to stop the ovirt-engine service (yes|no): yes
Stopping ovirt-engine...                              [ DONE ]

This utility can configure a read only user for DB access. Would you like to do so? (yes|no): yes
Provide a username for read-only user : rro
Provide a password for read-only user: 
Warning: Weak Password.
Re-type password: ^C Error encountered while installing rhevm-dwh, please consult the log file: /var/log/ovirt-engine/rhevm-dwh-setup-2013_11_15_01_00_23.log

# rhevm-dwh-setup 
Welcome to ovirt-engine-dwh setup utility


This utility can configure a read only user for DB access. Would you like to do so? (yes|no): yes
Provide a username for read-only user : rro
Provide a password for read-only user: 
Warning: Weak Password.
Re-type password: 
Should postgresql be setup with secure connection? (yes|no): no
Creating DB...                                        [ DONE ]
Creating read-only user...

Comment 10 Charlie 2013-11-28 00:55:27 UTC
This bug is currently attached to errata RHEA-2013:15116. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to 
minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes 

Thanks in advance.

Comment 13 errata-xmlrpc 2014-01-21 14:59:40 UTC
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.

http://rhn.redhat.com/errata/RHBA-2014-0036.html