Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1456727

Summary: a second execution of engine-setup after engine-cleanup fails due to the lack of pg_hba.conf
Product: [oVirt] ovirt-engine Reporter: Simone Tiraboschi <stirabos>
Component: Setup.EngineAssignee: Lev Veyde <lveyde>
Status: CLOSED DUPLICATE QA Contact: Pavel Stehlik <pstehlik>
Severity: high Docs Contact:
Priority: medium    
Version: futureCC: bugs, didi, sbonazzo
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-18 08:41:15 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:

Description Simone Tiraboschi 2017-05-30 09:00:33 UTC
Description of problem:
a second execution of engine-setup after engine-cleanup fails due to the lack of pg_hba.conf

In logs from the second execution of engine-setup:
2017-05-30 10:53:12,985+0200 DEBUG otopi.context context._executeMethod:128 Stage misc METHOD otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin._misc
2017-05-30 10:53:12,985+0200 INFO otopi.ovirt_engine_setup.engine_common.postgres postgres.provision:485 Creating PostgreSQL 'engine' database
2017-05-30 10:53:12,986+0200 DEBUG otopi.context context._executeMethod:142 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/provisioning/postgres.py", line 201, in _misc
    self._provisioning.provision()
  File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/postgres.py", line 493, in provision
    transaction=localtransaction,
  File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/postgres.py", line 313, in _setPgHbaLocalPeer
    oengcommcons.ProvisioningEnv.POSTGRES_PG_HBA
IOError: [Errno 2] No such file or directory: '/var/lib/pgsql/data/pg_hba.conf'
2017-05-30 10:53:12,986+0200 ERROR otopi.context context._executeMethod:151 Failed to execute stage 'Misc configuration': [Errno 2] No such file or directory: '/var/lib/pgsql/data/pg_hba.conf'
2017-05-30 10:53:12,986+0200 DEBUG otopi.transaction transaction.abort:119 aborting 'DWH Engine database Transaction'
2017-05-30 10:53:12,986+0200 DEBUG otopi.transaction transaction.abort:119 aborting 'Database Transaction'
2017-05-30 10:53:12,987+0200 DEBUG otopi.transaction transaction.abort:119 aborting 'Version Lock Transaction'
2017-05-30 10:53:12,987+0200 DEBUG otopi.transaction transaction.abort:119 aborting 'DWH database Transaction'
2017-05-30 10:53:12,987+0200 DEBUG otopi.transaction transaction.abort:119 aborting 'Firewalld Transaction'

In engine-cleanup logs:
2017-05-30 10:46:37,963+0200 DEBUG otopi.context context.dumpEnvironment:770 ENV OVESETUP_REMOVE/filesToRemove=set:'set(['/etc/pki/ovirt-engine/keys/reports.key.nopass', '/etc/httpd/conf.d/ovirt-engine-root-redirect.conf', '/etc/pki/ovirt-engine/cacert.conf', '/etc/pki/ovirt-engine/keys/imageio-proxy.key.nopass', '/etc/ovirt-engine/firewalld/ovirt-websocket-proxy.xml', '/etc/pki/ovirt-engine/certs/vmconsole-proxy-user-cert.pub', '/etc/firewalld/services/ovirt-postgres.xml', '/etc/pki/ovirt-engine/keys/ovirt-provider-ovn.key.nopass', '/etc/firewalld/services/ovirt-vmconsole-proxy.xml', '/etc/pki/ovirt-engine/certs/reports.cer', '/etc/pki/ovirt-engine/certs/vmconsole-proxy-host-cert.pub', '/etc/ovirt-engine/ovirt-websocket-proxy.conf.d/10-setup.conf', '/etc/ovirt-engine/extensions.d/internal-authz.properties', '/etc/pki/ovirt-engine/certs/vmconsole-proxy-helper.cer', '/etc/pki/ovirt-engine/certs/ovn-ndb.cer', '/etc/ovirt-engine/firewalld/ovirt-vmconsole-proxy.xml', '/etc/pki/ovirt-engine/cert.template', '/etc/pki/ovirt-engine/cacert.template', '/etc/pki/ovirt-engine/keys/engine_id_rsa', '/etc/ovirt-engine/firewalld/ovirt-http.xml', '/etc/firewalld/services/ovirt-imageio-proxy.xml', '/etc/pki/ovirt-engine/cert.conf', '/etc/ovirt-engine/ovirt-vmconsole-proxy-helper.conf.d/10-setup.conf', '/etc/pki/ovirt-engine/certs/ovn-sdb.cer', '/etc/firewalld/services/ovirt-https.xml', '/etc/ovirt-engine/engine.conf.d/10-setup-pki.conf', '/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-scale.conf', '/etc/ovirt-imageio-proxy/ovirt-imageio-proxy.conf', '/etc/pki/ovirt-engine/.truststore', '/etc/httpd/conf.d/z-ovirt-engine-proxy.conf', '/etc/ovirt-engine/engine.conf.d/10-setup-java.conf', '/etc/ovirt-engine/isouploader.conf.d/10-engine-setup.conf', '/etc/ovirt-engine/engine.conf.d/11-setup-sso.conf', '/etc/pki/ovirt-vmconsole/ca.pub', '/etc/pki/ovirt-vmconsole/proxy-ssh_user_rsa-cert.pub', '/etc/ovirt-engine/iptables.example', '/etc/ovirt-engine/aaa/internal.properties', '/etc/pki/ovirt-engine/certs/apache.cer', '/etc/pki/ovirt-engine/keys/vmconsole-proxy-helper.key.nopass', '/etc/ovirt-engine/firewalld/ovirt-imageio-proxy.xml', '/etc/pki/ovirt-engine/keys/apache.key.nopass', '/etc/firewalld/services/ovirt-websocket-proxy.xml', '/etc/ovirt-engine/firewalld/ovirt-postgres.xml', '/etc/ovirt-engine-dwh/examples/10-setup-dwh-database.conf', '/etc/ovirt-engine/extensions.d/internal-authn.properties', '/etc/ovirt-engine/firewalld/ovirt-https.xml', '/etc/pki/ovirt-engine/private/ca.pem', '/etc/pki/ovirt-vmconsole/proxy-ssh_host_rsa', '/etc/ovirt-engine/engine.conf.d/10-setup-database.conf', '/etc/pki/ovirt-engine/keys/websocket-proxy.key.nopass', '/etc/pki/ovirt-engine/certs/websocket-proxy.cer', '/etc/ovirt-engine/engine.conf.d/10-setup-protocols.conf', '/etc/pki/ovirt-vmconsole/proxy-ssh_host_rsa-cert.pub', '/etc/pki/ovirt-engine/apache-ca.pem', '/etc/ovirt-engine/logcollector.conf.d/10-engine-setup.conf', '/etc/ovirt-engine/engine.conf.d/10-setup-dwh-database.conf', '/etc/pki/ovirt-engine/keys/vmconsole-proxy-helper.p12', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf', '/etc/pki/ovirt-engine/certs/imageio-proxy.cer', '/etc/pki/ovirt-engine/ca.pem', '/etc/firewalld/services/ovirt-http.xml', '/etc/pki/ovirt-engine/keys/ovn-sdb.key.nopass', '/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-uuid.conf', '/etc/ovirt-engine/engine.conf.d/10-setup-jboss.conf', '/etc/ovirt-engine/notifier/notifier.conf.d/10-setup-jboss.conf', '/etc/pki/ovirt-vmconsole/proxy-ssh_user_rsa', '/etc/ovirt-vmconsole/ovirt-vmconsole-proxy/conf.d/20-ovirt-vmconsole-proxy-helper.conf', '/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf', '/etc/firewalld/services/ovirt-fence-kdump-listener.xml', '/etc/ovirt-engine/firewalld/ovirt-fence-kdump-listener.xml', '/var/lib/pgsql/data/pg_hba.conf', '/var/lib/pgsql/data/postgresql.conf', '/etc/pki/ovirt-engine/keys/ovn-ndb.key.nopass', '/etc/pki/ovirt-engine/certs/ovirt-provider-ovn.cer'])'




Version-Release number of selected component (if applicable):
master, not sure about 4.1

How reproducible:
100%

Steps to Reproduce:
1. engine-setup --accept-defaults --offline
2. engine-cleanup
3. engine-setup --accept-defaults --offline

Actual results:
[ INFO  ] Creating PostgreSQL 'engine' database
[ ERROR ] Failed to execute stage 'Misc configuration': [Errno 2] No such file or directory: '/var/lib/pgsql/data/pg_hba.conf'


Expected results:
It successfully deploys the engine 

Additional info:

Comment 1 Simone Tiraboschi 2017-05-30 09:55:10 UTC
It's a regression introduced by https://gerrit.ovirt.org/#/c/76105/
prior than that we had

 [unremovable]
 description = Unremovable files
 optional = False
 file.001.name = /etc/exports
 file.001.md5 = d41d8cd98f00b204e9800998ecf8427e
 file.002.name = /etc/httpd/conf.d/ssl.conf
 file.002.md5 = 026ba1af2362939e77c6efcb009f9391
 file.003.name = /etc/yum/pluginconf.d/versionlock.list
 file.003.md5 = 23f2d68d2b5f16cd6403420004573d95
 file.004.name = /var/lib/pgsql/data/pg_hba.conf
 file.004.md5 = 9d932afa3f544d651761b75c8faaa3dd
 file.005.name = /var/lib/pgsql/data/postgresql.conf
 file.005.md5 = 95ea024b93488f7d7114795f34389406

now nothing.

Comment 2 Sandro Bonazzola 2017-06-21 09:58:25 UTC
Reproduced today with latest master.

Comment 3 Yedidyah Bar David 2017-06-21 10:22:59 UTC
(In reply to Simone Tiraboschi from comment #1)
> It's a regression introduced by https://gerrit.ovirt.org/#/c/76105/
> prior than that we had
> 
>  [unremovable]
>  description = Unremovable files
>  optional = False
>  file.001.name = /etc/exports
>  file.001.md5 = d41d8cd98f00b204e9800998ecf8427e
>  file.002.name = /etc/httpd/conf.d/ssl.conf
>  file.002.md5 = 026ba1af2362939e77c6efcb009f9391
>  file.003.name = /etc/yum/pluginconf.d/versionlock.list
>  file.003.md5 = 23f2d68d2b5f16cd6403420004573d95
>  file.004.name = /var/lib/pgsql/data/pg_hba.conf
>  file.004.md5 = 9d932afa3f544d651761b75c8faaa3dd
>  file.005.name = /var/lib/pgsql/data/postgresql.conf
>  file.005.md5 = 95ea024b93488f7d7114795f34389406
> 
> now nothing.

Sorry for that. I suggest to revert for now, then try again.

Comment 4 Yaniv Kaul 2017-10-15 10:02:52 UTC
Moving back to ASSIGNED, as patch was abandoned.

Comment 5 Yedidyah Bar David 2017-10-18 08:41:15 UTC

*** This bug has been marked as a duplicate of bug 1475788 ***