Bug 1070344 - ovirt-engine-reports-setup does not handle escape characters in the 10-setup-database.conf ENGINE_DB_PASSWORD
Summary: ovirt-engine-reports-setup does not handle escape characters in the 10-setup-...
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-reports
Version: 3.3.0
Hardware: All
OS: Linux
Target Milestone: ---
: 3.4.0
Assignee: Yedidyah Bar David
QA Contact: Barak Dagan
Whiteboard: integration
Depends On:
Blocks: 1072405 rhev3.4beta 1142926
TreeView+ depends on / blocked
Reported: 2014-02-26 16:11 UTC by James W. Mills
Modified: 2019-04-28 09:23 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, the ovirt-engine-reports-setup command would fail under certain conditions. This would occur when the password specified for the internal admin user for the Red Hat Enterprise Virtualization Manager contained special characters. While passwords would be correctly escaped in the 10-setup-database.conf file, the ovirt-engine-reports-setup command would not detect the '/' escape character, resulting in an authentication error. Now, this logic has been revised so that special characters are correctly parsed, making it possible for the ovirt-engine-reports-setup command to complete successfully.
Clone Of:
: 1072405 (view as bug list)
Last Closed: 2014-06-09 15:27:08 UTC
oVirt Team: ---
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 736053 0 None None None Never
Red Hat Product Errata RHEA-2014:0602 0 normal SHIPPED_LIVE rhevm-reports 3.4 bug fix and enhancement update 2014-06-09 19:26:10 UTC
oVirt gerrit 25316 0 None None None Never

Description James W. Mills 2014-02-26 16:11:18 UTC
Description of problem:

When rhevm is configured using a password with a special character, that character is escaped in 10-setup-database.conf.  However, ovirt-engine-reports-setup does not honor the '/' as an escape character and fails to run.

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

* rhevm-setup-3.3.0-0.46.el6ev.noarch
* rhevm-reports-3.3.0-28.el6ev.noarch

How reproducible:


Steps to Reproduce:
1. Manually create the engine user and database:

postgres=# create user engine password '123$576';
postgres=# create database engine owner engine template template0
          encoding 'UTF8' lc_collate 'en_US.UTF-8'
          lc_ctype 'en_US.UTF-8';

2. Run engine-setup, entering '123$576' when prompted for the engine DB password
3. Run ovirt-engine-reports-setup

NOTE:  ovirt-engine-dwh-setup also has this problem.  You need to manually edit '10-setup-database.conf', removing the '/', run ovirt-engine-dwh-setup, then edit '10-setup-database.conf' again and re-add the '/' to see this behavior.

Actual results:

It fails eventually with:

2014-02-26 16:04:38::DEBUG::common_utils::1018::root:: Executing command --> '/usr/bin/psql -w -U engine -h localhost -p 5432 -d engine -c update vdc_options set option_value='https://rhevm32.awayfar.org:443/rhevm-reports' where option_name='RedirectServletReportsPage';' in working directory '/usr/share/ovirt-engine-reports'
2014-02-26 16:04:38::DEBUG::common_utils::1073::root:: output = 
2014-02-26 16:04:38::DEBUG::common_utils::1074::root:: stderr = psql: FATAL:  password authentication failed for user "engine"

Expected results:

It runs successfully

Additional info:

After engine-setup is run, the ENGINE_DB_PASSWORD looks like this:


Analyzing the contents of db_dict, we see:

{'username': 'engine_reports', 'engine_db': 'engine', 'dwh_db_user': 'engine_history', 'engine_pass': '123\\$576', 'engine_user': 'engine', 'port': '5432', 'host': 'localhost', 'dwh_database': 'ovirt_engine_history', 'dwh_db_password': '3202kFbN', 'password': '2452VfJh', 'dbname': 'rhevmreports'}

The ovirt-engine-reports-setup script is interpreting the '/' escaping the '$' as a normal character, and then escaping it.

Comment 1 James W. Mills 2014-02-26 16:13:01 UTC
Th workaround for this is to edit '10-setup-database.conf', remove the '/', run ovirt-engine-reports-setup, then edit '10-setup-database.conf' again and add the '/' back.

Comment 4 Barak Dagan 2014-03-09 15:54:24 UTC
Verified on av2.1:

postgres=# "ALTER USER engine WITH PASSWORD '1234%6';


Reports installation passed successfuly.

Comment 5 Barak Dagan 2014-03-10 12:48:27 UTC
Verified on av2.1:

postgres=# "ALTER USER engine WITH PASSWORD '123$56';


Reports installation passed successfuly.

Comment 6 errata-xmlrpc 2014-06-09 15:27:08 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.


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