-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with salt-ssh and mine.get #36796
Comments
Thanks for reporting this @manjiki I am working on replicating this now. |
I was able to replicate this issue, thanks for reporting it. |
@manjiki has this worked in previous versions of salt? |
@gtmanfred I can't say, I haven't used mine with salt-ssh before. |
I just double checked and this is also not working on 2015.8 |
I don't know if it is related but I have a bug when using salt-ssh and using such code inside a pillar: I tracked down the problem inside saltutils.py, in the runner function:
When using salt-ssh, |
It fixed both cases (with salt or with salt-ssh) by updating to the following code, but maybe there is a better solution:
EDIT: Another solution is to fix client/ssh/init.py in run_wfunc: |
In fact the same problem arise when salt['publish.publish'] is called when using salt-ssh (for instance, this occurs in x509.create_certificate when the public key is published to the ca_server)
I feel like something is not working properly with client/ssh/wrapper/publish.py where both runner and publish function are wrapped. These wrapper should call runner or publish with |
The first bug I reference has an history: But in my case, it's already fixed. Somehow the ssh wrapper of mine.get is not called when I use salt-ssh |
The problem related to publish.publish is now referenced here: #40943 |
Here are my temporary fixes for mine.get in pillars not working properly when using salt SSH.
This is partially fixed in the following commits: However, the dict merge order matters and master_opts needs to take precedence in order to mine.get over salt-ssh to work properly. |
This fix issues with mine.get when using salt-ssh (saltstack#36796) The dict merge order matters and master_opts needs to take precedence in order to mine.get over salt-ssh to work properly.
Hi guys, i have a similar problem with pillar.get ... I'm trying to use this formula https://github.com/saltstack-formulas/logrotate-formula with salt-ssh, but i was received this error
This is my salt report :
Thanks for any help! |
I would be very surprised if that was related. Because I have used
pillar.get in salt ssh before, can you open a new bug with steps to
reproduce what you are seeing.
…On Mon, May 29, 2017 at 3:39 AM Thomas Rossetto ***@***.***> wrote:
Hi guys, i have a similar problem with pillar.get ... I'm trying to use
this formula https://github.com/saltstack-formulas/logrotate-formula with
salt-ssh, but i was received this error
Rendering SLS 'base:logrotate.jobs' failed: Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'pillar'
/var/tmp/.root_4a38c3_salt/running_data/var/cache/salt/minion/files/base/logrotate/map.jinja(6):
---
# -*- coding: utf-8 -*-
# vim: ft=jinja
{% import_yaml 'logrotate/defaults.yaml' as default_settings %}
{% set os_family_map = salt['grains.filter_by']({ <======================
'Arch': {
'service': 'logrotate.timer',
'default_config': {
'tabooext': '+ .pacorig .pacnew .pacsave',
},
[...]
---
This is my salt report :
Salt Version:
Salt: 2016.11.5
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.4.2
docker-py: Not Installed
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: Not Installed
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: Not Installed
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.2.1
ZMQ: Not Installed
System Versions:
dist: Ubuntu 16.04 xenial
machine: x86_64
release: 4.9.27-moby
system: Linux
version: Ubuntu 16.04 xenial
Thanks for any help!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36796 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAssoVoFoxqSh4U2oY3degwTlcdEjj4jks5r-pJcgaJpZM4KO4jH>
.
|
Ok @gtmanfred , I'll do it soon, thanks! |
I am suffering from the very same issue under |
Can you give me a better example to replicate that on? Because i am not able too.
|
Sure, I've managed to reproduce the issue on a small codebase that I've pushed there: https://github.com/lastmikoi/saltstack-bug-36796 (just make sure to replace the absolute paths I haven't found a way to make relative yet, and the roster of course) In this codebase I am able to apply my dummy
As mentioned by the original reporter, this issue doesn't trigger if the |
Ok, cool I am able to replicate this. As a side not, you can use @saltstack/team-ssh does anyone have an idea of why this might be happening? Initially i thought it might have been because mine.get was in the wrappers, but grains is also in there. Thanks, |
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. |
Looks like this was fixed on develop but never ported. |
Folks, Can this be tested using 3006.3 packages? |
I think there are at least two issues lumped together here: The initial one I could not reproduce it using the config from #36796 (comment) - neither with the test suite nor in RL (I suspect this might have been fixed by the loader improvements since). I'm reasonably sure the originally linked PR does not fix it though. saltutil.runner This is the one where using The underlying problem is valid and possibly affects many modules: Since the minion options take precedence over master options in pillar compilation, some options that are present in both minion and master context are set wrong for pillar compilation. Examples include
Reversing the The original PR (#50489) is a bit weird since it takes specific care to reset these pillar opts if the current invocation is not The fix is insufficient in the current state of salt-ssh since pillars are always re-rendered with the minion opts only during state rendering (fix in #65484). I will include the findings above in that PR as well. |
Closing as fixed per #65067 (comment) |
Description of Issue/Question
Under some circumstances highstate fails when using salt-ssh and
salt['mine.get']
with error:Although I am able to successfully run each state individually, I get the above error when running highstate. The problem doesn't occure if we:
salt['mine.get']
is calledSetup
Roster file:
states/test_hosts/init.sls:
states/test_apps/init.sls
states/top.sls:
Steps to Reproduce Issue
The last lines of the master.log are:
Lastly, highstate runs successfully if I change states order in states/top.sls:
Versions Report
The text was updated successfully, but these errors were encountered: