Salt: 2018.3.0 State 'apache_module.enable' was not found in SLS. Reason: 'apache_module' __virtual__ returned False.

Created on 8 Apr 2018  路  14Comments  路  Source: saltstack/salt

Description of Issue/Question

Similar issues:

  • #26284
  • #19090
  • #14045

apache_module won't allow enabling modules. Master is running on Ubuntu 16.04 and minion on OpenSUSE Tumbleweed.

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

apache:
  pkg.installed:
    - pkgs:
      - apache2
      - apache2-mod_php7

mod_php7:
  apache_module.enable:
    - name: php7

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

# salt tumble state.apply suse_apache2
tumble:
----------
          ID: apache
    Function: pkg.installed
      Result: True
     Comment: 2 targeted packages were installed/updated.
     Started: 12:45:52.445081
    Duration: 37336.818 ms
     Changes:   
              ----------
              apache2:
                  ----------
                  new:
                      2.4.29-7.1
                  old:
              apache2-mod_php7:
                  ----------
                  new:
                      7.2.3-3.1
                  old:
              apache2-prefork:
                  ----------
                  new:
                      2.4.29-7.1
                  old:
              gpg-pubkey:
                  ----------
                  new:
                      a0e46e11-5911fc35
                  old:
                      1abd1afb-54176598,307e3d54-4be01a65,3dbdc284-53674dd4,a0e46e11-5911fc35
              kernel-default:
                  ----------
                  new:
                      4.15.13-1.7
                  old:
                      4.15.10-1.5,4.15.13-1.7
              kernel-default-devel:
                  ----------
                  new:
                      4.15.13-1.7
                  old:
                      4.15.10-1.5,4.15.13-1.7
              kernel-devel:
                  ----------
                  new:
                      4.15.13-1.7
                  old:
                      4.15.10-1.5,4.15.13-1.6,4.15.13-1.7
              kernel-source:
                  ----------
                  new:
                      4.15.13-1.7
                  old:
                      4.15.10-1.5,4.15.13-1.6,4.15.13-1.7
              kernel-syms:
                  ----------
                  new:
                      4.15.13-1.7
                  old:
                      4.15.13-1.6,4.15.13-1.7
----------
          ID: mod_php7
    Function: apache_module.enable
        Name: php7
      Result: False
     Comment: State 'apache_module.enable' was not found in SLS 'suse_apache2'
              Reason: 'apache_module' __virtual__ returned False
     Changes:   

Summary for tumble
------------
Succeeded: 1 (changed=1)
Failed:    1
------------
Total states run:     2
Total run time:  37.337 s
ERROR: Minions returned with non-zero exit code

I also tried to apply the state with apache_module.enabled:

tumble:
----------
          ID: apache
    Function: pkg.installed
      Result: True
     Comment: All specified packages are already installed
     Started: 12:49:03.997531
    Duration: 25859.478 ms
     Changes:   
----------
          ID: mod_php7
    Function: apache_module.enabled
        Name: php7
      Result: False
     Comment: State 'apache_module.enabled' was not found in SLS 'suse_apache2'
              Reason: 'apache_module' __virtual__ returned False
     Changes:   

Summary for tumble
------------
Succeeded: 1
Failed:    1
------------
Total states run:     2
Total run time:  25.859 s
ERROR: Minions returned with non-zero exit code

Versions Report

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

# salt --versions-report
Salt Version:
           Salt: 2018.3.0

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.4.2
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.3
   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.12 (default, Dec  4 2017, 14:50:18)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: Ubuntu 16.04 xenial
         locale: UTF-8
        machine: x86_64
        release: 4.4.0-119-generic
         system: Linux
        version: Ubuntu 16.04 xenial

Minion:

# salt-minion --versions-report
Salt Version:
           Salt: 2018.1.99

Dependency Versions:
           cffi: 1.11.5
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: 0.26.0
        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.4 (default, Jan 03 2018, 13:52:55) [GCC]
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 17.0.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist:   
         locale: UTF-8
        machine: x86_64
        release: 4.15.13-1-default
         system: Linux
        version: Not Installed


Minion is running on OpenSUSE Tumbleweed

I tried to see if the apache module works with:

# salt tumble apache.version
tumble:
    Apache/2.4.29 (Linux/SUSE)

Also apache2ctl is present:

(minion)# which apache2ctl
/usr/sbin/apache2ctl

Workaround

Enabling module with cmd.run 'a2enmod php7' works.

Bug P3 severity-medium

All 14 comments

ping @saltstack/team-suse mind taking a look here?

Same here on Ubuntu Bionic with 2018.3. and 2017.7.

looks like i'm able to replicate this. we will need to get this fixed up.

I've found the issue in modules/suse_apache.py, it simply matches os_family grain using wrong register ('SUSE' instead of 'Suse'; the latter is the right one). It is already fixed in dev.
Could one of contributors make a merge request to 2018.3.0 please?

- if salt.utils.path.which('apache2ctl') and __grains__['os_family'] == 'SUSE':
+ if salt.utils.path.which('apache2ctl') and __grains__['os_family'] == 'Suse':

Is there any progress in this ticket? I also have see this error in Ubuntu Bionic and salt minion 2019.2.0

I've the same issue..
Salt Master:

salt --versions-report
Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: 0.8.6
       cherrypy: Not Installed
       dateutil: 2.2
      docker-py: Not Installed
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.2
   mysql-python: 1.2.3
      pycparser: 2.10
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.9 (default, Sep 25 2018, 20:42:16)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.4.0
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.4.3
            ZMQ: 4.0.5

System Versions:
           dist: debian 8.11 
         locale: UTF-8
        machine: x86_64
        release: 3.16.0-7-amd64
         system: Linux
        version: debian 8.11 

salt minion:

salt-minion --versions-report
Salt Version:
           Salt: 2018.3.4

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.7.3
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.16 (default, Apr  6 2019, 01:42:57)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 17.1.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 5.1.1
            ZMQ: 4.3.1

System Versions:
           dist: debian 10.0 
         locale: UTF-8
        machine: x86_64
        release: 4.19.0-5-amd64
         system: Linux
        version: debian 10.0 
 ```

error message:
 Comment: State 'apache_module.enabled' was not found in SLS 'linux.apache-ssl'
          Reason: 'apache_module' __virtual__ returned False

```

Also getting the same issue on Ubuntu 18.04 minion 2018.3.4.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

serious? it still a bug and the "bot" want close this?! lol

Thank you for updating this issue. It is no longer marked as stale.

@Ch3LL I think this can be closed, since it's fixed in several releases now: v3000 v3000_docs v2019.8 v2019.2.3 v2019.2.3_docs v2019.2.2 v2019.2.2_docs v2019.2.1 v2019.2.0 v2019.2.0rc2 v2019.2.0rc1 v2019.2 v2018.11

@brejoc which PR fixed this issue? Looks like there is an unmerged pr that is suppose to fix this

@Ch3LL This should be the PR: https://github.com/saltstack/salt/pull/46441/files
And I got the list of releases from this commit.

thanks for pointing that out. I realized the PR in waiting is on 2018.3 branch. Thanks for letting us know. Will go ahead and close.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

udf2457 picture udf2457  路  3Comments

twangboy picture twangboy  路  3Comments

sagetherage picture sagetherage  路  3Comments

Arguros picture Arguros  路  3Comments

lhost picture lhost  路  3Comments