SALT 1.7.1 Errors on Any SLS file

193 views
Skip to first unread message

sea...@gmail.com

unread,
Feb 25, 2015, 7:00:17 PM2/25/15
to salt-...@googlegroups.com


Hello  need a bit of help , hoping to talk to someone more knowledgeable than i on salt,  i am new to salt.  
Running Oracle Linux 6.6

FROM MASTER

salt --versions-report
           Salt: 2014.7.1
         Python: 2.6.6 (r266:84292, Jan 22 2014, 01:49:05)
         Jinja2: 2.2.1
       M2Crypto: 0.20.2
 msgpack-python: 0.4.4
   msgpack-pure: Not Installed
       pycrypto: 2.0.1
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 14.3.1
           RAET: Not Installed
            ZMQ: 3.2.4
           Mako: 0.3.4


FROM salt-minions

salt-minion --versions
           Salt: 2014.7.1
         Python: 2.6.6 (r266:84292, Jan 22 2014, 01:49:05)
         Jinja2: 2.2.1
       M2Crypto: 0.20.2
 msgpack-python: 0.4.4
   msgpack-pure: Not Installed
       pycrypto: 2.0.1
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 14.3.1
           RAET: Not Installed
            ZMQ: 3.2.4
           Mako: 0.3.4


  File SLS :

either one of these

 top.sls
base:
  '*':
    - webserver

  *********** OR ****************
 vim.sls
vim:
  pkg.installed   

THe command i execute is   salt '*' state.sls vim

Or for the top.sls  i have used

salt  < MYSERVERNAME>  top.sls state.highstate --log-level=debug

The Error i get 2 errors 1 is this below and the other is   DATA FAILED TO COMPILE

DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: MYSERVERNAME
[DEBUG   ] Missing configuration file: ~/.saltrc
[DEBUG   ] Configuration file path: /etc/salt/master
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: MYSERVERNAME
[DEBUG   ] Missing configuration file: ~/.saltrc
[DEBUG   ] MasterEvent PUB socket URI: ipc:///var/run/salt/master/
master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc
[DEBUG   ] LazyLoaded local_cache.get_load
[DEBUG   ] get_iter_returns for jid 20150225182946402733 sent to set(['myservername']) will timeout at 18:29:51.413233
[DEBUG   ] jid 20150225182946402733 return from myservername
MYSERVERNAME:
    'top.sls' is not available.
[DEBUG   ] jid 20150225182946402733 found all minions set(['myservername'])

 The TOP.SLS is sitting in /srv/salt and so is the below VIM.SLS

[root@salty salt]# salt '*' state.sls vim

For each of the minions i get the following,  

----------
          ID: vim
    Function: pkg.installed
      Result: False
     Comment: Package 'vim' not found (possible matches: vim-enhanced)
     Started: 18:30:23.680424
    Duration: 8700.02 ms
     Changes:
Summary
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1


My /etc/salt/master    is set with

# Example:
# file_roots:
#   base:
#     - /srv/salt/
#   dev:
#     - /srv/salt/dev/services
#     - /srv/salt/dev/states
#   prod:
#     - /srv/salt/prod/services
#     - /srv/salt/prod/states

file_roots:
  base:
    - /srv/salt


It is complaining about a .saltrc,  from above, i am not sure about this.  I am running as root and have this enabled in the config

ALL HELP IS GREATLY APPRECIATED!!!!  Any other info you need please let me know!!

sea...@gmail.com

unread,
Feb 26, 2015, 11:41:02 AM2/26/15
to salt-...@googlegroups.com
I have started to use another client to test this command   :

I should say i can successfully do a test.ping do a disk usage command with out a problem. The problem lies in the sls files here is the exact file, i know it is simple for now

TOP.SLS
base:
  '*':
    - webserver      <<<

 salt oracle.umflint.edu state.sls top.sls
oracle.umflint.edu:
    Data failed to compile:
----------
    No matching sls found for 'top.sls' in env 'base'


I thought  env 'base would be referring to  /srv/salt/base so i created a directory,  but i got the same error as above

Colton Myers

unread,
Feb 26, 2015, 12:13:40 PM2/26/15
to salt-...@googlegroups.com
To solve your "Package 'vim' not found" error, just use the proper package name for vim on that system, i.e. vim-enhanced:

vim-enhanced:
  pkg.installed

Top.sls files are different from normal sls files, and are not designed to be run with state.sls. Instead, use state.highstate:

salt <myservernae> state.highstate

No need to actually reference the top.sls file in your command -- top.sls is a special file used by the highstate command.

Hope that helps.

--
Colton Myers
Platform Engineer, SaltStack
@basepi on Github/Twitter/IRC

SaltConf 2015 is Mar 3-5! http://saltconf.com

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc

sea...@gmail.com

unread,
Feb 26, 2015, 12:30:58 PM2/26/15
to salt-...@googlegroups.com
Yes and Thanks  ,    
 
Here is more of what i am experiencing,   I changed the top.sls file to the following ,  i think the error i was having is that it was looking for the webserver.sls at the end of the other top.sls file
As I did mention i can run test.ping and other functions and they work successfully

NEW TOP.SLS    I do have apache installed on one (1) server , I have 7 minions
apache:
  pkg.installed: []
   service.running:
     - watch:
       - pkg: apache
       - file: /etc/httpd/conf/httpd.conf
       - user: apache
  
NOW when i run
                             salt '*' state.highstate

I have this error with the top file described above  BELOW for all 7 servers

 MYSERVERNAME

    Data failed to compile:
----------
    Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/salt/state.py", line 2834, in call_highstate
    top = self.get_top()
  File "/usr/lib/python2.6/site-packages/salt/state.py", line 2336, in get_top
    tops = self.get_tops()
  File "/usr/lib/python2.6/site-packages/salt/state.py", line 2213, in get_tops
    saltenv=saltenv
  File "/usr/lib/python2.6/site-packages/salt/template.py", line 84, in compile_template
    ret = render(input_data, saltenv, sls, **render_kwargs)
  File "/usr/lib/python2.6/site-packages/salt/renderers/yaml.py", line 48, in render
    data = load(yaml_data, Loader=get_yaml_loader(argline))
  File "/usr/lib64/python2.6/site-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/lib64/python2.6/site-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/lib64/python2.6/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib64/python2.6/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib64/python2.6/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib64/python2.6/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib64/python2.6/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib64/python2.6/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/lib64/python2.6/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/lib64/python2.6/site-packages/yaml/parser.py", line 439, in parse_block_mapping_key
    "expected <block end>, but found %r" % token.id, token.start_mark)
ParserError: while parsing a block mapping
  in "<unicode string>", line 2, column 3:
      pkg.installed: []
      ^
expected <block end>, but found '<block mapping start>'
  in "<unicode string>", line 3, column 4:
       service.running:
       ^

Charles Baker

unread,
Feb 26, 2015, 12:51:18 PM2/26/15
to salt-...@googlegroups.com
I don't think you understand how salt works. The following wouldn't go in top.sls, top.sls if for assigning certain states to specific minions.

apache:
  pkg.installed: []
   service.running:
     - watch:
       - pkg: apache
       - file: /etc/httpd/conf/httpd.conf
       - user: apache

YOu would put that in say apache.sls

The in top.sls you would put in a line that matches the minions you want apache installed on. Something like

"web*"
  - apache

I suggest you thoroughly read


and 


or maybe work straight through the tutorials





--
Charles H. Baker
864.990.1297
Knowing is not enough; we must apply. Willing is not enough; we must do. Bruce Lee

Dan x

unread,
Feb 26, 2015, 1:21:25 PM2/26/15
to salt-...@googlegroups.com
Thank you , No i don't understand completely, I did say i was new,
I also copied and pasted this from a web instance (off the web) , If
I'm not mistaken the salt website!? Only other site i have looked at
is GitHub,

thanks for you direction, appreciated
>> As I did mention* i can run test.ping and other functions and they work
>> successfully*
>>
>> NEW TOP.SLS I do have apache installed on one (1) server , I have 7
>> minions
>> apache:
>> pkg.installed: []
>> service.running:
>> - watch:
>> - pkg: apache
>> - file: /etc/httpd/conf/httpd.conf
>> - user: apache
>>
>> NOW when i run
>> * salt '*' state.highstate*
>>>> *FROM MASTER*
>>>>
>>>> salt --versions-report
>>>> Salt: 2014.7.1
>>>> Python: 2.6.6 (r266:84292, Jan 22 2014, 01:49:05)
>>>> Jinja2: 2.2.1
>>>> M2Crypto: 0.20.2
>>>> msgpack-python: 0.4.4
>>>> msgpack-pure: Not Installed
>>>> pycrypto: 2.0.1
>>>> libnacl: Not Installed
>>>> PyYAML: 3.10
>>>> ioflo: Not Installed
>>>> PyZMQ: 14.3.1
>>>> RAET: Not Installed
>>>> ZMQ: 3.2.4
>>>> Mako: 0.3.4
>>>>
>>>>
>>>> *FROM salt-minions*
>>>>
>>>> salt-minion --versions
>>>> Salt: 2014.7.1
>>>> Python: 2.6.6 (r266:84292, Jan 22 2014, 01:49:05)
>>>> Jinja2: 2.2.1
>>>> M2Crypto: 0.20.2
>>>> msgpack-python: 0.4.4
>>>> msgpack-pure: Not Installed
>>>> pycrypto: 2.0.1
>>>> libnacl: Not Installed
>>>> PyYAML: 3.10
>>>> ioflo: Not Installed
>>>> PyZMQ: 14.3.1
>>>> RAET: Not Installed
>>>> ZMQ: 3.2.4
>>>> Mako: 0.3.4
>>>>
>>>>
>>>> * File SLS :*
>>>>
>>>> either one of these
>>>>
>>>> top.sls
>>>> base:
>>>> '*':
>>>> - webserver
>>>>
>>>> *********** OR ****************
>>>> vim.sls
>>>> vim:
>>>> pkg.installed
>>>>
>>>> *THe command i execute is salt '*' state.sls vim *
>>>>
>>>> Or for the top.sls i have used
>>>>
>>>> *salt < MYSERVERNAME> top.sls state.highstate --log-level=debug*
>>>>
>>>> The Error i get 2 errors 1 is this below and the other is *DATA
>>>> FAILED TO COMPILE*
>>>>
>>>> DEBUG ] Reading configuration from /etc/salt/master
>>>> [DEBUG ] Using cached minion ID from /etc/salt/minion_id:
>>>> MYSERVERNAME
>>>> <http://salty.umflint.edu/>
>>>> [DEBUG ] Missing configuration file: ~/.saltrc
>>>> [DEBUG ] Configuration file path: /etc/salt/master
>>>> [DEBUG ] Reading configuration from /etc/salt/master
>>>> [DEBUG ] Using cached minion ID from /etc/salt/minion_id:
>>>> MYSERVERNAME
>>>> <http://salty.umflint.edu/>
>>>> [DEBUG ] Missing configuration file: ~/.saltrc
>>>> [DEBUG ] MasterEvent PUB socket URI: ipc:///var/run/salt/master/
>>>> master_event_pub.ipc
>>>> [DEBUG ] MasterEvent PULL socket URI: ipc:///var/run/salt/master/mas
>>>> ter_event_pull.ipc
>>>> [DEBUG ] LazyLoaded local_cache.get_load
>>>> [DEBUG ] get_iter_returns for jid 20150225182946402733 sent to
>>>> set(['myservername']) will timeout at 18:29:51.413233
>>>> [DEBUG ] jid 20150225182946402733 return from myservername
>>>> MYSERVERNAME: <http://testc-app1.umflint.edu/>
>>>> 'top.sls' is not available.
>>>> [DEBUG ] jid 20150225182946402733 found all minions
>>>> set(['myservername'])
>>>>
>>>> The *TOP.SLS* is sitting in /srv/salt and so is the below *VIM.SLS*
>>>>
>>>> *[root@salty salt]# salt '*' state.sls vim*
>>>>
>>>> For each of the minions i get the following,
>>>>
>>>> ----------
>>>> ID: vim
>>>> Function: pkg.installed
>>>> Result: False
>>>> Comment: Package 'vim' not found (possible matches: vim-enhanced)
>>>> Started: 18:30:23.680424
>>>> Duration: 8700.02 ms
>>>> Changes:
>>>> Summary
>>>> ------------
>>>> Succeeded: 0
>>>> Failed: 1
>>>> ------------
>>>> Total states run: 1
>>>>
>>>>
>>>>
>>>> *My /etc/salt/master is set with *
>>>> # Example:
>>>> # file_roots:
>>>> # base:
>>>> # - /srv/salt/
>>>> # dev:
>>>> # - /srv/salt/dev/services
>>>> # - /srv/salt/dev/states
>>>> # prod:
>>>> # - /srv/salt/prod/services
>>>> # - /srv/salt/prod/states
>>>>
>>>> file_roots:
>>>> base:
>>>> - /srv/salt
>>>>
>>>>
>>>> *It is complaining about a .saltrc, from above, i am not sure about
>>>> this. I am running as root and have this enabled in the config*
>>>>
>>>> ALL HELP IS GREATLY APPRECIATED!!!! Any other info you need please let
>>>> me know!!
>>>>
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "Salt-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to salt-users+...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Salt-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to salt-users+...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Charles H. Baker
> 864.990.1297
> Knowing is not enough; we must apply. Willing is not enough; we must do.
> Bruce Lee
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Salt-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/salt-users/tNv_EFZtEGM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
Dan דָּנִיֵּאל
716-581-3128
Reply all
Reply to author
Forward
0 new messages