saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.14k stars 5.47k forks source link

minion incorrectly reports package cannot be installed #34861

Closed gurchik closed 8 years ago

gurchik commented 8 years ago

Does not appear to be a duplicate of #29978

On a CentOS 7.2.1511 minion and CentOS 6.4 master (salt versions below), I verify the package can be installed:

$ sudo yum install postgresql-9.4.1-1.ru7
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package postgresql.x86_64 0:9.4.1-1.ru7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package          Arch         Version              Repository             Size
================================================================================
Installing:
 postgresql       x86_64       9.4.1-1.ru7          rutgers-testing       1.1 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 1.1 M
Installed size: 3.8 M
Is this ok [y/d/N]: 

I then apply to the minion

postgresql:
  pkg.installed:
    - name: postgresql-9.4.1-1.ru7
  service.running:
    - enable: True
    - require:
      - pkg: postgresql

and I receive

----------
          ID: postgresql
    Function: pkg.installed
        Name: postgresql-9.4.1-1.ru7
      Result: False
     Comment: The following packages failed to install/update: postgresql-9.4.1-1.ru7
     Started: 21:02:25.327098
    Duration: 5460.051 ms
     Changes:   
              ----------
              postgresql:
                  ----------
                  new:
                      9.4.1-1.ru7
                  old:

Interestingly, after the state fails to apply, the package is installed on the minion:

$ rpm -qa | grep postgresql-9.4.1-1.ru7
postgresql-9.4.1-1.ru7.x86_64

And if I apply the state again, it is expected salt will recognize the package is currently installed, but I receive:

----------
          ID: postgresql
    Function: pkg.installed
        Name: postgresql-9.4.1-1.ru7
      Result: False
     Comment: The following packages failed to install/update: postgresql-9.4.1-1.ru7
     Started: 21:04:51.129154
    Duration: 3139.249 ms
     Changes:   

Logs

No relevant logs appear on the master.

On the minion:

(the package is not installed at this point)
2016-07-21 21:09:29,707 [salt.state       ][ERROR   ][4657] Made the following changes:
'postgresql' changed from 'absent' to '9.4.1-1.ru7'
(it is now installed, re-applying the state now)
2016-07-21 21:11:05,107 [salt.state       ][ERROR   ][4759] The following packages failed to install/update: postgresql-9.4.1-1.ru7
(I remove and reinstall the package with yum and re-apply the state)
2016-07-21 21:12:15,524 [salt.state       ][ERROR   ][4791] The following packages failed to install/update: postgresql-9.4.1-1.ru7

Versions Report

Minion versions:

Salt Version:
           Salt: 2016.3.1

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.7.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: centos 7.2.1511 Core
        machine: x86_64
        release: 3.10.0-327.22.2.el7.centos.plus.x86_64
         system: Linux
        version: CentOS Linux 7.2.1511 Core

Master versions:

Salt Version:
           Salt: 2016.3.1

Dependency Versions:
           cffi: 1.2.1
       cherrypy: 3.2.2
       dateutil: Not Installed
          gitdb: 0.6.4
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.2.1
        libgit2: 0.22.3
        libnacl: Not Installed
       M2Crypto: 0.20.2
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.2.3
      pycparser: 2.14
       pycrypto: 2.6.1
         pygit2: 0.22.1
         Python: 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.5.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: centos 6.4 Final
        machine: x86_64
        release: 2.6.32-431.29.2.el6.x86_64
         system: Linux
        version: CentOS 6.4 Final
Ch3LL commented 8 years ago

@derekmaciel can you run this with salt-call -ldebug on the minion. This will show us more information such as what command is being run on the minion and paste it in this issue report. thanks.

gurchik commented 8 years ago

I have reduced some unnecessary lines from the salt state above. I now apply the following state to the minion:

postgresql:
  pkg.installed:
    - name: postgresql-9.4.1-1.ru7

And I receive:

$ sudo salt-call -ldebug state.sls test-saltbug
[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: opus2
[DEBUG   ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[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   ] Connecting to master. Attempt 1 of 1
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] Generated random reconnect delay between '1000ms' and '11000ms' (4852)
[DEBUG   ] Setting zmq_reconnect_ivl to '4852ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'clear')
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded state.sls
[DEBUG   ] LazyLoaded saltutil.is_running
[DEBUG   ] LazyLoaded grains.get
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[INFO    ] Loading fresh modules for state activity
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] Could not find file from saltenv 'base', 'salt://test-saltbug.sls'
[DEBUG   ] In saltenv 'base', looking at rel_path 'test-saltbug/init.sls' to resolve 'salt://test-saltbug/init.sls'
[DEBUG   ] In saltenv 'base', ** considering ** path '/var/cache/salt/minion/files/base/test-saltbug/init.sls' to resolve 'salt://test-saltbug/init.sls'
[INFO    ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://test-saltbug/init.sls'
[DEBUG   ] compile template: /var/cache/salt/minion/files/base/test-saltbug/init.sls
[DEBUG   ] Jinja search path: ['/var/cache/salt/minion/files/base']
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/base/test-saltbug/init.sls' using 'jinja' renderer: 0.0145449638367
[DEBUG   ] Rendered data from file: /var/cache/salt/minion/files/base/test-saltbug/init.sls:
# https://github.com/saltstack/salt/issues/34861
postgresql:
  pkg.installed:
    - name: postgresql-9.4.1-1.ru7

[DEBUG   ] LazyLoaded config.get
[DEBUG   ] Results of YAML rendering: 
OrderedDict([('postgresql', OrderedDict([('pkg.installed', [OrderedDict([('name', 'postgresql-9.4.1-1.ru7')])])]))])
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/base/test-saltbug/init.sls' using 'yaml' renderer: 0.0180771350861
[DEBUG   ] Error loading module.win_pkg: Module win_pkg: module only works on Windows systems
[DEBUG   ] Error loading module.pkgin: The pkgin execution module cannot be loaded: only available on NetBSD, SunOS, DragonFly, Minix, Darwin, SmartOS systems.
[DEBUG   ] Error loading module.opkg: Module opkg only works on nilrt based systems
[DEBUG   ] Error loading module.mac_pkgutil: Only available on Mac OS systems
[DEBUG   ] Error loading module.dpkg: The dpkg execution module cannot be loaded: only works on Debian family systems.
[DEBUG   ] Error loading module.pkgng: The pkgng execution module cannot be loaded: only available on FreeBSD 10 or FreeBSD 9 with providers.pkg set to pkgng.
[DEBUG   ] Error loading module.aptpkg: The pkg module could not be loaded: unsupported OS family
[DEBUG   ] Error loading module.pkgutil: The pkgutil execution module cannot be loaded: only available on Solaris systems.
[DEBUG   ] LazyLoaded pkg.install
[DEBUG   ] LazyLoaded pkg.installed
[DEBUG   ] Error loading module.solarispkg: The solarispkg execution module failed to load: only available on Solaris <= 10.
[DEBUG   ] Error loading module.openbsdpkg: The openbsdpkg execution module cannot be loaded: only available on OpenBSD systems.
[DEBUG   ] Error loading module.freebsdpkg: The freebsdpkg execution module cannot be loaded: either the os is not FreeBSD or the version of FreeBSD is >= 10.
[DEBUG   ] Error loading module.selinux: Module only works on Linux with selinux installed
[DEBUG   ] Error loading module.varnish: The varnish execution module failed to load: either varnishd or varnishadm is not in the path.
[DEBUG   ] Error loading module.xapi: Module xapi: xenapi check failed
[DEBUG   ] Error loading module.ebuild: The ebuild execution module cannot be loaded: either the system is not Gentoo or the portage python library is not available.
[DEBUG   ] Error loading module.win_servermanager: Failed to load win_servermanager module: Only available on Windows systems.
[DEBUG   ] Error loading module.netbsd_sysctl: The netbsd_sysctl execution module failed to load: only available on NetBSD.
[DEBUG   ] Error loading module.win_service: Module win_service: module only works on Windows systems
[DEBUG   ] Error loading module.boto_lambda: The boto_lambda module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.dig: The dig execution module cannot be loaded: the dig binary is not in the path.
[DEBUG   ] Error loading module.zpool: Module zpool: zpool not found
[DEBUG   ] Error loading module.freebsdports: The freebsdports execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.qemu_nbd: The qemu_nbd execution module cannot be loaded: the qemu-nbd binary is not in the path.
[DEBUG   ] Error loading module.netaddress: The netaddress execution module cannot be loaded: netaddr python library is not installed.
[DEBUG   ] Error loading module.chef: Cannot load chef module: chef-client not found
[DEBUG   ] Error loading module.glusterfs: glusterfs server is not installed
[DEBUG   ] Error loading module.mdata: mdata module can only be loaded on SmartOS zones
[DEBUG   ] Error loading module.memcached: The memcached execution module cannot be loaded: python memcache library not available.
[DEBUG   ] Error loading module.win_powercfg: Module only works on Windows.
[DEBUG   ] Error loading module.solarisips: The solarisips execution module failed to load: only available on Solaris >= 11.
[DEBUG   ] Error loading module.chassis: The chassis execution module cannot be loaded: this only works in proxy minions.
[DEBUG   ] Error loading module.debconfmod: The debconfmod module could not be loaded: unsupported OS family
[DEBUG   ] Error loading module.rdp: Module only works on Windows.
[DEBUG   ] Error loading module.guestfs: The guestfs execution module cannot be loaded: guestmount binary not in path.
[DEBUG   ] Error loading module.influx: The influx execution module cannot be loaded: influxdb library not available.
[DEBUG   ] Error loading module.win_system: Module win_system: module only works on Windows systems
[DEBUG   ] Error loading module.glance: The glance execution module cannot be loaded: the glanceclient python library is not available.
[DEBUG   ] Error loading module.iwtools: The iwtools execution module cannot be loaded: iwconfig is not installed.
[DEBUG   ] Error loading module.chocolatey: Cannot load module chocolatey: Chocolatey requires Windows
[DEBUG   ] Error loading module.cassandra_cql: Cannot load cassandra_cql module: python driver not found
[DEBUG   ] Error loading module.boto_asg: The boto_asg module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.solaris_group: The solaris_group execution module failed to load: only available on Solaris systems.
[DEBUG   ] Error loading module.mssql: The mssql execution module cannot be loaded: the pymssql python library is not available.
[DEBUG   ] Error loading module.trafficserver: trafficserver execution module not loaded: traffic_line command not found.
[DEBUG   ] Error loading module.twilio_notify: The twilio_notify execution module failed to load: the twilio python library is not installed.
[DEBUG   ] Error loading module.grub_legacy: The grub_legacy execution module cannot be loaded: the grub config file does not exist in /boot/grub/
[DEBUG   ] Error loading module.pushbullet: Pushbullet API Key Unavailable, not loading.
[DEBUG   ] Error loading module.win_groupadd: Module win_groupadd: module only works on Windows systems
[DEBUG   ] Error loading module.mac_assistive: The assistive module cannot be loaded: must be run on OSX 10.9 or newer.
[DEBUG   ] Error loading module.npm: npm execution module could not be loaded because the npm binary could not be located
[DEBUG   ] Error loading module.mac_softwareupdate: The softwareupdate module could not be loaded: module only works on MacOS systems.
[DEBUG   ] Error loading module.x509: Could not load x509 module, m2crypto unavailable
[DEBUG   ] Error loading module.solaris_user: The solaris_user execution module failed to load: only available on Solaris systems with pwd module installed.
[DEBUG   ] Error loading module.znc: Module znc: znc binary not found
[DEBUG   ] Error loading module.github: The github execution module cannot be loaded: PyGithub library is not installed.
[DEBUG   ] Error loading module.mac_system: The mac_system module could not be loaded: module only works on MacOS systems.
[DEBUG   ] Error loading module.xmpp: Module xmpp: required libraries failed to load
[DEBUG   ] Error loading module.rpmbuild: The rpmbuild module could not be loaded: requires python-gnupg, gpg, rpm, rpmbuild, mock and createrepo utilities to be installed
[DEBUG   ] Error loading module.win_task: Module win_task: module only works on Windows systems
[DEBUG   ] Error loading module.powerpath: The powerpath execution module cannot be loaded: the emcpreg binary is not available.
[DEBUG   ] Error loading module.portage_config: portage_config execution module cannot be loaded: only available on Gentoo with portage installed.
[DEBUG   ] Error loading module.freebsdservice: The freebsdservice execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.openbsdrcctl: The openbsdpkg execution module cannot be loaded: only available on OpenBSD systems.
[DEBUG   ] Error loading module.boto_sns: The boto_sns module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.augeas_cfg: Cannot load augeas_cfg module: augeas python module not installed
[DEBUG   ] Error loading module.boto_cfn: The module boto_cfs could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.win_wua: Module win_wua: module has failed dependencies or is not on Windows client
[DEBUG   ] Error loading module.ifttt: IFTTT Secret Key Unavailable, not loading.
[DEBUG   ] Error loading module.debian_ip: The debian_ip module could not be loaded: unsupported OS family
[DEBUG   ] Error loading module.win_dns_client: Module win_dns_client: module only works on Windows systems
[DEBUG   ] Error loading module.freebsdjail: The freebsdjail execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.mac_service: Failed to load the mac_service module:
Only available on Mac OS X systems.
[DEBUG   ] Error loading module.stormpath: The stormpath execution module failed to load: requires the stormpath:apiid config option to be set.
[DEBUG   ] Error loading module.bluez: The bluetooth execution module cannot be loaded: bluetooth not installed.
[DEBUG   ] Error loading module.victorops: No VictorOps api key found.
[DEBUG   ] Error loading module.makeconf: The makeconf execution module cannot be loaded: only available on Gentoo systems.
[DEBUG   ] Error loading module.win_path: Module win_path: module only works on Windows systems
[DEBUG   ] Error loading module.mac_power: The mac_power module could not be loaded: module only works on Mac OS X systems.
[DEBUG   ] Error loading module.solaris_system: The system execution module failed to load: only available on Solaris-like ystems with shutdown command.
[DEBUG   ] Error loading module.smf: The smf execution module failed to load: only available on Solaris.
[DEBUG   ] Error loading module.system_profiler: The system_profiler execution module cannot be loaded: system_profiler unavailable.
[DEBUG   ] Error loading module.reg: reg execution module failed to load: either the system is not Windows or the _winreg python library not available.
[DEBUG   ] Error loading module.uwsgi: The uwsgi execution module failed to load: the uwsgi binary is not in the path.
[DEBUG   ] Error loading module.splunk_search: The splunk_search execution module failed to load: requires both the requests and the splunk-sdk python library to be installed.
[DEBUG   ] Error loading module.sensors: sensors does not exist in the path
[DEBUG   ] Error loading module.boto_ec2: The boto_ec2 module cannot be loaded: boto library not found
[DEBUG   ] Error loading module.win_dsc: Module DSC: Module only works on Windows systems 
[DEBUG   ] Error loading module.win_firewall: Module win_firewall: module only works on Windows systems
[DEBUG   ] Error loading module.nacl: libnacl import error, perhaps missing python libnacl package
[DEBUG   ] Error loading module.openbsdservice: The openbsdservice execution module cannot be loaded: only available on OpenBSD systems.
[DEBUG   ] Error loading module.puppet: The puppet execution module cannot be loaded: facter, puppet unavailable.
[DEBUG   ] Error loading module.service: Your OS is on the disabled list
[DEBUG   ] Error loading module.gpg: The gpg execution module cannot be loaded; the gnupg python module is not installed.
[DEBUG   ] Error loading module.debian_service: The debian_service module could not be loaded: unsupported OS family and/or systemd running.
[DEBUG   ] Error loading module.linux_ip: Module linux_ip: RedHat systems are not supported.
[DEBUG   ] Error loading module.bower: The bower module could not be loaded: bower command not found
[DEBUG   ] Error loading module.gentoo_service: The gentoo_service execution module cannot be loaded: only available on Gentoo systems.
[DEBUG   ] Error loading module.ssh_package: The ssh_package execution module failed to load: only works on an ssh_sample proxy minion.
[DEBUG   ] Error loading module.win_ntp: Module win_system: module only works on Windows systems
[DEBUG   ] Error loading module.dockerio: dockerio execution module not loaded: docker python library not available.
[DEBUG   ] Error loading module.netscaler: The netscaler execution module failed to load: the nsnitro python library is not available.
[DEBUG   ] Error loading module.win_update: Module win_update: module has failed dependencies or is not on Windows client
[DEBUG   ] Error loading module.bridge: The bridge execution module failed to load: requires one of the following tool/os combinations: ifconfig on FreeBSD/OpenBSD, brctl on Linux or brconfig on NetBSD.
[DEBUG   ] Error loading module.win_file: Module win_file: module only works on Windows systems
[DEBUG   ] Error loading module.vboxmanage: The vboxmanaged execution module failed to load: VBoxManage is not installed.
[DEBUG   ] Error loading module.marathon: The marathon execution module cannot be loaded: this only works in proxy minions.
[DEBUG   ] Error loading module.cassandra: The cassandra execution module cannot be loaded: pycassa not installed.
[DEBUG   ] Error loading module.junos: The junos module could not be                 loaded: junos-eznc or proxy could not be loaded.
[DEBUG   ] Error loading module.boto_rds: The boto_rds module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.win_timezone: Module win_timezone: tzutil not found or is not on Windows client
[DEBUG   ] Error loading module.mac_group: The mac_group execution module cannot be loaded: only available on Darwin-based systems >= 10.7
[DEBUG   ] Error loading module.boto_cloudwatch: The boto_cloudwatch module cannot be loaded: boto libraries are unavailable.
[DEBUG   ] Error loading module.zfs: The zfs module cannot be loaded: zfs not found
[DEBUG   ] Error loading module.gentoolkitmod: The gentoolkitmod execution module cannot be loaded: either the system is not Gentoo or the gentoolkit.eclean python module not available
[DEBUG   ] Error loading module.aws_sqs: The module aws_sqs could not be loaded: aws command not found
[DEBUG   ] Error loading module.cyg: Module cyg: module only works on Windows systems.
[DEBUG   ] Error loading module.ldapmod: The ldapmod execution module cannot be loaded: ldap config not present.
[DEBUG   ] Error loading module.rh_service: RedHat-based distros >= version 7 use systemd, will not load rh_service.py as virtual 'service'
[DEBUG   ] Error loading module.freebsdkmod: The freebsdkmod execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.smartos_vmadm: vmadm module can only be loaded on SmartOS computed nodes
[DEBUG   ] Error loading module.dockerng: Docker module could not get imported
[DEBUG   ] Error loading module.layman: layman execution module cannot be loaded: only available on Gentoo with layman installed.
[DEBUG   ] Error loading module.ssh_service: The ssh_service execution module failed to load: only works on an ssh_sample proxy minion.
[DEBUG   ] Error loading module.win_dism: Only available on Windows systems
[DEBUG   ] Error loading module.win_disk: Module win_disk: module only works on Windows systems
[DEBUG   ] Error loading module.win_dacl: Module win_dacl: module only works on Windows systems
[DEBUG   ] Error loading module.lvs: The lvs execution module cannot be loaded: the ipvsadm binary is not in the path.
[DEBUG   ] Error loading module.rest_package: The rest_package execution module failed to load: only works on a rest_sample proxy minion.
[DEBUG   ] Error loading module.boto_elb: The boto_elb module cannot be loaded: boto library not found
[DEBUG   ] Error loading module.pw_user: The pw_user execution module cannot be loaded: the pwd python module is not available or the system is not FreeBSD.
[DEBUG   ] Error loading module.mac_shadow: Not Darwin
[DEBUG   ] Error loading module.mdadm: The mdadm execution module cannot be loaded: the mdadm binary is not in the path.
[DEBUG   ] Error loading module.smartos_virt: virt module can only be loaded on SmartOS computed nodes
[DEBUG   ] Error loading module.launchctl: Failed to load the mac_service module:
Only available on Mac OS X systems.
[DEBUG   ] Error loading module.parallels: Cannot load prlctl module: prlctl utility not available
[DEBUG   ] Error loading module.boto_secgroup: The boto_secgroup module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.solr: The solr execution module failed to load: requires both the solr and apache-solr binaries in the path.
[DEBUG   ] Error loading module.boto_vpc: The boto_vpc module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.tls: PyOpenSSL version 0.10 or later must be installed before this module can be used.
[DEBUG   ] Error loading module.ilo: ilo execution module not loaded: the hponcfg binary is not in the path.
[DEBUG   ] Error loading module.pw_group: The pw_group execution module cannot be loaded: system is not supported.
[DEBUG   ] Error loading module.saltcloudmod: The saltcloudmod execution module failed to load: requires the saltcloud library.
[DEBUG   ] Error loading module.mac_brew: The brew module could not be loaded: brew not found or grain os != MacOS
[DEBUG   ] Error loading module.ps: The ps module cannot be loaded: python module psutil not installed.
[DEBUG   ] Error loading module.bamboohr: The API key was not specified. Please specify it using the "apikey" config.
[DEBUG   ] Error loading module.nftables: The nftables execution module failed to load: nftables is not installed.
[DEBUG   ] Error loading module.upstart: The upstart execution module failed to load: this system was booted with systemd.
[DEBUG   ] Error loading module.kerberos: The kerberos execution module not loaded: kadmin not in path
[DEBUG   ] Error loading module.zypper: Module zypper: non SUSE OS not suppored by zypper package manager
[DEBUG   ] Error loading module.boto_sqs: The boto_sqs module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.boto_elasticache: The modle boto_elasticache could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.eix: The eix execution module cannot be loaded: either the system is not Gentoo or the eix binary is not in the path.
[DEBUG   ] Error loading module.solaris_shadow: The solaris_shadow execution module failed to load: only available on Solaris systems.
[DEBUG   ] Error loading module.zk_concurrency: Module zk_concurrency: dependencies failed
[DEBUG   ] Error loading module.mac_desktop: Cannot load OSX desktop module: This is not an OSX host.
[DEBUG   ] Error loading module.boto_dynamodb: The module boto_dynamodb could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.deb_apache: apache execution module not loaded: apache not installed.
[DEBUG   ] Error loading module.win_autoruns: Module win_autoruns: module only works on Windows systems
[DEBUG   ] Error loading module.hadoop: The hadoop execution module cannot be loaded: hadoop binary not in path.
[DEBUG   ] Error loading module.win_ip: Module win_ip: module only works on Windows systems
[DEBUG   ] Error loading module.boto_kms: The boto_kms module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.pam: The pam execution module failed to load: pam is not installed.
[DEBUG   ] Error loading module.poudriere: The poudriere execution module failed to load: only available on FreeBSD with the poudriere binary in the path.
[DEBUG   ] Error loading module.sysrc: The sysrc execution module failed to load: the sysrc binary is not in the path.
[DEBUG   ] Error loading module.boto_route53: The boto_route53 module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.win_useradd: Module win_useradd: module has failed dependencies or is not on Windows client
[DEBUG   ] Error loading module.boto_iam: The boto_iam module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.lxc: The lxc execution module cannot be loaded: the lxc-start binary is not in the path.
[DEBUG   ] Error loading module.ddns: The ddns execution module cannot be loaded: dnspython not installed.
[DEBUG   ] Error loading module.dockercompose: The dockercompose execution module not loaded: compose python library not available.
[DEBUG   ] Error loading module.mac_ports: mac_ports only available on MacOS
[DEBUG   ] Error loading module.win_repo: This module only works on Windows.
[DEBUG   ] Error loading module.netbsdservice: The netbsdservice execution module failed to load: only available on NetBSD.
[DEBUG   ] Error loading module.omapi: The omapi execution module cannot be loaded: the pypureomapi python library is not available.
[DEBUG   ] Error loading module.win_shadow: Module win_shadow: module only works on Windows systems.
[DEBUG   ] Error loading module.osquery: The osquery execution module cannot be loaded: osqueryi binary is not in the path.
[DEBUG   ] Error loading module.sysbench: The sysbench execution module failed to load: the sysbench binary is not in the path.
[DEBUG   ] Error loading module.ipmi: No module named pyghmi.ipmi
[DEBUG   ] Error loading module.cpan: Unable to locate cpan. Make sure it is installed and in the PATH.
[DEBUG   ] Error loading module.win_status: Cannot load win_status module on non-windows
[DEBUG   ] Error loading module.solaris_fmadm: fmadm module can only be loaded on Solaris with the fault management installed
[DEBUG   ] Error loading module.redismod: The redis execution module failed to load: the redis python library is not available.
[DEBUG   ] Error loading module.win_network: Module win_network: module only works on Windows systems
[DEBUG   ] Error loading module.mac_sysctl: The darwin_sysctl execution module cannot be loaded: only available on MacOS systems.
[DEBUG   ] Error loading module.openbsd_sysctl: The openbsd_sysctl execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.win_iis: Module win_iis: module only works on Windows systems
[DEBUG   ] Error loading module.keystone: keystone execution module cannot be loaded: keystoneclient python library not available.
[DEBUG   ] Error loading module.deb_postgres: postgres execution module not loaded: pg_createcluste command not found.
[DEBUG   ] Error loading module.haproxyconn: The haproxyconn execution module cannot be loaded: haproxyctl module not available
[DEBUG   ] Error loading module.smartos_imgadm: imgadm module can only be loaded on SmartOS computed nodes
[DEBUG   ] Error loading module.freebsd_sysctl: The freebsd_sysctl execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.qemu_img: The qemu_img execution module cannot be loaded: the qemu-img binary is not in the path.
[DEBUG   ] Error loading module.vsphere: Missing dependency: The vSphere module requires the pyVmomi Python module.
[DEBUG   ] Error loading module.bsd_shadow: The bsd_shadow execution module cannot be loaded: only available on BSD family systems.
[DEBUG   ] Error loading module.nova: The nova execution module failed to load: only available if nova is installed.
[DEBUG   ] Error loading module.eselect: The eselect execution module cannot be loaded: either the system is not Gentoo or the eselect binary is not in the path.
[DEBUG   ] Error loading module.hg: The hg execution module cannot be loaded: hg unavailable.
[DEBUG   ] Error loading module.munin: The munin execution module cannot be loaded: munin-node is not installed.
[DEBUG   ] Error loading module.esxi: The esxi execution module failed to load: only available on proxy minions.
[DEBUG   ] Error loading module.pacman: The pacman module could not be loaded: unsupported OS family.
[DEBUG   ] Error loading module.moosefs: The moosefs execution module cannot be loaded: the mfsgetgoal binary is not in the path.
[DEBUG   ] Error loading module.dracr: The drac execution module cannot be loaded: racadm binary not in path.
[DEBUG   ] Error loading module.test_virtual: The test_virtual execution module failed to load.
[DEBUG   ] Error loading module.nagios: The nagios execution module cannot be loaded: nagios-plugins are not installed.
[DEBUG   ] Error loading module.at: The at module could not be loaded: at command not found
[DEBUG   ] Error loading module.riak: The riak execution module failed to load: the riak binary is not in the path.
[DEBUG   ] Error loading module.mac_timezone: The mac_timezone module could not be loaded: module only works on Mac OS X systems.
[DEBUG   ] Error loading module.mongodb: The mongodb execution module cannot be loaded: the pymongo library is not available.
[DEBUG   ] Error loading module.rest_service: The rest_service execution module failed to load: only works on a rest_sample proxy minion.
[DEBUG   ] Error loading module.drac: The drac execution module cannot be loaded: racadm binary not in path.
[DEBUG   ] Error loading module.splunk: The splunk execution module failed to load: requires splunk python library to be installed.
[DEBUG   ] Error loading module.svn: The svn execution module cannot be loaded: svn unavailable.
[DEBUG   ] Error loading module.rallydev: The rallydev execution module failed to load: rallydev:username not defined in config.
[DEBUG   ] Error loading module.tomcat: Tomcat execution module not loaded: neither Tomcat installed locally nor tomcat-manager credentials set in grains/pillar/config.
[DEBUG   ] Error loading module.monit: The monit execution module cannot be loaded: the monit binary is not in the path.
[DEBUG   ] Error loading module.oracle: The oracle execution module not loaded: python oracle library not found.
[DEBUG   ] Error loading module.logadm: The logadm execution module cannot be loaded: only available on Solaris.
[DEBUG   ] Could not LazyLoad pkg.ex_mod_init
[INFO    ] Running state [postgresql-9.4.1-1.ru7] at time 17:17:52.711070
[INFO    ] Executing state pkg.installed for postgresql-9.4.1-1.ru7
[INFO    ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)\n'] in directory '/heroes/u1/dam402'
[DEBUG   ] Could not LazyLoad pkg.check_db
[INFO    ] Executing command ['yum', '-y', 'install', 'postgresql-9.4.1-1.ru7'] in directory '/heroes/u1/dam402'
[INFO    ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)\n'] in directory '/heroes/u1/dam402'
[ERROR   ] The following packages failed to install/update: postgresql-9.4.1-1.ru7
[INFO    ] Completed state [postgresql-9.4.1-1.ru7] at time 17:17:55.969274 duration_in_ms=3258.204
[DEBUG   ] File /var/cache/salt/minion/accumulator/31230800 does not exist, no need to cleanup.
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] LazyLoaded highstate.output
local:
----------
          ID: postgresql
    Function: pkg.installed
        Name: postgresql-9.4.1-1.ru7
      Result: False
     Comment: The following packages failed to install/update: postgresql-9.4.1-1.ru7
     Started: 17:17:52.711070
    Duration: 3258.204 ms
     Changes:   

Summary for local
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
$ 
gurchik commented 8 years ago

Reading through the code it looks like yumpkg.py expects the name to not include a version number. I re-read the documentation and it is right, it is suggested you use version: 9.4.1 instead. However, it still fails.

I apply the following state to the minion:

postgresql:
  pkg.installed:
    - name: postgresql
    - version: 9.4.1

and I receive:

$ sudo salt-call -ldebug state.sls test-saltbug
[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: opus2
[DEBUG   ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[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   ] Connecting to master. Attempt 1 of 1
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] Generated random reconnect delay between '1000ms' and '11000ms' (4342)
[DEBUG   ] Setting zmq_reconnect_ivl to '4342ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'clear')
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded state.sls
[DEBUG   ] LazyLoaded saltutil.is_running
[DEBUG   ] LazyLoaded grains.get
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[INFO    ] Loading fresh modules for state activity
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] Could not find file from saltenv 'base', 'salt://test-saltbug.sls'
[DEBUG   ] In saltenv 'base', looking at rel_path 'test-saltbug/init.sls' to resolve 'salt://test-saltbug/init.sls'
[DEBUG   ] In saltenv 'base', ** considering ** path '/var/cache/salt/minion/files/base/test-saltbug/init.sls' to resolve 'salt://test-saltbug/init.sls'
[INFO    ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://test-saltbug/init.sls'
[DEBUG   ] compile template: /var/cache/salt/minion/files/base/test-saltbug/init.sls
[DEBUG   ] Jinja search path: ['/var/cache/salt/minion/files/base']
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/base/test-saltbug/init.sls' using 'jinja' renderer: 0.0206580162048
[DEBUG   ] Rendered data from file: /var/cache/salt/minion/files/base/test-saltbug/init.sls:
# https://github.com/saltstack/salt/issues/34861
postgresql:
  pkg.installed:
    - name: postgresql
    - version: 9.4.1

[DEBUG   ] LazyLoaded config.get
[DEBUG   ] Results of YAML rendering: 
OrderedDict([('postgresql', OrderedDict([('pkg.installed', [OrderedDict([('name', 'postgresql')]), OrderedDict([('version', '9.4.1')])])]))])
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/base/test-saltbug/init.sls' using 'yaml' renderer: 0.0260529518127
[DEBUG   ] Error loading module.win_pkg: Module win_pkg: module only works on Windows systems
[DEBUG   ] Error loading module.pkgin: The pkgin execution module cannot be loaded: only available on NetBSD, SunOS, DragonFly, Minix, Darwin, SmartOS systems.
[DEBUG   ] Error loading module.opkg: Module opkg only works on nilrt based systems
[DEBUG   ] Error loading module.mac_pkgutil: Only available on Mac OS systems
[DEBUG   ] Error loading module.dpkg: The dpkg execution module cannot be loaded: only works on Debian family systems.
[DEBUG   ] Error loading module.pkgng: The pkgng execution module cannot be loaded: only available on FreeBSD 10 or FreeBSD 9 with providers.pkg set to pkgng.
[DEBUG   ] Error loading module.aptpkg: The pkg module could not be loaded: unsupported OS family
[DEBUG   ] Error loading module.pkgutil: The pkgutil execution module cannot be loaded: only available on Solaris systems.
[DEBUG   ] LazyLoaded pkg.install
[DEBUG   ] LazyLoaded pkg.installed
[DEBUG   ] Error loading module.solarispkg: The solarispkg execution module failed to load: only available on Solaris <= 10.
[DEBUG   ] Error loading module.openbsdpkg: The openbsdpkg execution module cannot be loaded: only available on OpenBSD systems.
[DEBUG   ] Error loading module.freebsdpkg: The freebsdpkg execution module cannot be loaded: either the os is not FreeBSD or the version of FreeBSD is >= 10.
[DEBUG   ] Error loading module.selinux: Module only works on Linux with selinux installed
[DEBUG   ] Error loading module.varnish: The varnish execution module failed to load: either varnishd or varnishadm is not in the path.
[DEBUG   ] Error loading module.xapi: Module xapi: xenapi check failed
[DEBUG   ] Error loading module.ebuild: The ebuild execution module cannot be loaded: either the system is not Gentoo or the portage python library is not available.
[DEBUG   ] Error loading module.win_servermanager: Failed to load win_servermanager module: Only available on Windows systems.
[DEBUG   ] Error loading module.netbsd_sysctl: The netbsd_sysctl execution module failed to load: only available on NetBSD.
[DEBUG   ] Error loading module.win_service: Module win_service: module only works on Windows systems
[DEBUG   ] Error loading module.boto_lambda: The boto_lambda module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.dig: The dig execution module cannot be loaded: the dig binary is not in the path.
[DEBUG   ] Error loading module.zpool: Module zpool: zpool not found
[DEBUG   ] Error loading module.freebsdports: The freebsdports execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.qemu_nbd: The qemu_nbd execution module cannot be loaded: the qemu-nbd binary is not in the path.
[DEBUG   ] Error loading module.netaddress: The netaddress execution module cannot be loaded: netaddr python library is not installed.
[DEBUG   ] Error loading module.chef: Cannot load chef module: chef-client not found
[DEBUG   ] Error loading module.glusterfs: glusterfs server is not installed
[DEBUG   ] Error loading module.mdata: mdata module can only be loaded on SmartOS zones
[DEBUG   ] Error loading module.memcached: The memcached execution module cannot be loaded: python memcache library not available.
[DEBUG   ] Error loading module.win_powercfg: Module only works on Windows.
[DEBUG   ] Error loading module.solarisips: The solarisips execution module failed to load: only available on Solaris >= 11.
[DEBUG   ] Error loading module.chassis: The chassis execution module cannot be loaded: this only works in proxy minions.
[DEBUG   ] Error loading module.debconfmod: The debconfmod module could not be loaded: unsupported OS family
[DEBUG   ] Error loading module.rdp: Module only works on Windows.
[DEBUG   ] Error loading module.guestfs: The guestfs execution module cannot be loaded: guestmount binary not in path.
[DEBUG   ] Error loading module.influx: The influx execution module cannot be loaded: influxdb library not available.
[DEBUG   ] Error loading module.win_system: Module win_system: module only works on Windows systems
[DEBUG   ] Error loading module.glance: The glance execution module cannot be loaded: the glanceclient python library is not available.
[DEBUG   ] Error loading module.iwtools: The iwtools execution module cannot be loaded: iwconfig is not installed.
[DEBUG   ] Error loading module.chocolatey: Cannot load module chocolatey: Chocolatey requires Windows
[DEBUG   ] Error loading module.cassandra_cql: Cannot load cassandra_cql module: python driver not found
[DEBUG   ] Error loading module.boto_asg: The boto_asg module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.solaris_group: The solaris_group execution module failed to load: only available on Solaris systems.
[DEBUG   ] Error loading module.mssql: The mssql execution module cannot be loaded: the pymssql python library is not available.
[DEBUG   ] Error loading module.trafficserver: trafficserver execution module not loaded: traffic_line command not found.
[DEBUG   ] Error loading module.twilio_notify: The twilio_notify execution module failed to load: the twilio python library is not installed.
[DEBUG   ] Error loading module.grub_legacy: The grub_legacy execution module cannot be loaded: the grub config file does not exist in /boot/grub/
[DEBUG   ] Error loading module.pushbullet: Pushbullet API Key Unavailable, not loading.
[DEBUG   ] Error loading module.win_groupadd: Module win_groupadd: module only works on Windows systems
[DEBUG   ] Error loading module.mac_assistive: The assistive module cannot be loaded: must be run on OSX 10.9 or newer.
[DEBUG   ] Error loading module.npm: npm execution module could not be loaded because the npm binary could not be located
[DEBUG   ] Error loading module.mac_softwareupdate: The softwareupdate module could not be loaded: module only works on MacOS systems.
[DEBUG   ] Error loading module.x509: Could not load x509 module, m2crypto unavailable
[DEBUG   ] Error loading module.solaris_user: The solaris_user execution module failed to load: only available on Solaris systems with pwd module installed.
[DEBUG   ] Error loading module.znc: Module znc: znc binary not found
[DEBUG   ] Error loading module.github: The github execution module cannot be loaded: PyGithub library is not installed.
[DEBUG   ] Error loading module.mac_system: The mac_system module could not be loaded: module only works on MacOS systems.
[DEBUG   ] Error loading module.xmpp: Module xmpp: required libraries failed to load
[DEBUG   ] Error loading module.rpmbuild: The rpmbuild module could not be loaded: requires python-gnupg, gpg, rpm, rpmbuild, mock and createrepo utilities to be installed
[DEBUG   ] Error loading module.win_task: Module win_task: module only works on Windows systems
[DEBUG   ] Error loading module.powerpath: The powerpath execution module cannot be loaded: the emcpreg binary is not available.
[DEBUG   ] Error loading module.portage_config: portage_config execution module cannot be loaded: only available on Gentoo with portage installed.
[DEBUG   ] Error loading module.freebsdservice: The freebsdservice execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.openbsdrcctl: The openbsdpkg execution module cannot be loaded: only available on OpenBSD systems.
[DEBUG   ] Error loading module.boto_sns: The boto_sns module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.augeas_cfg: Cannot load augeas_cfg module: augeas python module not installed
[DEBUG   ] Error loading module.boto_cfn: The module boto_cfs could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.win_wua: Module win_wua: module has failed dependencies or is not on Windows client
[DEBUG   ] Error loading module.ifttt: IFTTT Secret Key Unavailable, not loading.
[DEBUG   ] Error loading module.debian_ip: The debian_ip module could not be loaded: unsupported OS family
[DEBUG   ] Error loading module.win_dns_client: Module win_dns_client: module only works on Windows systems
[DEBUG   ] Error loading module.freebsdjail: The freebsdjail execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.mac_service: Failed to load the mac_service module:
Only available on Mac OS X systems.
[DEBUG   ] Error loading module.stormpath: The stormpath execution module failed to load: requires the stormpath:apiid config option to be set.
[DEBUG   ] Error loading module.bluez: The bluetooth execution module cannot be loaded: bluetooth not installed.
[DEBUG   ] Error loading module.victorops: No VictorOps api key found.
[DEBUG   ] Error loading module.makeconf: The makeconf execution module cannot be loaded: only available on Gentoo systems.
[DEBUG   ] Error loading module.win_path: Module win_path: module only works on Windows systems
[DEBUG   ] Error loading module.mac_power: The mac_power module could not be loaded: module only works on Mac OS X systems.
[DEBUG   ] Error loading module.solaris_system: The system execution module failed to load: only available on Solaris-like ystems with shutdown command.
[DEBUG   ] Error loading module.smf: The smf execution module failed to load: only available on Solaris.
[DEBUG   ] Error loading module.system_profiler: The system_profiler execution module cannot be loaded: system_profiler unavailable.
[DEBUG   ] Error loading module.reg: reg execution module failed to load: either the system is not Windows or the _winreg python library not available.
[DEBUG   ] Error loading module.splunk_search: The splunk_search execution module failed to load: requires both the requests and the splunk-sdk python library to be installed.
[DEBUG   ] Error loading module.sensors: sensors does not exist in the path
[DEBUG   ] Error loading module.boto_ec2: The boto_ec2 module cannot be loaded: boto library not found
[DEBUG   ] Error loading module.win_dsc: Module DSC: Module only works on Windows systems 
[DEBUG   ] Error loading module.win_firewall: Module win_firewall: module only works on Windows systems
[DEBUG   ] Error loading module.nacl: libnacl import error, perhaps missing python libnacl package
[DEBUG   ] Error loading module.openbsdservice: The openbsdservice execution module cannot be loaded: only available on OpenBSD systems.
[DEBUG   ] Error loading module.puppet: The puppet execution module cannot be loaded: facter, puppet unavailable.
[DEBUG   ] Error loading module.service: Your OS is on the disabled list
[DEBUG   ] Error loading module.gpg: The gpg execution module cannot be loaded; the gnupg python module is not installed.
[DEBUG   ] Error loading module.debian_service: The debian_service module could not be loaded: unsupported OS family and/or systemd running.
[DEBUG   ] Error loading module.linux_ip: Module linux_ip: RedHat systems are not supported.
[DEBUG   ] Error loading module.bower: The bower module could not be loaded: bower command not found
[DEBUG   ] Error loading module.gentoo_service: The gentoo_service execution module cannot be loaded: only available on Gentoo systems.
[DEBUG   ] Error loading module.ssh_package: The ssh_package execution module failed to load: only works on an ssh_sample proxy minion.
[DEBUG   ] Error loading module.win_ntp: Module win_system: module only works on Windows systems
[DEBUG   ] Error loading module.dockerio: dockerio execution module not loaded: docker python library not available.
[DEBUG   ] Error loading module.netscaler: The netscaler execution module failed to load: the nsnitro python library is not available.
[DEBUG   ] Error loading module.win_update: Module win_update: module has failed dependencies or is not on Windows client
[DEBUG   ] Error loading module.bridge: The bridge execution module failed to load: requires one of the following tool/os combinations: ifconfig on FreeBSD/OpenBSD, brctl on Linux or brconfig on NetBSD.
[DEBUG   ] Error loading module.win_file: Module win_file: module only works on Windows systems
[DEBUG   ] Error loading module.vboxmanage: The vboxmanaged execution module failed to load: VBoxManage is not installed.
[DEBUG   ] Error loading module.marathon: The marathon execution module cannot be loaded: this only works in proxy minions.
[DEBUG   ] Error loading module.cassandra: The cassandra execution module cannot be loaded: pycassa not installed.
[DEBUG   ] Error loading module.junos: The junos module could not be                 loaded: junos-eznc or proxy could not be loaded.
[DEBUG   ] Error loading module.boto_rds: The boto_rds module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.win_timezone: Module win_timezone: tzutil not found or is not on Windows client
[DEBUG   ] Error loading module.mac_group: The mac_group execution module cannot be loaded: only available on Darwin-based systems >= 10.7
[DEBUG   ] Error loading module.boto_cloudwatch: The boto_cloudwatch module cannot be loaded: boto libraries are unavailable.
[DEBUG   ] Error loading module.zfs: The zfs module cannot be loaded: zfs not found
[DEBUG   ] Error loading module.gentoolkitmod: The gentoolkitmod execution module cannot be loaded: either the system is not Gentoo or the gentoolkit.eclean python module not available
[DEBUG   ] Error loading module.aws_sqs: The module aws_sqs could not be loaded: aws command not found
[DEBUG   ] Error loading module.cyg: Module cyg: module only works on Windows systems.
[DEBUG   ] Error loading module.ldapmod: The ldapmod execution module cannot be loaded: ldap config not present.
[DEBUG   ] Error loading module.rh_service: RedHat-based distros >= version 7 use systemd, will not load rh_service.py as virtual 'service'
[DEBUG   ] Error loading module.freebsdkmod: The freebsdkmod execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.smartos_vmadm: vmadm module can only be loaded on SmartOS computed nodes
[DEBUG   ] Error loading module.dockerng: Docker module could not get imported
[DEBUG   ] Error loading module.layman: layman execution module cannot be loaded: only available on Gentoo with layman installed.
[DEBUG   ] Error loading module.ssh_service: The ssh_service execution module failed to load: only works on an ssh_sample proxy minion.
[DEBUG   ] Error loading module.win_dism: Only available on Windows systems
[DEBUG   ] Error loading module.win_disk: Module win_disk: module only works on Windows systems
[DEBUG   ] Error loading module.win_dacl: Module win_dacl: module only works on Windows systems
[DEBUG   ] Error loading module.lvs: The lvs execution module cannot be loaded: the ipvsadm binary is not in the path.
[DEBUG   ] Error loading module.rest_package: The rest_package execution module failed to load: only works on a rest_sample proxy minion.
[DEBUG   ] Error loading module.boto_elb: The boto_elb module cannot be loaded: boto library not found
[DEBUG   ] Error loading module.pw_user: The pw_user execution module cannot be loaded: the pwd python module is not available or the system is not FreeBSD.
[DEBUG   ] Error loading module.mac_shadow: Not Darwin
[DEBUG   ] Error loading module.mdadm: The mdadm execution module cannot be loaded: the mdadm binary is not in the path.
[DEBUG   ] Error loading module.smartos_virt: virt module can only be loaded on SmartOS computed nodes
[DEBUG   ] Error loading module.launchctl: Failed to load the mac_service module:
Only available on Mac OS X systems.
[DEBUG   ] Error loading module.parallels: Cannot load prlctl module: prlctl utility not available
[DEBUG   ] Error loading module.boto_secgroup: The boto_secgroup module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.solr: The solr execution module failed to load: requires both the solr and apache-solr binaries in the path.
[DEBUG   ] Error loading module.boto_vpc: The boto_vpc module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.tls: PyOpenSSL version 0.10 or later must be installed before this module can be used.
[DEBUG   ] Error loading module.ilo: ilo execution module not loaded: the hponcfg binary is not in the path.
[DEBUG   ] Error loading module.pw_group: The pw_group execution module cannot be loaded: system is not supported.
[DEBUG   ] Error loading module.saltcloudmod: The saltcloudmod execution module failed to load: requires the saltcloud library.
[DEBUG   ] Error loading module.mac_brew: The brew module could not be loaded: brew not found or grain os != MacOS
[DEBUG   ] Error loading module.ps: The ps module cannot be loaded: python module psutil not installed.
[DEBUG   ] Error loading module.bamboohr: The API key was not specified. Please specify it using the "apikey" config.
[DEBUG   ] Error loading module.nftables: The nftables execution module failed to load: nftables is not installed.
[DEBUG   ] Error loading module.upstart: The upstart execution module failed to load: this system was booted with systemd.
[DEBUG   ] Error loading module.kerberos: The kerberos execution module not loaded: kadmin not in path
[DEBUG   ] Error loading module.zypper: Module zypper: non SUSE OS not suppored by zypper package manager
[DEBUG   ] Error loading module.boto_sqs: The boto_sqs module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.boto_elasticache: The modle boto_elasticache could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.eix: The eix execution module cannot be loaded: either the system is not Gentoo or the eix binary is not in the path.
[DEBUG   ] Error loading module.solaris_shadow: The solaris_shadow execution module failed to load: only available on Solaris systems.
[DEBUG   ] Error loading module.zk_concurrency: Module zk_concurrency: dependencies failed
[DEBUG   ] Error loading module.mac_desktop: Cannot load OSX desktop module: This is not an OSX host.
[DEBUG   ] Error loading module.boto_dynamodb: The module boto_dynamodb could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.deb_apache: apache execution module not loaded: apache not installed.
[DEBUG   ] Error loading module.win_autoruns: Module win_autoruns: module only works on Windows systems
[DEBUG   ] Error loading module.hadoop: The hadoop execution module cannot be loaded: hadoop binary not in path.
[DEBUG   ] Error loading module.win_ip: Module win_ip: module only works on Windows systems
[DEBUG   ] Error loading module.boto_kms: The boto_kms module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.pam: The pam execution module failed to load: pam is not installed.
[DEBUG   ] Error loading module.poudriere: The poudriere execution module failed to load: only available on FreeBSD with the poudriere binary in the path.
[DEBUG   ] Error loading module.sysrc: The sysrc execution module failed to load: the sysrc binary is not in the path.
[DEBUG   ] Error loading module.boto_route53: The boto_route53 module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.win_useradd: Module win_useradd: module has failed dependencies or is not on Windows client
[DEBUG   ] Error loading module.boto_iam: The boto_iam module could not be loaded: boto libraries not found
[DEBUG   ] Error loading module.lxc: The lxc execution module cannot be loaded: the lxc-start binary is not in the path.
[DEBUG   ] Error loading module.ddns: The ddns execution module cannot be loaded: dnspython not installed.
[DEBUG   ] Error loading module.dockercompose: The dockercompose execution module not loaded: compose python library not available.
[DEBUG   ] Error loading module.mac_ports: mac_ports only available on MacOS
[DEBUG   ] Error loading module.win_repo: This module only works on Windows.
[DEBUG   ] Error loading module.netbsdservice: The netbsdservice execution module failed to load: only available on NetBSD.
[DEBUG   ] Error loading module.omapi: The omapi execution module cannot be loaded: the pypureomapi python library is not available.
[DEBUG   ] Error loading module.win_shadow: Module win_shadow: module only works on Windows systems.
[DEBUG   ] Error loading module.osquery: The osquery execution module cannot be loaded: osqueryi binary is not in the path.
[DEBUG   ] Error loading module.sysbench: The sysbench execution module failed to load: the sysbench binary is not in the path.
[DEBUG   ] Error loading module.ipmi: No module named pyghmi.ipmi
[DEBUG   ] Error loading module.cpan: Unable to locate cpan. Make sure it is installed and in the PATH.
[DEBUG   ] Error loading module.win_status: Cannot load win_status module on non-windows
[DEBUG   ] Error loading module.solaris_fmadm: fmadm module can only be loaded on Solaris with the fault management installed
[DEBUG   ] Error loading module.redismod: The redis execution module failed to load: the redis python library is not available.
[DEBUG   ] Error loading module.win_network: Module win_network: module only works on Windows systems
[DEBUG   ] Error loading module.mac_sysctl: The darwin_sysctl execution module cannot be loaded: only available on MacOS systems.
[DEBUG   ] Error loading module.openbsd_sysctl: The openbsd_sysctl execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.win_iis: Module win_iis: module only works on Windows systems
[DEBUG   ] Error loading module.keystone: keystone execution module cannot be loaded: keystoneclient python library not available.
[DEBUG   ] Error loading module.deb_postgres: postgres execution module not loaded: pg_createcluste command not found.
[DEBUG   ] Error loading module.haproxyconn: The haproxyconn execution module cannot be loaded: haproxyctl module not available
[DEBUG   ] Error loading module.smartos_imgadm: imgadm module can only be loaded on SmartOS computed nodes
[DEBUG   ] Error loading module.freebsd_sysctl: The freebsd_sysctl execution module cannot be loaded: only available on FreeBSD systems.
[DEBUG   ] Error loading module.qemu_img: The qemu_img execution module cannot be loaded: the qemu-img binary is not in the path.
[DEBUG   ] Error loading module.vsphere: Missing dependency: The vSphere module requires the pyVmomi Python module.
[DEBUG   ] Error loading module.bsd_shadow: The bsd_shadow execution module cannot be loaded: only available on BSD family systems.
[DEBUG   ] Error loading module.nova: The nova execution module failed to load: only available if nova is installed.
[DEBUG   ] Error loading module.eselect: The eselect execution module cannot be loaded: either the system is not Gentoo or the eselect binary is not in the path.
[DEBUG   ] Error loading module.hg: The hg execution module cannot be loaded: hg unavailable.
[DEBUG   ] Error loading module.munin: The munin execution module cannot be loaded: munin-node is not installed.
[DEBUG   ] Error loading module.esxi: The esxi execution module failed to load: only available on proxy minions.
[DEBUG   ] Error loading module.pacman: The pacman module could not be loaded: unsupported OS family.
[DEBUG   ] Error loading module.moosefs: The moosefs execution module cannot be loaded: the mfsgetgoal binary is not in the path.
[DEBUG   ] Error loading module.dracr: The drac execution module cannot be loaded: racadm binary not in path.
[DEBUG   ] Error loading module.test_virtual: The test_virtual execution module failed to load.
[DEBUG   ] Error loading module.nagios: The nagios execution module cannot be loaded: nagios-plugins are not installed.
[DEBUG   ] Error loading module.at: The at module could not be loaded: at command not found
[DEBUG   ] Error loading module.riak: The riak execution module failed to load: the riak binary is not in the path.
[DEBUG   ] Error loading module.mac_timezone: The mac_timezone module could not be loaded: module only works on Mac OS X systems.
[DEBUG   ] Error loading module.mongodb: The mongodb execution module cannot be loaded: the pymongo library is not available.
[DEBUG   ] Error loading module.rest_service: The rest_service execution module failed to load: only works on a rest_sample proxy minion.
[DEBUG   ] Error loading module.drac: The drac execution module cannot be loaded: racadm binary not in path.
[DEBUG   ] Error loading module.splunk: The splunk execution module failed to load: requires splunk python library to be installed.
[DEBUG   ] Error loading module.svn: The svn execution module cannot be loaded: svn unavailable.
[DEBUG   ] Error loading module.rallydev: The rallydev execution module failed to load: rallydev:username not defined in config.
[DEBUG   ] Error loading module.tomcat: Tomcat execution module not loaded: neither Tomcat installed locally nor tomcat-manager credentials set in grains/pillar/config.
[DEBUG   ] Error loading module.monit: The monit execution module cannot be loaded: the monit binary is not in the path.
[DEBUG   ] Error loading module.oracle: The oracle execution module not loaded: python oracle library not found.
[DEBUG   ] Error loading module.logadm: The logadm execution module cannot be loaded: only available on Solaris.
[DEBUG   ] Could not LazyLoad pkg.ex_mod_init
[INFO    ] Running state [postgresql] at time 15:53:47.562583
[INFO    ] Executing state pkg.installed for postgresql
[INFO    ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)\n'] in directory '/heroes/u1/dam402'
[DEBUG   ] Could not LazyLoad pkg.check_db
[DEBUG   ] Could not LazyLoad pkg.check_extra_requirements
[DEBUG   ] Could not LazyLoad pkg.version_clean
[DEBUG   ] Current version (['9.4.1-1.ru7']) did not match desired version specification (9.4.1), adding to installation targets
[INFO    ] Executing command ['yum', '-y', 'downgrade', 'postgresql-9.4.1'] in directory '/heroes/u1/dam402'
[INFO    ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)\n'] in directory '/heroes/u1/dam402'
[DEBUG   ] Could not LazyLoad pkg.version_clean
[ERROR   ] The following packages failed to install/update: postgresql=9.4.1
[INFO    ] Completed state [postgresql] at time 15:53:50.457984 duration_in_ms=2895.401
[DEBUG   ] File /var/cache/salt/minion/accumulator/61783952 does not exist, no need to cleanup.
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506', 'aes')
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'opus2', 'tcp://192.168.226.90:4506')
[DEBUG   ] LazyLoaded highstate.output
local:
----------
          ID: postgresql
    Function: pkg.installed
      Result: False
     Comment: The following packages failed to install/update: postgresql=9.4.1
     Started: 15:53:47.562583
    Duration: 2895.401 ms
     Changes:   

Summary for local
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
$

An interesting line to note:

[DEBUG   ] Current version (['9.4.1-1.ru7']) did not match desired version specification (9.4.1), adding to installation targets

It is expected that 9.4.1-1.ru7 would satisfy version specification 9.4.1.

gurchik commented 8 years ago

Further testing needs to be done to determine if #35119 correctly addresses one half of this issue (package fails to install when it is not currently installed).

Ch3LL commented 8 years ago

@derekmaciel thanks for the PR and all the great investigation work! I did some testing with the following sls file on centos7 on the latest develop today to help with your need for a test case

postgresql:
  pkg.installed:
    - name: postgresql
    - version: 9.2.13-1.el7_1
  1. make sure package is not already installed:
[root@localhost salt]# rpm -qa | grep -i postg
[root@localhost salt]# 
  1. Run sls file:

salt-call --local state.sls post

local:
----------
          ID: postgresql
    Function: pkg.installed
      Result: True
     Comment: 1 targeted package was installed/updated.
     Started: 04:51:31.376767
    Duration: 6225.633 ms
     Changes:   
              ----------
              postgresql:
                  ----------
                  new:
                      9.2.13-1.el7_1
                  old:
              postgresql-libs:
                  ----------
                  new:
                      9.2.13-1.el7_1
                  old:

Summary for local
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
Total run time:   6.226 s
  1. verify it is installed:
[root@localhost salt]# rpm -qa | grep -i postg
postgresql-9.2.13-1.el7_1.x86_64
postgresql-libs-9.2.13-1.el7_1.x86_64

Does this test case accurately show that your PR is working correct? Are we okay to close htis now or do you want me to test something else?

gurchik commented 8 years ago

That looks great @Ch3LL, that's convincing enough, feel free to close this issue.

Ch3LL commented 8 years ago

Great thanks for the input. Closing now