salt icon indicating copy to clipboard operation
salt copied to clipboard

[BUG] Using proxy_host and proxy_port results in an error for onedir versions when requesting external pkg.installed

Open kipje91 opened this issue 2 years ago • 3 comments

Description When setting the proxy_host and proxy_port configuration on a minion this results in an error when requesting pkg.installed from an external source.

Setup Running the following state:

/etc/salt/minion.d/proxy.conf: proxy_host: 10.0.0.1 proxy_port: 3128

state.sls
install:
  pkg.installed:
    - sources:
      - external_pkg: https://externalsource.com/package.rpm

When running the above state this results in the following error:

[ERROR   ] proxy_host and proxy_port has been set. This requires pycurl and tornado, but the libraries does not seem to be installed
[ERROR   ] An exception occurred in this state: Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/state.py", line 2385, in call
    ret = self.states[cdata["full"]](
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1232, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1247, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1280, in wrapper
    return f(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pkg.py", line 1703, in installed
    result = _find_install_targets(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pkg.py", line 762, in _find_install_targets
    cached_path = __salt__["cp.cache_file"](
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1232, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1247, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/cp.py", line 546, in cache_file
    result = client.cache_file(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/fileclient.py", line 186, in cache_file
    return self.get_url(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/fileclient.py", line 808, in get_url
    raise MinionError(
salt.exceptions.MinionError: Error: proxy_host and proxy_port has been set. This requires pycurl and tornado, but the libraries does not seem to be installed reading /package.rpm
Package            Version
------------------ ---------
certifi            2022.12.7
cffi               1.14.6
chardet            3.0.4
cheroot            8.5.2
CherryPy           18.6.1
contextvars        2.4
cryptography       39.0.2
distro             1.5.0
idna               2.8
immutables         0.15
importlib-metadata 6.0.0
jaraco.classes     3.2.1
jaraco.collections 3.4.0
jaraco.functools   2.0
jaraco.text        3.5.1
Jinja2             3.1.2
jmespath           1.0.1
looseversion       1.0.2
MarkupSafe         2.1.2
more-itertools     5.0.0
msgpack            1.0.2
packaging          22.0
pip                23.1.2
portend            2.4
psutil             5.8.0
pycparser          2.21
pycryptodomex      3.9.8
pycurl             7.45.2
pyOpenSSL          23.0.0
python-dateutil    2.8.1
python-gnupg       0.4.8
pytz               2022.1
PyYAML             5.4.1
pyzmq              23.2.0
relenv             0.12.3
requests           2.25.1
rpm-vercmp         0.1.2
salt               3006.1
setproctitle       1.3.2
setuptools         65.7.0
six                1.16.0
tempora            4.1.1
timelib            0.2.5
tornado            6.3.2
urllib3            1.26.6
wheel              0.40.0
zc.lockfile        1.4
zipp               3.6.0

Please be as specific as possible and give set-up details.

  • [X] on-prem machine
  • [ ] VM (Virtualbox, KVM, etc. please specify)
  • [ ] VM running on a cloud service, please be explicit and add details
  • [ ] container (Kubernetes, Docker, containerd, etc. please specify)
  • [ ] or a combination, please be explicit
  • [ ] jails if it is FreeBSD
  • [ ] classic packaging
  • [X] onedir packaging
  • [ ] used bootstrap to install

Steps to Reproduce the behavior (Include debug logs if possible and relevant) Create the configuration as above, should have issues on 3005 and 3006 versions. Tested on RHEL 8 machines.

Expected behavior A clear and concise description of what you expected to happen. Should not fail with an error and just download the rpm via the proxy.

Screenshots If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Version on the master is 3005.1, tested also with onedir 3005, same issue.

salt-call --versions-report
Salt Version:
          Salt: 3006.1

Python Version:
        Python: 3.10.11 (main, May  5 2023, 02:31:54) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 5.4.1
         PyZMQ: 23.2.0
        relenv: 0.12.3
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: rhel 8.8 Ootpa
        locale: utf-8
       machine: x86_64
       release: 4.18.0-477.10.1.el8_8.x86_64
        system: Linux
       version: Red Hat Enterprise Linux 8.8 Ootpa

Additional context When rolling back to a classic package (3005.1), the error dissapears, but we get the UTF-8 encoding error: Specified here: https://github.com/saltstack/salt/issues/64104

kipje91 avatar May 23 '23 13:05 kipje91

Is that the output from salt-pip list?

Possibly related: #62949

OrangeDog avatar May 24 '23 15:05 OrangeDog

Hi @OrangeDog, Yes that is the output of salt-pip list. But even with the manual installation of libcurl and pycurl, the issues persists.

kipje91 avatar May 30 '23 09:05 kipje91

I've run into the same issue on RHEL9 and currently am stuck.

galet avatar Dec 21 '23 21:12 galet

My understanding is that proxy support is now fully working (as of 3006.8). The last issue was resolved by #64313.

Closing this one.

dwoz avatar Jun 18 '24 03:06 dwoz