Open dosercz opened 3 years ago
This looks like a duplicate of https://github.com/saltstack/salt/issues/21370.
You can work around it using extra_filerefs
.
I have tried workaround with extra_filerefs, but it doesn't help in my case. So it's probably different problem. It's strange, that we were using this for years without any problem, but now it's broken in version 3004. Last tested previous version is 2019.2.8, where I can confirm no problems with that.
I just upgraded our master from 3002.7 to 3004 and got same error calling state over salt-ssh like, all formulas worked ok when called from master->minion or on minion via salt-call with no problem.
SSH command:
salt-ssh -v "*" state.sls prometheus
and i was getting error from all sls files:
- Rendering SLS 'base:prometheus.node' failed: Jinja error: prometheus/map.jinja
...
{% from "prometheus/map.jinja" import binExporter with context %} <======================
I did try adding --extra-filerefs
, but it did not helped. Since i have under this prometheus defined all kind of services, i wanted to lower the error output i was getting and called
salt-ssh -v "*" state.sls prometheus.nginx
To my suprise did get exececuted without problem and after that full formula works as well. The only thing maybe some corrupted cache after upgrade?
I'm running into this issue now with 3004
as well. I've never had to use extra_filerefs
previously, but now it seems busted. I've noticed that, without adding extra_filerefs
, if I call a specific state that references the include, it works. but if I call the highstate (such as with salt-ssh hostname state.apply
) then it breaks as mentioned here.
is there a workaround that actually works for this case? and is the root cause potentially the cache dir issue that seems to be causing #60003?
To me, it's the same as this one https://github.com/saltstack/salt/issues/60620 (that is wrongly closed as duplicates)
To me, this regression get introduced in 3003
I'm hit by the same bug. It's incredible to me that salt-ssh
continues to have these kinds of bugs in 2022. I'm at the breaking point where I'm strongly considering the option raised by another commenter in a separate bug: perhaps it's just better to go back to Ansible.
@Rudd-O yeah, we just finished a migration from ansible to salt-ssh, just in time for all these 3003
bugs. it's been a real headache. def feels like salt-ssh
isn't getting the regression testing / QA / dev love as the rest of the stack, which is really unfortunate.
I did not try the proposed patch but I'll try to have a look at it.
I wonder if salt-ssh workgroup is working or not…
I'm having the same issue on 3004.1 on CentOS 7. Added the patch #60620 and #60003 and neither of them solved the issue. Here's the configs we're using:
/etc/salt/roster:
host: 10.10.10.123
/etc/salt/master.d/ssh_defaults.conf
roster_defaults:
user: salt-user
priv: /etc/salt/pki/salt-ser
thin_dir: /etc/salt
sudo: True
# tty: True
ssh_minion_opts:
gpg_keydir: /etc/salt/gpgkeys/
The latest patch updated for 3004 me tionned in #60003 worked for me
Hello, #61895 fixes my issues.
Still getting this with a 3005.1.4 master when I attempt a relative jinja import (from './vars.jinja' import...
).
Still getting this with a 3005.1.4 master when I attempt a relative jinja import (
from './vars.jinja' import...
).
I believe the fix is #63184 which is not in 3005.1.4
but scheduled for 3006
so when is 3006 getting released?
Any chance this fix get backported to 3005 one day, because right now we are stuck with 3002.9 (and cannot upgrade for the moment to 3006 since moving to onedir is quite a huge change on our side)
onedir
?
The bug seems gone for me in version 3007.0
. Anyone can confirm to close this issue?
Didn't notice 3007 was release, generally I wait .1 or .2 before upgrading. I had too much issue in the past with upgrading. I will try to test on my labs
Hello @SkypLabs
The bug seems gone for me in version
3007.0
. Anyone can confirm to close this issue?
My tests as described in 31531 still do not work:
salt-ssh --versions-report
salt-ssh minion1 state.show_sls
It was fixed by #61895 (https://github.com/saltstack/salt/issues/31531#issuecomment-1092778781) but was broken again after (I don't know when).
Description Jinja import from doesn't work with salt-ssh due to error jinja2.exceptions.TemplateNotFound. It works fine while running same setup via salt-minion, so problem is probably in salt-ssh.
Debug output:
But file /var/cache/salt/master/files/base/salt/map.jinja is present in salt master FS.
Setup Install salt-master + salt-ssh and setup roster file. The problem occurs at Debian 9 VM with salt v3004. Tested with salt v 2019.2.8 without any problem. No minion installed at target machine, target machine is clean Debian installation.
Steps to Reproduce the behavior Run
salt-ssh \* state.sls test
with these states: test/init.sls:test/repo.sls:
test/map.jinja:
Expected behavior No error and success as running salt via salt-minion.
Versions Report
salt --versions-report
``` Salt Version: Salt: 3004 Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: 2.5.3 docker-py: Not Installed gitdb: 2.0.0 gitpython: 2.1.1 Jinja2: 2.9.4 libgit2: Not Installed M2Crypto: Not Installed Mako: Not Installed msgpack: 0.6.2 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: Not Installed pycrypto: Not Installed pycryptodome: 3.6.1 pygit2: Not Installed Python: 3.5.3 (default, Apr 5 2021, 09:00:41) python-gnupg: Not Installed PyYAML: 3.12 PyZMQ: 17.1.2 smmap: 2.0.1 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.2.1 System Versions: dist: debian 9 stretch locale: UTF-8 machine: x86_64 release: 4.9.0-16-amd64 system: Linux version: Debian GNU/Linux 9 stretch ```