Bug 1392312

Summary: ovirt-host-deploy with dnf packager fails to use a proxy
Product: [oVirt] otopi Reporter: Yedidyah Bar David <didi>
Component: Plugins.packagersAssignee: Yedidyah Bar David <didi>
Status: CLOSED WONTFIX QA Contact: Lukas Svaty <lsvaty>
Severity: medium Docs Contact:
Priority: unspecified    
Version: masterCC: bugs, pasik
Target Milestone: ---Flags: sbonazzo: ovirt-4.5?
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: 2019-12-16 07:58:54 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 2016-11-07 07:39:09 UTC
Description of problem:

An attempt to deploy a fedora host which requires a proxy fails, even if a proxy is configured in /etc/dnf/dnf.conf, with:

2016-11-07 09:24:53 ERROR otopi.plugins.otopi.packagers.dnfpackager dnfpackager.error:84 DNF Curl error (6): Couldn't resolve host name for http://resources.ovirt.org/pub/yum-repo/mirrorlist-ovirt-master-snapshot-fc24 [Could not resolve host: resources.ovirt.org]
2016-11-07 09:24:53 DEBUG otopi.context context._executeMethod:142 method exception
Traceback (most recent call last):
  File "/tmp/ovirt-PYzMJSL94f/pythonlib/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/tmp/ovirt-PYzMJSL94f/otopi-plugins/otopi/packagers/dnfpackager.py", line 240, in _packages
    self._minidnf.processTransaction()
  File "/tmp/ovirt-PYzMJSL94f/pythonlib/otopi/minidnf.py", line 645, in processTransaction
    self._processTransaction(base=self._base)
  File "/tmp/ovirt-PYzMJSL94f/pythonlib/otopi/minidnf.py", line 635, in _processTransaction
    progress=self._MyDownloadProgress(self._sink),
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 880, in download_packages
    raise dnf.exceptions.DownloadError(errors.irrecoverable)
DownloadError: Curl error (6): Couldn't resolve host name for http://resources.ovirt.org/pub/yum-repo/mirrorlist-ovirt-master-snapshot-fc24 [Could not resolve host: resources.ovirt.org]
2016-11-07 09:24:53 ERROR otopi.context context._executeMethod:151 Failed to execute stage 'Package installation': Curl error (6): Couldn't resolve host name for http://resources.ovirt.org/pub/yum-repo/mirrorlist-ovirt-master-snapshot-fc24 [Could not resolve host: resources.ovirt.org]

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

Current master snapshot

How reproducible:

Always, I think

Steps to Reproduce:
0. Have an environment that does not have direct access to the Internet and requires a proxy, configure all machines to use the proxy in dnf.conf.
1. Install and setup an engine on fedora 24
2. Install a host with fedora 24
3. Install on the host python2-dnf (see bug 1297835)
4. Try to add the host to the engine

Actual results:

Fails, with the above error in host-deploy log.

Expected results:

Correctly use the proxy

Additional info:

Not fully certain where the failure is. Running 'otopi' (which tries to install an already-installed 'iproute') does not fail. It might even be a bug in dnf, not sure. This command also fails, and I do not bother for now to open another bug:

dnf install http://some.host/some/path/pkg.rpm

That is, passing a URL instead of a package name causes dnf to call curl (or libcurl) without setting a proxy.

Workaround:

on the host, before adding it to the engine:

mkdir /etc/otopi.env.d
echo 'export http_proxy=PROXY_URL' > /etc/otopi.env.d/my-proxy.env

Comment 1 Sandro Bonazzola 2019-01-21 08:28:31 UTC
re-targeting to 4.3.1 since this BZ has not been proposed as blocker for 4.3.0.
If you think this bug should block 4.3.0 please re-target and set blocker flag.

Comment 2 Sandro Bonazzola 2019-11-06 08:53:25 UTC
didi is this still reproducible?

Comment 3 Yedidyah Bar David 2019-11-06 09:11:41 UTC
It's been some time since I last tried to use a proxy for this. Since I did provide a workaround, I do not mind closing for now. I still think it's a relevant flow, but if I am the only one trying it, perhaps it's not that important...

Comment 4 Sandro Bonazzola 2019-12-16 07:58:54 UTC
In 4.4 we are not going to use ovirt-host-deploy anymore, moving to ansible based deploy.