saltstack / saltstack/salt

[BUG] Problem with zypperpkg.install and parameter "name" on openSUSE

Open
#56,318 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity-medium
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description of Issue

When using state function pkg.installed, a problem occurs, when the minion is "openSUSE Leap 15.1". With an Ubuntu minion it works. Problem is the parameter "name".

According to documentation zypperpkg.install parameter "name" is not required.

The name of the package to be installed. Note that this parameter is ignored if either pkgs or sources is passed.

zypperpkg does not ignore it. I want to install multi packages with pkg from a local repository I added earlier.

Setup

Without "name" it fails:

salt-minion3:~ # salt-call -l debug pkg.install skip_verify=True refresh=True pkgs='["MQSeriesAMQP-U9104","MQSeriesClient-U9104","MQSeriesExplorer-U9104","MQSeriesGSKit-U9104","MQSeriesJava-U9104","MQSeriesJRE-U9104","MQSeriesMan-U9104","MQSeriesRuntime-U9104","MQSeriesSamples-U9104","MQSeriesServer-U9104","MQSeriesXRService-U9104"]' version='"9.1.0.4"'
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: salt-minion3
[DEBUG   ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Grains refresh requested. Refreshing grains.
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Error while parsing IPv4 address: ::1
[DEBUG   ] Expected 4 octets in '::1'
[DEBUG   ] Error while parsing IPv4 address: fe80::20c:29ff:fe77:60ff
[DEBUG   ] Expected 4 octets in 'fe80::20c:29ff:fe77:60ff'
[DEBUG   ] Elapsed time getting FQDNs: 0.1110086441040039 seconds
[WARNING ] /usr/lib/python3.6/site-packages/salt/grains/core.py:2827: DeprecationWarning: This server_id is computed nor by Adler32 neither by CRC32. Please use "server_id_use_crc" option and define algorithm youprefer (default "Adler32"). The server_id will be computed withAdler32 by default.

[DEBUG   ] Error while parsing IPv4 address: ::1
[DEBUG   ] Expected 4 octets in '::1'
[DEBUG   ] Error while parsing IPv4 address: fe80::20c:29ff:fe77:60ff
[DEBUG   ] Expected 4 octets in 'fe80::20c:29ff:fe77:60ff'
[DEBUG   ] Loading static grains from /etc/salt/grains
[DEBUG   ] Connecting to master. Attempt 1 of 1
[DEBUG   ] Error while parsing IPv4 address: salt-master
[DEBUG   ] Expected 4 octets in 'salt-master'
[DEBUG   ] Error while parsing IPv6 address: salt-master
[DEBUG   ] At least 3 parts expected in 'salt-master'
[DEBUG   ] "salt-master" Not an IP address? Assuming it is a hostname.
[DEBUG   ] Master URI: tcp://192.168.174.110:4506
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506')
[DEBUG   ] Generated random reconnect delay between '1000ms' and '11000ms' (9287)
[DEBUG   ] Setting zmq_reconnect_ivl to '9287ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506', 'clear')
[DEBUG   ] Connecting the Minion to the Master URI (for the return server): tcp://192.168.174.110:4506
[DEBUG   ] Trying to connect to: tcp://192.168.174.110:4506
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] salt.crypt._get_key_with_evict: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] Closing AsyncZeroMQReqChannel instance
[DEBUG   ] Connecting the Minion to the Master publish port, using the URI: tcp://192.168.174.110:4505
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506')
[DEBUG   ] Connecting the Minion to the Master URI (for the return server): tcp://192.168.174.110:4506
[DEBUG   ] Trying to connect to: tcp://192.168.174.110:4506
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Closing AsyncZeroMQReqChannel instance
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded pkg.install
[DEBUG   ] LazyLoaded direct_call.execute
[DEBUG   ] LazyLoaded cmd.run_all
[INFO    ] Executing command ['zypper', '--non-interactive', 'refresh', '--force'] in directory '/root'
[INFO    ] Executing command ['zypper', '--non-interactive', '--xmlout', '--no-refresh', 'se', '-xv', None] in directory '/root'
[ERROR   ] Command '['zypper', '--non-interactive', '--xmlout', '--no-refresh', 'se', '-xv', None]' failed with return code: 104
[ERROR   ] stdout: <?xml version='1.0'?>
<stream>
<message type="info">Loading repository data...</message>
<message type="info">Reading installed packages...</message>
<message type="info">No matching items found.</message>
</stream>
[ERROR   ] retcode: 104
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/salt/cli/caller.py", line 237, in call
    ret['return'] = self.minion.executors[fname](self.opts, data, func, args, kwargs)
  File "/usr/lib/python3.6/site-packages/salt/executors/direct_call.py", line 12, in execute
    return func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/salt/modules/zypperpkg.py", line 1353, in install
    version_num = Wildcard(__zypper__)(name, version)
  File "/usr/lib/python3.6/site-packages/salt/modules/zypperpkg.py", line 389, in __call__
    for vrs in self._get_scope_versions(self._get_available_versions())])
  File "/usr/lib/python3.6/site-packages/salt/modules/zypperpkg.py", line 397, in _get_available_versions
    solvables = self.zypper.nolock.xml.call('se', '-xv', self.name).getElementsByTagName('solvable')
  File "/usr/lib/python3.6/site-packages/salt/modules/zypperpkg.py", line 340, in __call
    raise CommandExecutionError('Zypper command failure: {0}'.format(self.error_msg))
salt.exceptions.CommandExecutionError: Zypper command failure: Check Zypper's logs.
Error running 'pkg.install': Zypper command failure: Check Zypper's logs.

With a valid "name" it works

salt-minion3:~ # salt-call -l debug pkg.install name="MQSeriesRuntime-U9104" skip_verify=True refresh=True pkgs='["MQSeriesAMQP-U9104","MQSeriesClient-U9104","MQSeriesExplorer-U9104","MQSeriesGSKit-U9104","MQSeriesJava-U9104","MQSeriesJRE-U9104","MQSeriesMan-U9104","MQSeriesRuntime-U9104","MQSeriesSamples-U9104","MQSeriesServer-U9104","MQSeriesXRService-U9104"]' version='"9.1.0.4"'
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: salt-minion3
[DEBUG   ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Grains refresh requested. Refreshing grains.
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Error while parsing IPv4 address: ::1
[DEBUG   ] Expected 4 octets in '::1'
[DEBUG   ] Error while parsing IPv4 address: fe80::20c:29ff:fe77:60ff
[DEBUG   ] Expected 4 octets in 'fe80::20c:29ff:fe77:60ff'
[DEBUG   ] Elapsed time getting FQDNs: 0.1155238151550293 seconds
[WARNING ] /usr/lib/python3.6/site-packages/salt/grains/core.py:2827: DeprecationWarning: This server_id is computed nor by Adler32 neither by CRC32. Please use "server_id_use_crc" option and define algorithm youprefer (default "Adler32"). The server_id will be computed withAdler32 by default.

[DEBUG   ] Error while parsing IPv4 address: ::1
[DEBUG   ] Expected 4 octets in '::1'
[DEBUG   ] Error while parsing IPv4 address: fe80::20c:29ff:fe77:60ff
[DEBUG   ] Expected 4 octets in 'fe80::20c:29ff:fe77:60ff'
[DEBUG   ] Loading static grains from /etc/salt/grains
[DEBUG   ] Connecting to master. Attempt 1 of 1
[DEBUG   ] Error while parsing IPv4 address: salt-master
[DEBUG   ] Expected 4 octets in 'salt-master'
[DEBUG   ] Error while parsing IPv6 address: salt-master
[DEBUG   ] At least 3 parts expected in 'salt-master'
[DEBUG   ] "salt-master" Not an IP address? Assuming it is a hostname.
[DEBUG   ] Master URI: tcp://192.168.174.110:4506
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506')
[DEBUG   ] Generated random reconnect delay between '1000ms' and '11000ms' (8261)
[DEBUG   ] Setting zmq_reconnect_ivl to '8261ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506', 'clear')
[DEBUG   ] Connecting the Minion to the Master URI (for the return server): tcp://192.168.174.110:4506
[DEBUG   ] Trying to connect to: tcp://192.168.174.110:4506
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] salt.crypt._get_key_with_evict: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] Closing AsyncZeroMQReqChannel instance
[DEBUG   ] Connecting the Minion to the Master publish port, using the URI: tcp://192.168.174.110:4505
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506')
[DEBUG   ] Connecting the Minion to the Master URI (for the return server): tcp://192.168.174.110:4506
[DEBUG   ] Trying to connect to: tcp://192.168.174.110:4506
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Closing AsyncZeroMQReqChannel instance
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded pkg.install
[DEBUG   ] LazyLoaded direct_call.execute
[DEBUG   ] LazyLoaded cmd.run_all
[INFO    ] Executing command ['zypper', '--non-interactive', 'refresh', '--force'] in directory '/root'
[INFO    ] Executing command ['zypper', '--non-interactive', '--xmlout', '--no-refresh', 'se', '-xv', 'MQSeriesRuntime-U9104'] in directory '/root'
[DEBUG   ] targeting package: MQSeriesAMQP-U9104
[DEBUG   ] targeting package: MQSeriesClient-U9104
[DEBUG   ] targeting package: MQSeriesExplorer-U9104
[DEBUG   ] targeting package: MQSeriesGSKit-U9104
[DEBUG   ] targeting package: MQSeriesJava-U9104
[DEBUG   ] targeting package: MQSeriesJRE-U9104
[DEBUG   ] targeting package: MQSeriesMan-U9104
[DEBUG   ] targeting package: MQSeriesRuntime-U9104
[DEBUG   ] targeting package: MQSeriesSamples-U9104
[DEBUG   ] targeting package: MQSeriesServer-U9104
[DEBUG   ] targeting package: MQSeriesXRService-U9104
[INFO    ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)_|-%{INSTALLTIME}'] in directory '/root'
[DEBUG   ] LazyLoaded config.get
[DEBUG   ] key: systemd.scope, ret: _|-
[INFO    ] Executing command ['zypper', '--non-interactive', '--no-refresh', '--no-gpg-checks', 'install', '--auto-agree-with-licenses', '--name', 'MQSeriesAMQP-U9104', 'MQSeriesClient-U9104', 'MQSeriesExplorer-U9104', 'MQSeriesGSKit-U9104', 'MQSeriesJava-U9104', 'MQSeriesJRE-U9104', 'MQSeriesMan-U9104', 'MQSeriesRuntime-U9104', 'MQSeriesSamples-U9104', 'MQSeriesServer-U9104', 'MQSeriesXRService-U9104'] in directory '/root'
[INFO    ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)_|-%{INSTALLTIME}'] in directory '/root'
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'salt-minion3', 'tcp://192.168.174.110:4506')
[DEBUG   ] Connecting the Minion to the Master URI (for the return server): tcp://192.168.174.110:4506
[DEBUG   ] Trying to connect to: tcp://192.168.174.110:4506
[DEBUG   ] Closing AsyncZeroMQReqChannel instance
[DEBUG   ] LazyLoaded nested.output
local:
    ----------
    MQSeriesAMQP-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesClient-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesExplorer-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesGSKit-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesJRE-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesJava-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesMan-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesRuntime-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesSamples-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesServer-U9104:
        ----------
        new:
            9.1.0-4
        old:
    MQSeriesXRService-U9104:
        ----------
        new:
            9.1.0-4
        old:

Versions Report

Master has the same version like the minion.

salt-minion3:~ # salt --versions-report
Salt Version:
           Salt: 2019.2.0
 
Dependency Versions:
           cffi: 1.11.2
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10.1
        libgit2: 0.26.8
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.17
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.26.0
         Python: 3.6.5 (default, Mar 31 2018, 19:45:04) [GCC]
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 17.0.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.3
 
System Versions:
           dist:   
         locale: UTF-8
        machine: x86_64
        release: 4.12.14-lp151.28.10-default
         system: Linux
        version: Not Installed
 
salt-minion3:~ # 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at salt/modules/zypperpkg.py, especially zypperpkg.install and the Wildcard call shown in the traceback. Reproduce the openSUSE command with pkgs and no name, then verify that the documented multi-package path no longer sends an empty package name to zypper and completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.