Bug 1481583

Summary: engine-setup with ovn fails to import cert after engine-cleanup
Product: [oVirt] ovirt-engine Reporter: Yedidyah Bar David <didi>
Component: Setup.EngineAssignee: Ido Rosenzwig <irosenzw>
Status: CLOSED CURRENTRELEASE QA Contact: Gonza <grafuls>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.0CC: bugs, irosenzw, lsvaty
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: 4.2.0   
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-12-22 06:50:26 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 Yedidyah Bar David 2017-08-15 06:11:13 UTC
Description of problem:

The following flow:

1. engine-setup, accept to configure ovn provider
2. engine-cleanup
3. engine-setup, accept to configure ovn provider

Fails with:

Failed to import provider certificate into the external provider keystore.)

I guess the best solution is to make engine-cleanup remove
/var/lib/ovirt-engine/external_truststore on cleanup.

Comment 1 Yedidyah Bar David 2017-09-24 06:11:27 UTC
*** Bug 1493637 has been marked as a duplicate of this bug. ***

Comment 2 Yedidyah Bar David 2017-10-23 14:28:06 UTC
Now failed for me, on fedora, with /tmp on tmpfs:

2017-10-23 17:16:56,883+0300 DEBUG otopi.context context._executeMethod:128 Stage transaction-prepare METHOD otopi.plugins.ovirt_engine_setup.ovirt_engine.core.external_truststore.Plugin.remove_external_truststore
2017-10-23 17:16:56,884+0300 DEBUG otopi.transaction transaction._prepare:61 preparing 'External_truststore Remove Transaction'
2017-10-23 17:16:56,885+0300 DEBUG otopi.transaction transaction._prepare:66 exception during prepare phase
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/otopi/transaction.py", line 62, in _prepare
    element.prepare()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/core/external_truststore.py", line 55, in prepare
    self.tmp_external_truststore[1]
OSError: [Errno 18] Invalid cross-device link
2017-10-23 17:16:56,904+0300 DEBUG otopi.context context._executeMethod:143 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/otopi/context.py", line 133, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/core/external_truststore.py", line 85, in remove_external_truststore
    self.ExternalTruststoreRemoveTransaction()
  File "/usr/lib/python2.7/site-packages/otopi/transaction.py", line 106, in append
    self._prepare(element=element)
  File "/usr/lib/python2.7/site-packages/otopi/transaction.py", line 62, in _prepare
    element.prepare()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/core/external_truststore.py", line 55, in prepare
    self.tmp_external_truststore[1]
OSError: [Errno 18] Invalid cross-device link
2017-10-23 17:16:56,905+0300 ERROR otopi.context context._executeMethod:152 Failed to execute stage 'Transaction setup': [Errno 18] Invalid cross-device link

I guess we need to change tempfile.mkstemp to use the parent directory of external_truststore.

Ido, can you handle? When you verify, please try with /tmp on tmpfs (or its own partition/lv). This is quite a common thing to do, also on RHEL/CentOS.

Comment 3 Ido Rosenzwig 2017-11-21 06:55:26 UTC
Fixed and merged.

Comment 4 Gonza 2017-12-21 13:33:43 UTC
Verified with:
ovirt-engine-4.2.0.2-0.1.el7.noarch

Comment 5 Sandro Bonazzola 2017-12-22 06:50:26 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.