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

state.show_low_sls not working in salt-ssh #32525

Closed
anlutro opened this issue Apr 13, 2016 · 7 comments · Fixed by #35537
Closed

state.show_low_sls not working in salt-ssh #32525

anlutro opened this issue Apr 13, 2016 · 7 comments · Fixed by #35537
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@anlutro
Copy link
Contributor

anlutro commented Apr 13, 2016

Working with 2016.3 HEAD, I find that while salt-ssh minion state.show_sls test works, salt-ssh minion state.show_low_sls test does not, complaining about "No matching sls found for 'test' in env 'base'".

@jfindlay jfindlay added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around cannot-reproduce cannot be replicated with info/context provided Core relates to code central or existential to Salt Salt-SSH P3 Priority 3 labels Apr 13, 2016
@jfindlay jfindlay added this to the Approved milestone Apr 13, 2016
@jfindlay
Copy link
Contributor

@anlutro, thanks for reporting. I am not able to reproduce this with a simple SLS. Is there anything else to try? (I get the same results without salt-ssh).

root@jmoney-debian-8:~# cat /srv/salt/test.sls
testing state:
  cmd.run:
    - name: echo test
root@jmoney-debian-8:~# salt-ssh '*' state.apply test
[INFO    ] Determining pillar cache
[INFO    ] Fetching file from saltenv 'base', ** done ** 'test.sls'
jmoney-debian-8:
----------
          ID: testing state
    Function: cmd.run
        Name: echo test
      Result: True
     Comment: Command "echo test" run
     Started: 12:10:36.972637
    Duration: 12.548 ms
     Changes:
              ----------
              pid:
                  11653
              retcode:
                  0
              stderr:
              stdout:
                  test

Summary for jmoney-debian-8
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
root@jmoney-debian-8:~# salt-ssh '*' state.show_sls test
[INFO    ] Determining pillar cache
[INFO    ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://test.sls'
jmoney-debian-8:
    ----------
    testing state:
        ----------
        __env__:
            base
        __sls__:
            test
        cmd:
            |_
              ----------
              name:
                  echo test
            - run
            |_
              ----------
              order:
                  10000
root@jmoney-debian-8:~# salt-ssh '*' state.show_low_sls test
jmoney-debian-8:
    |_
      ----------
      __env__:
          base
      __id__:
          testing state
      __sls__:
          test
      fun:
          run
      name:
          echo test
      order:
          10000
      state:
          cmd
root@jmoney-debian-8:~# salt-ssh --versions
Salt Version:
           Salt: 2016.3.0-n/a-17fdd7a

Dependency Versions:
           cffi: 0.8.6
       cherrypy: Not Installed
       dateutil: Not Installed
          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: 1.2.3
      pycparser: 2.10
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.9 (default, Mar  1 2015, 12:57:24)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.4.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.3
            ZMQ: 4.0.5

System Versions:
           dist: debian 8.3
        machine: x86_64
        release: 3.16.0-4-amd64
         system: Linux
        version: debian 8.3

@anlutro
Copy link
Contributor Author

anlutro commented Apr 13, 2016

Odd. I'm not doing anything more special than what you're doing. SSHing into the machine and running salt-call shows:

[DEBUG   ] Could not find file from saltenv 'base', 'salt://common.sls'
[DEBUG   ] Could not find file from saltenv 'base', 'salt://common/init.sls'

So I guess salt-ssh isn't transferring the file tree correctly? I do use a Saltfile + master config to make salt-ssh runnable as non-root, but can't see anything in the debug log indicating that's a problem.

% salt-ssh --versions                             
Salt Version:
           Salt: 2016.3.0rc2-20-g17fdd7a

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.7
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.9 (default, Mar  1 2015, 12:57:24)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.3
            ZMQ: 4.1.2

System Versions:
           dist: debian 8.4 
        machine: x86_64
        release: 3.16.0-4-amd64
         system: Linux
        version: debian 8.4

@jfindlay
Copy link
Contributor

@anlutro, that could be the source of the problem.

@anlutro
Copy link
Contributor Author

anlutro commented Apr 14, 2016

Examining the debug log of a show_sls call vs a show_low_sls call, it seems that pillars don't get rendered when using show_low_sls. This could potentially be an issue because almost all my states do use pillars... Then again, I get this problem even when using a state with no traces of {{ pillar.whatever }}.

I was able to avoid the problem on one condition: the VM I was targetting with salt-ssh had to have an actual salt master installed on it.

Here are the relevant parts of my Saltfile and master config, though I don't think they make a difference for this bug.

# Saltfile
salt-ssh:
  config_dir: ./config

# config/master
root_dir: ./
pki_dir: config/pki
cachedir: .cache
file_roots:
  base:
    - states
pillar_roots:
  base:
    - pillars

@anlutro anlutro changed the title show_low_sls not working in 2016.3 (possibly salt-ssh related) show_low_sls not working (possibly salt-ssh related) Apr 14, 2016
@anlutro
Copy link
Contributor Author

anlutro commented Apr 14, 2016

Also, I just tested... This problem is present in 2015.8 as well.

To illustrate the salt master vs non-salt master thing - exact same configuration and sets of pillars/states used:

% salt-ssh 'some-random-minion' state.show_low_sls git.install
some-random-minion:
    - No matching sls found for 'git.install' in env 'base'

% salt-ssh 'saltmaster' state.show_low_sls git.install      
saltmaster:
    |_
      ----------
      __env__:
          base
      __id__:
          git-pkg
      __sls__:
          git.install
      fun:
          installed
      name:
          git
      order:
          10000
      state:
          pkg

@anlutro anlutro changed the title show_low_sls not working (possibly salt-ssh related) state.show_low_sls not working in salt-ssh Apr 14, 2016
@jfindlay jfindlay assigned jfindlay and unassigned jfindlay Apr 14, 2016
@Ch3LL
Copy link
Contributor

Ch3LL commented Apr 14, 2016

I am able to replicate this and am getting the same error. Here is my test case:

/etc/salt/master:

file_roots:
  base:
    - /srv/salt/
log_level: debug
pillar_roots:
  base:
    - /srv/salt/pillar/

Here is my sls file:

[ch3ll@ch3ll-master git]$ cat /srv/salt/test-file.sls 
create-file:
  file.managed:
    - name: /tmp/test-test-test

I can call the sls file just fine:

➜  git sudo salt-ssh '*test*' state.sls test-file
ch3ll-test:
----------
          ID: create-file
    Function: file.managed
        Name: /tmp/test-test-test
      Result: True
     Comment: Empty file
     Started: 10:42:01.449162
    Duration: 117.84 ms
     Changes:   
              ----------
              new:
                  file /tmp/test-test-test created

Summary for ch3ll-test
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1

➜  ~ sudo salt-ssh '*test*' state.show_low_sls test-file
ch3ll-test:
    - No matching sls found for 'test-file' in env 'base'

Also to note I still could not get it work when installingand running the salt-master on the target salt-ssh minion.

I tested this on the following salt versions with the same results: 2016.3.0rc2-196-g6c3d7aa, 2015.8.8-339-g3c81798, 2015.8.8 and 2015.5.9.

@Ch3LL Ch3LL added Confirmed Salt engineer has confirmed bug/feature - often including a MCVE and removed cannot-reproduce cannot be replicated with info/context provided labels Apr 14, 2016
@rallytime
Copy link
Contributor

@anlutro and @Ch3LL Please see #34840, which was included in the 20156.3.2 release of Salt.

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 Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants