salt: init.sls with included states fails with more than one, 'Template was specified incorrectly: False'

Description of Issue/Question

This applies to a problem with the 2018.3.1 version and I have a 2nd server built identically except for having a different version of salt. The same state files exist on each server. Each server runs as a masterless, stand-alone minion.

I have 2 separate Virtualbox Ubuntu 18.04 VMs:
Server 1: Salt 2018.3.1 installed Server 2: Salt 2017.7.4 installed

I have a directory named ‘common’ containing an init.sls file and several sls files that are included by init.sls in the same directory.

common/init.sls:
     include: 
        - common.file1
        - common.file2
        - common.fille3

SERVER 1 & SERVER2:

I am able to run each of the included sls files individually with success

salt-call state.sls common.file1

However, when I call the directory for the init.sls file

salt-call state.sls common

it fails.

[INFO    ] Loading fresh modules for state activity
[INFO    ] Fetching file from saltenv 'base', ** done ** 'common/init.sls'
[ERROR   ] Template was specified incorrectly: False
local:
    Data failed to compile:
----------
    Specified SLS common.file2 in saltenv base is not available on the salt master or through a configured fileserver
    Specified SLS common.file3 in saltenv base is not available on the salt master or through a configured fileserver

I have tried changing the order of the included states… no difference. I commented out all but 1 included file (I rotated which state I kept)… then it worked.

ALL of these states work without issue on SERVER 2 with salt 2017.7.4

Versions Report

SERVER 1

Salt Version: Salt: 2018.3.1

Dependency Versions: cffi: Not Installed cherrypy: unknown dateutil: 2.6.1 docker-py: Not Installed gitdb: 2.0.3 gitpython: 2.1.8 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, Apr 15 2018, 21:51:34) python-gnupg: 0.4.1 PyYAML: 3.12 PyZMQ: 16.0.2 RAET: Not Installed smmap: 2.0.3 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-20-generic system: Linux version: Ubuntu 18.04 bionic

SERVER 2

Salt Version: Salt: 2017.7.4

Dependency Versions: cffi: 1.11.5 cherrypy: unknown dateutil: 2.6.1 docker-py: Not Installed gitdb: 2.0.3 gitpython: 2.1.10 ioflo: Not Installed Jinja2: 2.10 libgit2: 0.26.0 libnacl: Not Installed M2Crypto: Not Installed Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.5.6 mysql-python: Not Installed pycparser: 2.18 pycrypto: 2.6.1 pycryptodome: Not Installed pygit2: 0.26.2 Python: 3.6.5 (default, Apr 1 2018, 05:46:30) python-gnupg: Not Installed PyYAML: 3.12 PyZMQ: 16.0.2 RAET: Not Installed smmap: 2.0.3 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-20-generic system: Linux version: Ubuntu 18.04 bionic

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Goooooooooaaaaaalllll !!! Both versions are working with multiple included states. Well done!

@dvenckus I believe we’ve found the root cause and with the help of @terminalmage come up with a fix. If you’re able to, could you try the patch in either the 2017.7 or 2018.3 pull requests and see if it fixes the issue for you?

@dvenckus Apologies, I had checked out the wrong tag. Seeing it working as expected with 2017.7.4 now. Thanks!

Thanks. I’ve narrowed it down to something in your custom module calling pillar.get with the saltenv parameter. Without that parameter it works as expected but with it it does not. With the versions I’ll run through a git bisect and try to narrow down the issue. Thanks!

This is the same for both VMs.

file_roots:
  base:
    - /srv/salt/base/states
    - /srv/salt/base/assets
    - /srv/salt/formulas/mariadb-saltstack-formula

  dev:
    - /srv/salt/dev/states
    - /srv/salt/base/states
    - /srv/salt/dev/assets
    - /srv/salt/base/assets
    - /srv/salt/formulas/mariadb-saltstack-formula



pillar_roots:
  base:
    - /srv/salt/base/pillars
  dev:
    - /srv/salt/dev/pillars
    - /srv/salt/base/pillars

And other relevant settings from the minion.conf:

# default to base environment, unless saltenv is specified
environment: base

top_file_merging_strategy: 'same'
env_order: ['base','dev']
default_top: 'base'

pillar_source_merging_strategy: 'smart'
pillarenv_from_saltenv: True
pillar_safe_render_error: True