saltstack-formulas / prometheus-formula

Manage a Prometheus installation
Other
27 stars 51 forks source link

requisites not found- sls: prometheus.config.args #3

Closed noelmcloughlin closed 4 years ago

noelmcloughlin commented 5 years ago

There was a state failure on Ubuntu and CentOS. Weird

[DEBUG   ] Rendered data from file: /var/cache/salt/minion/files/base/prometheus/service/running.sls:
# -*- coding: utf-8 -*-
# vim: ft=sls

include:
  - prometheus.config.args
  - prometheus.config.file

prometheus-service-running-service-running:
  service.running:
    - name: prometheus
    - enable: True
    - watch:
      - file: prometheus-config-file-file-managed
    - require:
      - sls: prometheus.config.args
      - sls: prometheus.config.file

[DEBUG   ] Results of YAML rendering: 
OrderedDict([(u'include', [u'prometheus.config.args', u'prometheus.config.file']), (u'prometheus-service-running-service-running', OrderedDict([(u'service.running', [OrderedDict([(u'name', u'prometheus')]), OrderedDict([(u'enable', True)]), OrderedDict([(u'watch', [OrderedDict([(u'file', u'prometheus-config-file-file-managed')])])]), OrderedDict([(u'require', [OrderedDict([(u'sls', u'prometheus.config.args')]), OrderedDict([(u'sls', u'prometheus.config.file')])])])])]))])
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/base/prometheus/service/running.sls' using 'yaml' renderer: 0.00337982177734
[DEBUG   ] LazyLoaded pkg.install
[DEBUG   ] LazyLoaded pkg.installed
[DEBUG   ] LazyLoaded systemd.booted
[DEBUG   ] DSC: Only available on Windows systems
[DEBUG   ] Module PSGet: Only available on Windows systems
[DEBUG   ] LazyLoaded platform.is_windows
[DEBUG   ] Could not LazyLoad pkg.ex_mod_init: 'pkg.ex_mod_init' is not available.
[INFO    ] Running state [prometheus] at time 23:11:19.596377
[INFO    ] Executing state pkg.installed for [prometheus]
[DEBUG   ] Could not LazyLoad pkg.resolve_capabilities: 'pkg.resolve_capabilities' is not available.
[INFO    ] Executing command [u'dpkg-query', u'--showformat', u'${Status} ${Package} ${Version} ${Architecture}', u'-W'] in directory '/home/vagrant'
[DEBUG   ] Could not LazyLoad pkg.normalize_name: 'pkg.normalize_name' is not available.
[INFO    ] All specified packages are already installed
[INFO    ] Completed state [prometheus] at time 23:11:20.047544 (duration_in_ms=451.167)
[DEBUG   ] LazyLoaded file.managed
[INFO    ] Running state [/etc/prometheus/prometheus.yml] at time 23:11:20.049974
[INFO    ] Executing state file.managed for [/etc/prometheus/prometheus.yml]
[DEBUG   ] Returning file list from cache: age=2 cache_time=20 /var/cache/salt/minion/file_lists/roots/base.p
[DEBUG   ] Returning file list from cache: age=2 cache_time=20 /var/cache/salt/minion/file_lists/roots/base.p
[DEBUG   ] In saltenv 'base', looking at rel_path 'prometheus/files/default/prometheus.yml.jinja' to resolve 'salt://prometheus/files/default/prometheus.yml.jinja'
[DEBUG   ] In saltenv 'base', ** considering ** path '/var/cache/salt/minion/files/base/prometheus/files/default/prometheus.yml.jinja' to resolve 'salt://prometheus/files/default/prometheus.yml.jinja'
[DEBUG   ] Jinja search path: [u'/var/cache/salt/minion/files/base']
[INFO    ] File /etc/prometheus/prometheus.yml is in the correct state
[INFO    ] Completed state [/etc/prometheus/prometheus.yml] at time 23:11:20.081803 (duration_in_ms=31.829)
[DEBUG   ] LazyLoaded service.running
[DEBUG   ] File /var/cache/salt/minion/accumulator/140425546976080 does not exist, no need to cleanup
[DEBUG   ] LazyLoaded state.check_result
[DEBUG   ] LazyLoaded highstate.output
local:
----------
          ID: prometheus-package-install-pkg-installed
    Function: pkg.installed
        Name: prometheus
      Result: True
     Comment: All specified packages are already installed
     Started: 23:11:19.596377
    Duration: 451.167 ms
     Changes:   
----------
          ID: prometheus-config-file-file-managed
    Function: file.managed
        Name: /etc/prometheus/prometheus.yml
      Result: True
     Comment: File /etc/prometheus/prometheus.yml is in the correct state
     Started: 23:11:20.049974
    Duration: 31.829 ms
     Changes:   
----------
          ID: prometheus-service-running-service-running
    Function: service.running
        Name: prometheus
      Result: False
     Comment: The following requisites were not found:
                                 require:
                                     sls: prometheus.config.args

Versions

vagrant@ubuntu1804:~$ sudo salt-call --versions
Salt Version:
           Salt: 2018.3.4

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.1
      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: 1.0.7
   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.15rc1 (default, Nov 12 2018, 14:31:15)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist: Ubuntu 18.04 bionic
         locale: ISO-8859-1
        machine: x86_64
        release: 4.15.0-45-generic
         system: Linux
        version: Ubuntu 18.04 bionic
noelmcloughlin commented 5 years ago

I have seen lots of these when adopting template-formula on various formulae. Have not found root cause.

noelmcloughlin commented 5 years ago

Caused by https://github.com/saltstack/salt/issues/30971 Workaround is to replace sls: {{ xyz }} with sls: "{{ xyz }}.*"

noelmcloughlin commented 4 years ago

30