New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State 'pip.installed' was not found in SLS #46247

Closed
piersf opened this Issue Feb 28, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@piersf

piersf commented Feb 28, 2018

Hello there,

We upgraded Saltstack to Nitrogen release (version 2017.7.3) from Carbon(version 2016.11.1) two days ago.
Currently, we are facing an issue with the pip.installed state when pushing to a minion. Both master and minion are running the same 2017.7.3 version. My state looks like below

virtualenv:
  pip.installed:
    - require:
      - pkg: python-pip

python-pip:
  pkg.installed

When running above states, we get an error saying:

----------
          ID: virtualenv
    Function: pip.installed
      Result: False
     Comment: State 'pip.installed' was not found in SLS 'path.to.sls.python-virtualenv'
              Reason: 'pip.installed' is not available.
     Changes:
----------

The salt-master and minion versions is:

Salt Version:
           Salt: 2017.7.3

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8.1
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.14 (default, Jan 31 2018, 02:12:13)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.5.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: redhat 6.9 Santiago
         locale: UTF-8
        machine: x86_64
        release: 2.6.32-642.3.1.el6.x86_64
         system: Linux
        version: Red Hat Enterprise Linux Server 6.9 Santiago

Searching on internet, I came across https://groups.google.com/forum/#!msg/salt-users/x3yX0cBasXw/XyaEGHsQ-nYJ and #24925 which basically say that I need to add reload_modules: True in the pip.installed state.
I have tried adding that but it does not seem to fix anything.

However, when I push the same states from the master running Nitrogen to a minion running Carbon, the above works fine - no issues.
The versions of that Carbon salt-minion are:

Salt Version:
           Salt: 2016.11.1

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 1.4.1
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.3
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.20.2
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.6.6 (r266:84292, May 22 2015, 08:34:51)
   python-gnupg: 0.3.8
         PyYAML: 3.11
          PyZMQ: 14.5.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: redhat 6.8 Santiago
        machine: x86_64
        release: 2.6.32-642.3.1.el6.x86_64
         system: Linux
        version: Red Hat Enterprise Linux Server 6.8 Santiago

The main difference between the Nitrogen salt-minion and the Carbon salt-minion are the version of Python they are using, with the first using Python: 2.7.14 (default, Jan 31 2018, 02:12:13) and the second using Python: 2.6.6 (r266:84292, May 22 2015, 08:34:51)

Any idea on why is this breaking? Why would it work against a minion running Carbon version but nor against a minion running Nitrogen?

Thanks,

@gtmanfred

This comment has been minimized.

Contributor

gtmanfred commented Feb 28, 2018

You will need the python27-pip package for nitrogen, What is failing is that salt-minion on centos 6 2017.7 uses python27, because we have dropped support for python2.6.

And the pip modules requires an importable pip module in order to run version comparisons.

virtualenv:
  pip.installed:
    - require:
      - pkg: pip

pip
  pkg.installed:
    - pkgs:
      - python27-pip
      - python-pip
    - reload_modules: true

If you want to make sure that you are pip installing to the python26 environment, you will need to do something like the above.

@gtmanfred gtmanfred closed this Feb 28, 2018

@gtmanfred gtmanfred added this to the Blocked milestone Feb 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment