Bug 1839533

Summary: engine-setup fails if admin password in answerfile contains a "%"
Product: [oVirt] otopi Reporter: Stephen Panicho <s.panicho>
Component: GeneralAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Nikolai Sednev <nsednev>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: masterCC: bugs, didi, emarcus, nsoffer
Target Milestone: ovirt-4.4.1Keywords: Regression, Triaged
Target Release: 1.9.2Flags: sbonazzo: ovirt-4.4?
sbonazzo: planning_ack?
sbonazzo: devel_ack+
sbonazzo: testing_ack?
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: otopi-1.9.2 Doc Type: Bug Fix
Doc Text:
Cause: otopi, and therefore engine-setup, uses python's configparser module for reading answer/configuration files. In 4.4, otopi uses python3, which changed the behavior of configparser to do "Interpolation", treating '%' as a special character. Consequence: engine-setup with an answer file containing '%' failed, emitting an error. Fix: otopi was changed to use the class RawConfigParser, which does not do interpolation, instead of ConfigParser. Result: engine-setup succeeds.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-08 08:26:50 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: 1700864    

Description Stephen Panicho 2020-05-24 14:42:57 UTC
Description of problem:
The Hosted Engine deployment (tested via Cockpit) will fail if the admin password contains a "%" character.

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


How reproducible:
Always

Steps to Reproduce:
1. Choose an admin password with a "%" character. This will generate OVESETUP_CONFIG/adminPassword in the answerfile.
2. Proceed with engine-setup

Actual results:
[ INFO ] TASK [ovirt.engine-setup : Run engine-setup with answerfile]
[ ERROR ] fatal: [localhost -> engine.ovirt.trashnet.xyz]: FAILED! => {"changed": true, "cmd": ["engine-setup", "--accept-defaults", "--config-append=/root/ovirt-engine-answers"], "delta": "0:00:01.396490", "end": "2020-05-22 18:32:41.965984", "msg": "non-zero return code", "rc": 1, "start": "2020-05-22 18:32:40.569494", "stderr": "", "stderr_lines": [], "stdout": "[ INFO ] Stage: Initializing\n[ ERROR ] Failed to execute stage 'Initializing': '%' must be followed by '%' or '(', found: '%JUUj'\n[ INFO ] Stage: Clean up\n Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20200522183241-c7d1kh.log\n[ ERROR ] Failed to execute stage 'Clean up': 'NoneType' object has no attribute 'cleanup'\n[ INFO ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20200522183241-setup.conf'\n[ INFO ] Stage: Pre-termination\n[ INFO ] Stage: Termination\n[ ERROR ] Execution of setup failed", "stdout_lines": ["[ INFO ] Stage: Initializing", "[ ERROR ] Failed to execute stage 'Initializing': '%' must be followed by '%' or '(', found: '%JUUj'", "[ INFO ] Stage: Clean up", " Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20200522183241-c7d1kh.log", "[ ERROR ] Failed to execute stage 'Clean up': 'NoneType' object has no attribute 'cleanup'", "[ INFO ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20200522183241-setup.conf'", "[ INFO ] Stage: Pre-termination", "[ INFO ] Stage: Termination", "[ ERROR ] Execution of setup failed"]}

Expected results:
Installation proceeds normally

Additional info:
Discussion at https://lists.ovirt.org/archives/list/users@ovirt.org/thread/6QODLB6J5Z74YCVF6C3TLQPF4KK7RKB5/

Comment 1 Nir Soffer 2020-05-24 16:38:21 UTC
Did, isn't this modified now?

Comment 2 Nikolai Sednev 2020-07-07 09:13:24 UTC
Works for me on latest Software Version:4.4.1.7-0.3.el8ev.
otopi-common-1.9.2-1.el8ev.noarch
ovirt-hosted-engine-ha-2.4.4-1.el8ev.noarch
ovirt-hosted-engine-setup-2.4.5-1.el8ev.noarch
Linux 4.18.0-193.12.1.el8_2.x86_64 #1 SMP Thu Jul 2 15:48:14 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux release 8.2 (Ootpa)

Reported issue no longer exists.

Comment 3 Sandro Bonazzola 2020-07-08 08:26:50 UTC
This bugzilla is included in oVirt 4.4.1 release, published on July 8th 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.1 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 4 Eli Marcus 2020-07-27 09:55:16 UTC
Hi Didi, 
should't we list this as an enhancement or rebase issue? 
since it is the first release of RHV 4.4, it should not be a bug fix

I would phrase it something like: 

"The otopi component has been updated to work with Python 3."

or 

"The otopi component used in Self-Hosted Engine deployment, has been updated to work with Python 3."

Comment 5 Yedidyah Bar David 2020-07-28 07:07:27 UTC
(In reply to Eli Marcus from comment #4)
> Hi Didi, 
> should't we list this as an enhancement or rebase issue? 
> since it is the first release of RHV 4.4, it should not be a bug fix

Indeed, but this is an oVirt bug, and 4.4.0 was released without a fix for it.

> 
> I would phrase it something like: 
> 
> "The otopi component has been updated to work with Python 3."
> 
> or 
> 
> "The otopi component used in Self-Hosted Engine deployment, has been updated
> to work with Python 3."

For RHV, I agree, or just drop it from release notes. Or, include a general comment that most (I think all, not sure - definitely all of it for the main components) of the code was ported to python3, no need to reference particular bugs or components, IMO.