{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/46004","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/46004/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/46004/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/46004/events","html_url":"https://github.com/saltstack/salt/issues/46004","id":296758460,"number":46004,"title":"opts file_roots gets overwritten with pillar_roots in orchestration run","user":{"login":"github-abcde","id":6707706,"avatar_url":"https://avatars2.githubusercontent.com/u/6707706?v=4","gravatar_id":"","url":"https://api.github.com/users/github-abcde","html_url":"https://github.com/github-abcde","followers_url":"https://api.github.com/users/github-abcde/followers","following_url":"https://api.github.com/users/github-abcde/following{/other_user}","gists_url":"https://api.github.com/users/github-abcde/gists{/gist_id}","starred_url":"https://api.github.com/users/github-abcde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-abcde/subscriptions","organizations_url":"https://api.github.com/users/github-abcde/orgs","repos_url":"https://api.github.com/users/github-abcde/repos","events_url":"https://api.github.com/users/github-abcde/events{/privacy}","received_events_url":"https://api.github.com/users/github-abcde/received_events","type":"User","site_admin":false},"labels":[{"id":77737132,"url":"https://api.github.com/repos/saltstack/salt/labels/Pending%20Discussion","name":"Pending Discussion","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","html_url":"https://github.com/saltstack/salt/milestone/37","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"avatar_url":"https://avatars2.githubusercontent.com/u/702318?v=4","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":1024,"closed_issues":1995,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2018-02-21T15:46:42Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2018-02-13T14:35:47Z","updated_at":"2018-02-21T16:23:10Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Description of Issue/Question\r\nLike https://github.com/saltstack/salt/issues/5449 but under different circumstances.\r\nWhen perfoming an orchestration run with specific contents (see below), `__opts__['file_roots']` of the orchestration-salt-instance gets filled with the contents of `__opts__['pillar_roots']`, which causes all sorts of 'file not found'-problems.\r\n\r\n### Setup\r\nmaster config:\r\n```\r\nrenderer: jinja | yaml | gpg\r\nfile_roots:\r\n  base:\r\n  - /srv/salt/states\r\npillar_roots:\r\n  base:\r\n  - /srv/salt/pillar/base\r\n  test:\r\n  - /srv/salt/pillar/test\r\n  prod:\r\n  - /srv/salt/pillar/prod\r\n```\r\n\r\n`/srv/salt/states/main.sls`:\r\n```\r\ninclude:\r\n- one\r\n- two\r\n```\r\n`/srv/salt/states/one.sls`:\r\n```\r\n{%- set foo = salt['saltutil.runner']('pillar.show_pillar', minion='foo') %}\r\n{%- import_yaml tpldir + '/main.sls' as bar %}\r\nplaceholder_one:\r\n  test.succeed_without_changes\r\n```\r\n`/srv/salt/states/two.sls`:\r\n```\r\nplaceholder_two:\r\n  test.succeed_without_changes\r\n```\r\n\r\n### Steps to Reproduce Issue\r\nrun `salt-run state.orchestrate main` and notice the error:\r\n```\r\nSpecified SLS two in saltenv base is not available on the salt master or through a configured fileserver\r\n```\r\n\r\nIt is also possible to move the `import_yaml`-statement to `two.sls`, and noticing that `two.sls` then fails to compile (because `main.sls` can not be found). However, that error is much more complex to parse.\r\n\r\nAdding `    log.debug(__name__ + ':find_file:\\n\\t\\topts: {}'.format(__opts__['file_roots']))` to `fileserver/roots.py:96` (before `for root in __opts__['file_roots'][saltenv]:`) clearly shows the change of the file_roots when running the orchestration with `-l debug`:\r\n...\r\n```\r\n[DEBUG   ] salt.loaded.int.fileserver.roots:find_file:\r\n\t\topts: {'base': ['/srv/salt/states']}\r\n[DEBUG   ] In saltenv 'base', looking at rel_path 'one.sls' to resolve 'salt://one.sls'\r\n[DEBUG   ] In saltenv 'base', ** considering ** path '/var/cache/salt/master/files/base/one.sls' to resolve 'salt://one.sls'\r\n[DEBUG   ] compile template: /var/cache/salt/master/files/base/one.sls\r\n```\r\n...\r\n```\r\n[DEBUG   ] Sending event: tag = salt/run/20180213152955427735/ret; data = {'fun_args': [{'minion': 'foo'}], 'jid': '20180213152955427735', 'return': {}, 'success': True, '_stamp': '2018-02-13T14:29:55.471971', 'user': 'UNKNOWN', 'fun': 'runner.pillar.show_pillar'}\r\n[INFO    ] Runner completed: 20180213152955427735\r\n[DEBUG   ] LazyLoaded roots.envs\r\n[DEBUG   ] Could not LazyLoad roots.init: 'roots.init' is not available.\r\n[DEBUG   ] salt.loaded.int.fileserver.roots:find_file:\r\n\t\topts: {'test': ['/srv/salt/pillar/test'], 'base': ['/srv/salt/pillar/base'], 'prod': ['/srv/salt/pillar/prod']}\r\n```\r\n\r\n\r\n### Versions Report\r\nSalt Version:\r\n           Salt: 2017.7.3\r\n \r\nDependency Versions:\r\n           cffi: Not Installed\r\n       cherrypy: Not Installed\r\n       dateutil: Not Installed\r\n      docker-py: Not Installed\r\n          gitdb: Not Installed\r\n      gitpython: Not Installed\r\n          ioflo: Not Installed\r\n         Jinja2: 2.7.2\r\n        libgit2: Not Installed\r\n        libnacl: Not Installed\r\n       M2Crypto: Not Installed\r\n           Mako: Not Installed\r\n   msgpack-pure: Not Installed\r\n msgpack-python: 0.5.1\r\n   mysql-python: Not Installed\r\n      pycparser: Not Installed\r\n       pycrypto: 2.6.1\r\n   pycryptodome: Not Installed\r\n         pygit2: Not Installed\r\n         Python: 2.7.5 (default, Aug  4 2017, 00:39:18)\r\n   python-gnupg: Not Installed\r\n         PyYAML: 3.11\r\n          PyZMQ: 15.3.0\r\n           RAET: Not Installed\r\n          smmap: Not Installed\r\n        timelib: Not Installed\r\n        Tornado: 4.2.1\r\n            ZMQ: 4.1.4\r\n \r\nSystem Versions:\r\n           dist: centos 7.4.1708 Core\r\n         locale: UTF-8\r\n        machine: x86_64\r\n        release: 3.10.0-327.10.1.el7.x86_64\r\n         system: Linux\r\n        version: CentOS Linux 7.4.1708 Core"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/367382749","html_url":"https://github.com/saltstack/salt/issues/46004#issuecomment-367382749","issue_url":"https://api.github.com/repos/saltstack/salt/issues/46004","id":367382749,"user":{"login":"terminalmage","id":328598,"avatar_url":"https://avatars1.githubusercontent.com/u/328598?v=4","gravatar_id":"","url":"https://api.github.com/users/terminalmage","html_url":"https://github.com/terminalmage","followers_url":"https://api.github.com/users/terminalmage/followers","following_url":"https://api.github.com/users/terminalmage/following{/other_user}","gists_url":"https://api.github.com/users/terminalmage/gists{/gist_id}","starred_url":"https://api.github.com/users/terminalmage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terminalmage/subscriptions","organizations_url":"https://api.github.com/users/terminalmage/orgs","repos_url":"https://api.github.com/users/terminalmage/repos","events_url":"https://api.github.com/users/terminalmage/events{/privacy}","received_events_url":"https://api.github.com/users/terminalmage/received_events","type":"User","site_admin":false},"created_at":"2018-02-21T16:23:09Z","updated_at":"2018-02-21T16:23:09Z","author_association":"MEMBER","body":"Note, if you want to run both SLS files in a single go, you can do:\r\n\r\n```yaml\r\nstep 1:\r\n  salt.state:\r\n    - tgt: some_minion\r\n    - sls:\r\n      - one\r\n      - two\r\n```"}}
{"actor":{"display_login":"terminalmage"}}