Bug 1733089 - engine-setup role fails if ovn password is not supplied in vault
Summary: engine-setup role fails if ovn password is not supplied in vault
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Setup.Core
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.3.6
: 4.3.6.4
Assignee: Yedidyah Bar David
QA Contact: Pavol Brilla
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-25 07:57 UTC by Sandro Bonazzola
Modified: 2019-09-26 19:43 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.3.6.4
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-26 19:43:28 UTC
oVirt Team: Integration
Embargoed:
pm-rhel: ovirt-4.3+


Attachments (Terms of Use)
engine setup logs (341.98 KB, application/x-xz)
2019-07-25 07:57 UTC, Sandro Bonazzola
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 98595 0 'None' 'MERGED' 'packaging: setup: ovn: Do not call decode on None' 2019-11-26 09:57:29 UTC
oVirt gerrit 102493 0 'None' 'MERGED' 'packaging: setup: ovn: Do not call decode on None' 2019-11-26 09:57:28 UTC

Description Sandro Bonazzola 2019-07-25 07:57:15 UTC
Created attachment 1593337 [details]
engine setup logs

my playbook:
---
- name: Setup oVirt
  hosts: ovirt4.home
  vars_files:
    # Contains encrypted `ovirt_engine_setup_admin_password` variable using ansible-vault
    - password.yml
  vars:
    ovirt_engine_setup_version: '4.3'
    ovirt_engine_setup_product_type: oVirt
  roles:
    - ovirt.engine-setup


Using 1.1.9



Got this error:
TASK [ovirt.engine-setup : Run engine-setup with answerfile] ******************************************************************************************************************************************************
fatal: [ovirt4.home]: FAILED! => {"changed": true, "cmd": ["engine-setup", "--accept-defaults", "--config-append=/tmp/answerfile-20190315180843Z.txt"], "delta": "0:09:54.716435", "end": "2019-03-15 18:18:44.658774", "msg": "non-zero return code", "rc": 1, "start": "2019-03-15 18:08:49.942339", "stderr": "", "stderr_lines": [], "stdout": "[ INFO  ] Stage: Initializing\n[ INFO  ] Stage: Environment setup\n          Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/tmp/answerfile-20190315180843Z.txt']\n          Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20190315180850-ufar83.log\n          Version: otopi-1.8.1 (otopi-1.8.1-1.el7)\n[ INFO  ] Stage: Environment packages setup\n[ INFO  ] Stage: Programs detection\n[ INFO  ] Stage: Environment setup (late)\n[ INFO  ] Stage: Environment customization\n         \n          --== PRODUCT OPTIONS ==--\n         \n          Set up Cinderlib integration\n          (Currently in tech preview)\n          (Yes, No) [No]: \n          Configure Engine on this host (Yes, No) [Yes]: \n          Configure Image I/O Proxy on this host (Yes, No) [Yes]: \n          Configure WebSocket Proxy on this host (Yes, No) [Yes]: \n          Configure VM Console Proxy on this host (Yes, No) [Yes]: \n         \n          --== PACKAGES ==--\n         \n[ INFO  ] Checking for product updates...\n[ INFO  ] No product updates found\n         \n          --== NETWORK CONFIGURATION ==--\n         \n          Host fully qualified DNS name of this server [ovirt4.home]: \n[WARNING] Failed to resolve ovirt4.home using DNS, it can be resolved only locally\n[ INFO  ] firewalld will be configured as firewall manager.\n         \n          --== DATABASE CONFIGURATION ==--\n         \n          Where is the Engine database located? (Local, Remote) [Local]: \n          Setup can configure the local postgresql server automatically for the engine to run. This may conflict with existing applications.\n          Would you like Setup to automatically configure postgresql and create Engine database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: \n         \n          --== OVIRT ENGINE CONFIGURATION ==--\n         \n          Application mode (Virt, Gluster, Both) [Both]: \n         \n          --== STORAGE CONFIGURATION ==--\n         \n          Default SAN wipe after delete (Yes, No) [No]: \n         \n          --== PKI CONFIGURATION ==--\n         \n          Organization name for certificate [home]: \n         \n          --== APACHE CONFIGURATION ==--\n         \n          Setup can configure the default page of the web server to present the application home page. This may conflict with existing applications.\n          Do you wish to set the application as the default page of the web server? (Yes, No) [Yes]: \n          Setup can configure apache to use SSL using a certificate issued from the internal CA.\n          Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]: \n         \n          --== SYSTEM CONFIGURATION ==--\n         \n         \n          --== MISC CONFIGURATION ==--\n         \n          Please choose Data Warehouse sampling scale:\n          (1) Basic\n          (2) Full\n          (1, 2)[1]: \n         \n          --== END OF CONFIGURATION ==--\n         \n[ INFO  ] Stage: Setup validation\n[WARNING] Less than 16384MB of memory is available\n         \n          --== CONFIGURATION PREVIEW ==--\n         \n          Application mode                        : both\n          Default SAN wipe after delete           : False\n          Firewall manager                        : firewalld\n          Update Firewall                         : True\n          Host FQDN                               : ovirt4.home\n          Set up Cinderlib integration            : False\n          Configure local Engine database         : True\n          Set application as default page         : True\n          Configure Apache SSL                    : True\n          Engine database secured connection      : False\n          Engine database user name               : engine\n          Engine database name                    : engine\n          Engine database host                    : localhost\n          Engine database port                    : 5432\n          Engine database host name validation    : False\n          Engine installation                     : True\n          PKI organization                        : home\n          Set up ovirt-provider-ovn               : True\n          Configure WebSocket Proxy               : True\n          DWH installation                        : True\n          DWH database secured connection         : False\n          DWH database host                       : localhost\n          DWH database user name                  : ovirt_engine_history\n          DWH database name                       : ovirt_engine_history\n          DWH database port                       : 5432\n          DWH database host name validation       : False\n          Configure local DWH database            : True\n          Configure Image I/O Proxy               : True\n          Configure VMConsole Proxy               : True\n         \n          Please confirm installation settings (OK, Cancel) [OK]: \n[ INFO  ] Stage: Transaction setup\n[ INFO  ] Stopping engine service\n[ INFO  ] Stopping ovirt-fence-kdump-listener service\n[ INFO  ] Stopping dwh service\n[ INFO  ] Stopping Image I/O Proxy service\n[ INFO  ] Stopping vmconsole-proxy service\n[ INFO  ] Stopping websocket-proxy service\n[ INFO  ] Stage: Misc configuration (early)\n[ INFO  ] Stage: Package installation\n[ INFO  ] Stage: Misc configuration\n[ INFO  ] Upgrading CA\n[ INFO  ] Initializing PostgreSQL\n[ INFO  ] Creating PostgreSQL 'engine' database\n[ INFO  ] Configuring PostgreSQL\n[ INFO  ] Creating PostgreSQL 'ovirt_engine_history' database\n[ INFO  ] Configuring PostgreSQL\n[ INFO  ] Creating CA\n[ INFO  ] Creating/refreshing DWH database schema\n[ INFO  ] Configuring Image I/O Proxy\n[ INFO  ] Setting up ovirt-vmconsole proxy helper PKI artifacts\n[ INFO  ] Setting up ovirt-vmconsole SSH PKI artifacts\n[ INFO  ] Configuring WebSocket Proxy\n[ INFO  ] Creating/refreshing Engine database schema\n[ INFO  ] Creating/refreshing Engine 'internal' domain database schema\n[ INFO  ] Creating default mac pool range\n[ INFO  ] Adding default OVN provider to database\n[ ERROR ] Failed to execute stage 'Misc configuration': 'NoneType' object has no attribute 'decode'\n[ INFO  ] Yum Performing yum transaction rollback\n[ INFO  ] Rolling back DWH database schema\n[ INFO  ] Clearing DWH database ovirt_engine_history\n[ INFO  ] Rolling back database schema\n[ INFO  ] Clearing Engine database engine\n[ INFO  ] Stage: Clean up\n          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20190315180850-ufar83.log\n[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20190315181844-setup.conf'\n[ INFO  ] Stage: Pre-termination\n[ INFO  ] Stage: Termination\n[ ERROR ] Execution of setup failed", "stdout_lines": ["[ INFO  ] Stage: Initializing", "[ INFO  ] Stage: Environment setup", "          Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/tmp/answerfile-20190315180843Z.txt']", "          Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20190315180850-ufar83.log", "          Version: otopi-1.8.1 (otopi-1.8.1-1.el7)", "[ INFO  ] Stage: Environment packages setup", "[ INFO  ] Stage: Programs detection", "[ INFO  ] Stage: Environment setup (late)", "[ INFO  ] Stage: Environment customization", "         ", "          --== PRODUCT OPTIONS ==--", "         ", "          Set up Cinderlib integration", "          (Currently in tech preview)", "          (Yes, No) [No]: ", "          Configure Engine on this host (Yes, No) [Yes]: ", "          Configure Image I/O Proxy on this host (Yes, No) [Yes]: ", "          Configure WebSocket Proxy on this host (Yes, No) [Yes]: ", "          Configure VM Console Proxy on this host (Yes, No) [Yes]: ", "         ", "          --== PACKAGES ==--", "         ", "[ INFO  ] Checking for product updates...", "[ INFO  ] No product updates found", "         ", "          --== NETWORK CONFIGURATION ==--", "         ", "          Host fully qualified DNS name of this server [ovirt4.home]: ", "[WARNING] Failed to resolve ovirt4.home using DNS, it can be resolved only locally", "[ INFO  ] firewalld will be configured as firewall manager.", "         ", "          --== DATABASE CONFIGURATION ==--", "         ", "          Where is the Engine database located? (Local, Remote) [Local]: ", "          Setup can configure the local postgresql server automatically for the engine to run. This may conflict with existing applications.", "          Would you like Setup to automatically configure postgresql and create Engine database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: ", "         ", "          --== OVIRT ENGINE CONFIGURATION ==--", "         ", "          Application mode (Virt, Gluster, Both) [Both]: ", "         ", "          --== STORAGE CONFIGURATION ==--", "         ", "          Default SAN wipe after delete (Yes, No) [No]: ", "         ", "          --== PKI CONFIGURATION ==--", "         ", "          Organization name for certificate [home]: ", "         ", "          --== APACHE CONFIGURATION ==--", "         ", "          Setup can configure the default page of the web server to present the application home page. This may conflict with existing applications.", "          Do you wish to set the application as the default page of the web server? (Yes, No) [Yes]: ", "          Setup can configure apache to use SSL using a certificate issued from the internal CA.", "          Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]: ", "         ", "          --== SYSTEM CONFIGURATION ==--", "         ", "         ", "          --== MISC CONFIGURATION ==--", "         ", "          Please choose Data Warehouse sampling scale:", "          (1) Basic", "          (2) Full", "          (1, 2)[1]: ", "         ", "          --== END OF CONFIGURATION ==--", "         ", "[ INFO  ] Stage: Setup validation", "[WARNING] Less than 16384MB of memory is available", "         ", "          --== CONFIGURATION PREVIEW ==--", "         ", "          Application mode                        : both", "          Default SAN wipe after delete           : False", "          Firewall manager                        : firewalld", "          Update Firewall                         : True", "          Host FQDN                               : ovirt4.home", "          Set up Cinderlib integration            : False", "          Configure local Engine database         : True", "          Set application as default page         : True", "          Configure Apache SSL                    : True", "          Engine database secured connection      : False", "          Engine database user name               : engine", "          Engine database name                    : engine", "          Engine database host                    : localhost", "          Engine database port                    : 5432", "          Engine database host name validation    : False", "          Engine installation                     : True", "          PKI organization                        : home", "          Set up ovirt-provider-ovn               : True", "          Configure WebSocket Proxy               : True", "          DWH installation                        : True", "          DWH database secured connection         : False", "          DWH database host                       : localhost", "          DWH database user name                  : ovirt_engine_history", "          DWH database name                       : ovirt_engine_history", "          DWH database port                       : 5432", "          DWH database host name validation       : False", "          Configure local DWH database            : True", "          Configure Image I/O Proxy               : True", "          Configure VMConsole Proxy               : True", "         ", "          Please confirm installation settings (OK, Cancel) [OK]: ", "[ INFO  ] Stage: Transaction setup", "[ INFO  ] Stopping engine service", "[ INFO  ] Stopping ovirt-fence-kdump-listener service", "[ INFO  ] Stopping dwh service", "[ INFO  ] Stopping Image I/O Proxy service", "[ INFO  ] Stopping vmconsole-proxy service", "[ INFO  ] Stopping websocket-proxy service", "[ INFO  ] Stage: Misc configuration (early)", "[ INFO  ] Stage: Package installation", "[ INFO  ] Stage: Misc configuration", "[ INFO  ] Upgrading CA", "[ INFO  ] Initializing PostgreSQL", "[ INFO  ] Creating PostgreSQL 'engine' database", "[ INFO  ] Configuring PostgreSQL", "[ INFO  ] Creating PostgreSQL 'ovirt_engine_history' database", "[ INFO  ] Configuring PostgreSQL", "[ INFO  ] Creating CA", "[ INFO  ] Creating/refreshing DWH database schema", "[ INFO  ] Configuring Image I/O Proxy", "[ INFO  ] Setting up ovirt-vmconsole proxy helper PKI artifacts", "[ INFO  ] Setting up ovirt-vmconsole SSH PKI artifacts", "[ INFO  ] Configuring WebSocket Proxy", "[ INFO  ] Creating/refreshing Engine database schema", "[ INFO  ] Creating/refreshing Engine 'internal' domain database schema", "[ INFO  ] Creating default mac pool range", "[ INFO  ] Adding default OVN provider to database", "[ ERROR ] Failed to execute stage 'Misc configuration': 'NoneType' object has no attribute 'decode'", "[ INFO  ] Yum Performing yum transaction rollback", "[ INFO  ] Rolling back DWH database schema", "[ INFO  ] Clearing DWH database ovirt_engine_history", "[ INFO  ] Rolling back database schema", "[ INFO  ] Clearing Engine database engine", "[ INFO  ] Stage: Clean up", "          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20190315180850-ufar83.log", "[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20190315181844-setup.conf'", "[ INFO  ] Stage: Pre-termination", "[ INFO  ] Stage: Termination", "[ ERROR ] Execution of setup failed"]}

Attaching engine-setup logs

I was running the playbook from my laptop, the engine host is a vm on the same network.

I confirm that adding ovn password to the vault fixes the problem 


From Didi:
The bottom-of-the-stack failure reason is calling .decode on None, which was done for supporting also python3. Fixing this can be done e.g. by https://gerrit.ovirt.org/98595 . Didn't test and not sure that's enough.

We might decide to fix by changing the logic upper in the stack, though, or by fixing the role/playbook to supply also a password.

At a minimum, someone needs to decide what we want the role to do wrt to ovn. Do we want it to be set up automatically? Using engine admin user/password?

Comment 1 Pavol Brilla 2019-08-29 13:40:39 UTC
Well this cause error to disappear but now t engine is deployable without password:

ansible-vault view password.yml 
ovirt_engine_setup_admin_password:
ovirt_engine_setup_provider_ovn_configure: true
ovirt_engine_setup_provider_ovn_username: admin@internal


Engine was succesfully deployed.


Tested on:

# yum list ovirt-engine
Loaded plugins: product-id, search-disabled-repos, subscription-manager, versionlock
This system is not registered with an entitlement server. You can use subscription-manager to register.
Installed Packages
ovirt-engine.noarch                                     4.3.6.4-0.1.el7                                      @rhv-4.3.6


in version 4.3.5 no password was causing "[ ERROR ] Failed to execute stage 'Misc configuration': 'NoneType' object has no attribute 'decode'" ....

Comment 2 RHEL Program Management 2019-08-29 13:40:45 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 3 Yedidyah Bar David 2019-09-02 08:18:16 UTC
(In reply to Pavol Brilla from comment #1)
> Well this cause error to disappear but now t engine is deployable without
> password:
> 
> ansible-vault view password.yml 
> ovirt_engine_setup_admin_password:
> ovirt_engine_setup_provider_ovn_configure: true
> ovirt_engine_setup_provider_ovn_username: admin@internal
> 
> 
> Engine was succesfully deployed.

1. It's not current bug. Current bug is about ovn password.

2. IMO it's not a bug at all. This was the behavior, AFAICT, since at least 3.3.
The admin can change the password later on, IIUC. Not sure this is by design, or
documented, but I do not think it's a bug. If you disagree, feel free to open
a bug. If you do, please consider also different but related cases - e.g., if
you interactively supply a short/easy password, we prompt, requiring to ack. If
you do that via the answer file, we don't. Is this a bug? IMO no. The assumption
is that if you manually generated or wrote an answer file, you should know what
you are doing. Current bug was that under certain conditions, engine-setup then
fails. This is a bug. If it simply does, more-or-less, what it was told to do,
that's not a bug. IMHO :-)

Comment 4 Pavol Brilla 2019-09-09 11:10:19 UTC
Tested on:

# yum list ovirt-engine
Loaded plugins: product-id, search-disabled-repos, subscription-manager, versionlock
This system is not registered with an entitlement server. You can use subscription-manager to register.
Installed Packages
ovirt-engine.noarch                                     4.3.6.4-0.1.el7                                      @rhv-4.3.6


in version 4.3.5 no password was causing "[ ERROR ] Failed to execute stage 'Misc configuration': 'NoneType' object has no attribute 'decode'" ....

Comment 5 Sandro Bonazzola 2019-09-26 19:43:28 UTC
This bugzilla is included in oVirt 4.3.6 release, published on September 26th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.6 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.


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