Bug 1481583 - engine-setup with ovn fails to import cert after engine-cleanup
Summary: engine-setup with ovn fails to import cert after engine-cleanup
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Setup.Engine
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.2.0
: 4.2.0
Assignee: Ido Rosenzwig
QA Contact: Gonza
URL:
Whiteboard:
: 1493637 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-15 06:11 UTC by Yedidyah Bar David
Modified: 2017-12-22 06:50 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-12-22 06:50:26 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 81882 0 'None' MERGED packaging: setup: Remove leftover external_truststore on new setups 2021-01-12 07:56:06 UTC
oVirt gerrit 83118 0 'None' MERGED packaging: setup: Change tempfile dir 2021-01-12 07:56:04 UTC

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.


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