Error on minion "'service.running' was not found in SLS"
Hello!
This is my Salt:
salt --versions
Salt: 2015.5.3
Python: 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
Jinja2: 2.2.1
M2Crypto: 0.20.2
msgpack-python: 0.4.6
msgpack-pure: Not Installed
pycrypto: 2.0.1
libnacl: Not Installed
PyYAML: 3.09
ioflo: Not Installed
PyZMQ: 14.3.1
RAET: Not Installed
ZMQ: 3.2.5
Mako: Not Installed
Tornado: Not Installed
Also we are on Centos 6.7.
Sometimes in Salt minion logs we see this error "'service.running' was not found in SLS". It happens not every time. And also it can happen just a few seconds after this module was used in another state.
This is somewhat similar to an old issue https://github.com/saltstack/salt/issues/13703 but is was fixed long ago.
So for example in logs we see that service.running was successful for Ganglia:
2015-11-02 07:30:32,492 [salt.utils.lazy ][DEBUG ][10680] LazyLoaded service.running
2015-11-02 07:30:32,493 [salt.state ][INFO ][10680] Running state [gmond] at time 07:30:32.492743
2015-11-02 07:30:32,493 [salt.state ][INFO ][10680] Executing state service.running for gmond
2015-11-02 07:30:32,495 [salt.utils.lazy ][DEBUG ][10680] LazyLoaded cmd.retcode
2015-11-02 07:30:32,495 [salt.loaded.int.module.cmdmod ][INFO ][10680] Executing command '/sbin/service gmond status' in directory '/root'
2015-11-02 07:30:32,560 [salt.loaded.int.module.cmdmod ][DEBUG ][10680] output: gmond is stopped
2015-11-02 07:30:32,561 [salt.loaded.int.module.cmdmod ][INFO ][10680] Executing command '/sbin/service gmond start' in directory '/root'
2015-11-02 07:30:32,611 [salt.loaded.int.module.cmdmod ][DEBUG ][10680] output: Starting GANGLIA gmond: [ OK ]
2015-11-02 07:30:32,611 [salt.state ][INFO ][10680] {'gmond': True}
2015-11-02 07:30:32,612 [salt.state ][INFO ][10680] Completed state [gmond] at time 07:30:32.611496
But a couple of seconds later it failed for another service:
2015-11-02 07:32:08,602 [salt.template ][DEBUG ][11552] Rendered data from file: /var/cache/salt/minion/files/base/some_service/start.sls:
some-service-running:
service.running:
- name: some-service
- enable: True
...
2015-11-02 07:32:33,348 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded service.start
2015-11-02 07:32:33,349 [salt.loader ][DEBUG ][11552] Error loading module.nacl: libnacl import error, perhaps missing python libnacl package
2015-11-02 07:32:33,405 [salt.loader ][DEBUG ][11552] Error loading module.ipmi: No module named pyghmi.ipmi
2015-11-02 07:32:33,409 [salt.loader ][DEBUG ][11552] Error loading module.npm: npm execution module could not be loaded because the npm binary could not be located
2015-11-02 07:32:33,418 [salt.utils.lazy ][DEBUG ][11446] LazyLoaded config.merge
2015-11-02 07:32:33,419 [salt.utils.lazy ][DEBUG ][11446] LazyLoaded mine.update
2015-11-02 07:32:33,458 [salt.utils.lazy ][DEBUG ][11552] Could not LazyLoad lvs.get_rules
2015-11-02 07:32:33,459 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded selinux.getenforce
2015-11-02 07:32:33,460 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded keystone.auth
2015-11-02 07:32:33,460 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded keyboard.get_sys
2015-11-02 07:32:33,461 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded portage_config.get_missing_flags
2015-11-02 07:32:33,462 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded layman.add
2015-11-02 07:32:33,462 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded xmpp.send_msg
2015-11-02 07:32:33,462 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded win_servermanager.install
2015-11-02 07:32:33,462 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_iam.role_exists
2015-11-02 07:32:33,463 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded ipset.version
2015-11-02 07:32:33,463 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_sns.exists
2015-11-02 07:32:33,510 [pip.vcs ][DEBUG ][11552] Registered VCS backend: git
2015-11-02 07:32:33,528 [pip.vcs ][DEBUG ][11552] Registered VCS backend: hg
2015-11-02 07:32:33,573 [pip.vcs ][DEBUG ][11552] Registered VCS backend: svn
2015-11-02 07:32:33,573 [pip.vcs ][DEBUG ][11552] Registered VCS backend: bzr
2015-11-02 07:32:33,580 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_asg.exists
2015-11-02 07:32:33,580 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded mysql.user_create
2015-11-02 07:32:33,580 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded lvs.get_rules
2015-11-02 07:32:33,580 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_elb.exists
2015-11-02 07:32:33,581 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded win_dns_client.add_dns
2015-11-02 07:32:33,587 [salt.utils.lazy ][DEBUG ][11552] Could not LazyLoad augeas.execute
2015-11-02 07:32:33,588 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded glusterfs.list_volumes
2015-11-02 07:32:33,588 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded makeconf.get_var
2015-11-02 07:32:33,594 [salt.utils.lazy ][DEBUG ][11552] Could not LazyLoad pkg.get_selections
2015-11-02 07:32:33,595 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_cloudwatch.get_alarm
2015-11-02 07:32:33,595 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded win_path.rehash
2015-11-02 07:32:33,596 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded memcached.status
2015-11-02 07:32:33,596 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded reg.read_key
2015-11-02 07:32:33,597 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded splunk_search.get
2015-11-02 07:32:33,598 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_secgroup.exists
2015-11-02 07:32:33,598 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded tls.cert_info
2015-11-02 07:32:33,598 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded rdp.enable
2015-11-02 07:32:33,598 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded mysql.query
2015-11-02 07:32:33,603 [salt.utils.lazy ][DEBUG ][11552] Could not LazyLoad apache.a2enmod
2015-11-02 07:32:33,603 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded postgres.user_exists
2015-11-02 07:32:33,604 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded postgres.schema_exists
2015-11-02 07:32:33,609 [salt.utils.lazy ][DEBUG ][11552] Could not LazyLoad firewall.get_config
2015-11-02 07:32:33,610 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded mysql.db_exists
2015-11-02 07:32:33,612 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_asg.exists
2015-11-02 07:32:33,612 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded eselect.exec_action
2015-11-02 07:32:33,613 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded nftables.version
2015-11-02 07:32:33,614 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_sqs.exists
2015-11-02 07:32:33,614 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded cyg.list
2015-11-02 07:32:33,615 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded postgres.group_create
2015-11-02 07:32:33,615 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded pecl.list
2015-11-02 07:32:33,616 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded chef.client
2015-11-02 07:32:33,617 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_elasticache.exists
2015-11-02 07:32:33,618 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded mysql.grant_exists
2015-11-02 07:32:33,623 [salt.utils.lazy ][DEBUG ][11552] Could not LazyLoad docker.version
2015-11-02 07:32:33,623 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded mongodb.user_exists
2015-11-02 07:32:33,624 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded ps.pkill
2015-11-02 07:32:33,625 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded boto_dynamodb.exists
2015-11-02 07:32:33,626 [salt.loader ][DEBUG ][11552] Error loading states.ipmi: No module named pyghmi.ipmi
2015-11-02 07:32:33,627 [salt.loader ][DEBUG ][11552] Error loading states.npm: 'npm' binary not found on system
2015-11-02 07:32:33,634 [salt.utils.lazy ][DEBUG ][11552] Could not LazyLoad service.running
2015-11-02 07:32:33,636 [salt.state ][INFO ][11552] Running state [some-service] at time 07:32:33.636033
2015-11-02 07:32:33,636 [salt.utils.lazy ][DEBUG ][11552] LazyLoaded service.running
2015-11-02 07:32:33,636 [salt.state ][ERROR ][11552] State 'service.running' was not found in SLS 'some-service.start'
Reason: Module 'service' is not available.
How it could be fixed? Thank you in advance!
@vakulich, thanks for the report. Does this only happen for services that don't exist? Will you post the output of salt <minion> state.show_sls <broken_service> for the sls file that is failing?
@jfindlay actually this happened for service that really exists, it is some proprietary service so I changed its name to "some_service". This issue is intermittent: happens 1 time out of 100+ runs of this state.
Here are more details about failing sls, but again I changed real service name to "some_service", sorry for that..
[root@h1 ~]# salt h1 state.show_sls some-service.start
h1:
----------
some-service-running:
----------
__env__:
base
__sls__:
some-service.start
service:
|_
----------
name:
some-service
|_
----------
enable:
True
|_
----------
sig:
-E 'some-service-p1|some-service-p2|some-service-p3'
|_
----------
require:
|_
----------
pkg:
some-service-pkg
|_
----------
file:
/var/lib/some-service/some-service.conf
- running
|_
----------
order:
10000
Hope it helps.
@vakulich, thanks for the extra info. The best I can suggest at this point is to try 2015.8.1 as there have been updates to the service state and the loader.
I see the same error on two freshly installed Ubuntu 14.04 systems with Saltstack 2015.8.1.
One is running in Vagrant and fails consistently to restart services. The output of state.show_sls for that one is too big to post here.
The second machine is not fully set up yet, but it seems to exhibit the same behavior: no service restarts. Info of the second machine:
Salt Version:
Salt: 2015.8.1
Dependency Versions:
Jinja2: 2.7.2
M2Crypto: Not Installed
Mako: 0.9.1
PyYAML: 3.10
PyZMQ: 14.4.0
Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.4
cffi: Not Installed
cherrypy: Not Installed
dateutil: 1.5
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.3.0
mysql-python: 1.2.3
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: Ubuntu 14.04 trusty
machine: x86_64
release: 3.13.0-68-generic
system: Ubuntu 14.04 trusty
tullibardine:
----------
aptrepo.saltstack:
----------
__env__:
base
__sls__:
salt.common
pkgrepo:
- managed
|_
----------
humanname:
Saltstack APT Repository
|_
----------
name:
deb http://repo.saltstack.com/apt/ubuntu/ubuntu14/latest trusty main
|_
----------
key_url:
https://repo.saltstack.com/apt/ubuntu/ubuntu14/latest/SALTSTACK-GPG-KEY.pub
|_
----------
file:
/etc/apt/sources.list.d/saltstack.list
|_
----------
order:
10000
debconf-utils:
----------
__env__:
base
__sls__:
salt.minion
pkg:
- installed
|_
----------
order:
10002
patch:
----------
__env__:
base
__sls__:
salt.minion
pkg:
- installed
|_
----------
order:
10003
salt.common./etc/salt/common.d:
----------
__env__:
base
__sls__:
salt.common
file:
- recurse
|_
----------
name:
/etc/salt/common.d
|_
----------
source:
salt://salt/etc/salt/common.d
|_
----------
order:
10001
salt.minion:
----------
__env__:
base
__sls__:
salt.minion
service:
|_
----------
name:
salt-minion
|_
----------
enable:
True
|_
----------
watch:
|_
----------
file:
salt.common./etc/salt/common.d
- running
|_
----------
order:
10004
salt.minion./etc/salt/minion:
----------
__env__:
base
__sls__:
salt.minion
file:
- managed
|_
----------
name:
/etc/salt/minion
|_
----------
source:
salt://salt/etc/salt/minion
|_
----------
template:
jinja
|_
----------
watch_in:
|_
----------
service:
salt.minion
|_
----------
order:
10005
salt.minion./etc/salt/minion.d:
----------
__env__:
base
__sls__:
salt.minion
file:
- recurse
|_
----------
name:
/etc/salt/minion.d
|_
----------
source:
salt://salt/etc/salt/minion.d
|_
----------
watch_in:
|_
----------
service:
salt.minion
|_
----------
order:
10006
The thing that seems to be common to all service.running states that fail is that they are referenced by a watch_in requisite somewhere.
Hello, trying to evaluate saltstack here, may I ask if this issue has been fixed?
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.