Skip to content
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

Regression on postgres_group.present ('postgres_group' __virtual__ returned False) #38001

Closed
tomlaredo opened this issue Nov 30, 2016 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior Execution-Module fixed-pls-verify fix is linked, bug author to confirm fix P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@tomlaredo
Copy link

Description of Issue/Question

Hi,

Since I upgraded salt master and minions to 2016.11.0 (Carbon), postgres_group.present and .absent states are broken.

Setup

File test_access.sls:

postgresql-grouptest:
    postgres_group.present:
        - name: grouptest

Steps to Reproduce Issue

salt-call state.apply test_access

# salt-call state.apply test_access
[INFO    ] Loading fresh modules for state activity
[INFO    ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://test_access.sls', mode up-to-date
[INFO    ] Executing command ['git', '--version'] in directory '/root'
[INFO    ] Running state [grouptest] at time 19:01:46.460469
[ERROR   ] State 'postgres_group.present' was not found in SLS 'softwares.postgresql.test_access'
Reason: 'postgres_group' __virtual__ returned False

local:
----------
          ID: postgresql-grouptest
    Function: postgres_group.present
        Name: grouptest
      Result: False
     Comment: State 'postgres_group.present' was not found in SLS 'softwares.postgresql.test_access'
              Reason: 'postgres_group' __virtual__ returned False
     Changes:   

Summary for local
------------
Succeeded: 0
Failed:    1

Versions Report

On Master:

# salt-call --versions-report
Salt Version:
           Salt: 2016.11.0
 
Dependency Versions:
           cffi: 0.8.6
       cherrypy: 3.5.0
       dateutil: 2.2
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.3
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.21.1
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.2
   mysql-python: Not Installed
      pycparser: 2.10
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.4.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5
 
System Versions:
           dist: debian 8.6 
        machine: x86_64
        release: 2.6.32-16-pve
         system: Linux
        version: debian 8.6 

On Minion:

# salt-call --versions-report
Salt Version:
           Salt: 2016.11.0
 
Dependency Versions:
           cffi: 0.8.6
       cherrypy: Not Installed
       dateutil: 2.2
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.3
        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
         pygit2: Not Installed
         Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.4.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5
 
System Versions:
           dist: debian 8.6 
        machine: x86_64
        release: 4.4.19-1-pve
         system: Linux
        version: debian 8.6 

@wolfpackmars2
Copy link
Contributor

wolfpackmars2 commented Dec 1, 2016

Reason: 'postgres_group' __virtual__ returned False

This indicates the Postgres module isn't loaded, which would happen if postgresql binaries aren't found.
Is postgresql installed by the time that state is run?

@tomlaredo
Copy link
Author

Hi, thanks for your reply but it is well installed (worked fine before 2016.11.0):

# dpkg -l | grep postgre
ii  postgresql-9.4                 9.4.9-0+deb8u1             amd64        object-relational SQL database, version 9.4 server
ii  postgresql-client-9.4          9.4.9-0+deb8u1             amd64        front-end programs for PostgreSQL 9.4
ii  postgresql-client-common       165+deb8u1                 all          manager for multiple PostgreSQL client versions
ii  postgresql-common              165+deb8u1                 all          PostgreSQL database-cluster manager
ii  postgresql-contrib             9.4+165+deb8u1             all          additional facilities for PostgreSQL (supported version)
ii  postgresql-contrib-9.4         9.4.9-0+deb8u1             amd64        additional facilities for PostgreSQL

# service postgresql status
9.4/main (port 5432): online

# telnet localhost 5432
Trying ::1...
Connected to localhost.
Escape character is '^]'.

@tomlaredo
Copy link
Author

tomlaredo commented Dec 1, 2016

This ticket is in fact linked to thoses issues:
#37986
#37935

The solution is to add this to /etc/salt/minion.d/minion.conf:
postgres.bins_dir: '/usr/lib/postgresql/{{ pg_version }}/bin/'

Where {{ pg_version }} is the postgres version (eg. 9.1, 9.4 ...)

So, before closing thoses tickets, I think that it is very important to either change the error message ("Reason: 'postgres_group' virtual returned False") by a better one ("Postgres seems to be absent. If present, check your postgres.bins_dir minion setting.") or change the default values to make it work on Debian (and other platforms).

@Ch3LL

@gtmanfred gtmanfred added Bug broken, incorrect, or confusing behavior Execution-Module P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps TEAM Platform labels Dec 1, 2016
@gtmanfred gtmanfred added this to the Approved milestone Dec 1, 2016
@gtmanfred gtmanfred added the severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around label Dec 1, 2016
@rallytime
Copy link
Contributor

@tomlaredo The change in #38023 updated the error message if the bins_dir setting is missing. This fix will be in the 2016.11.2 release.

@rallytime rallytime added the fixed-pls-verify fix is linked, bug author to confirm fix label Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Execution-Module fixed-pls-verify fix is linked, bug author to confirm fix P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

4 participants