-
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
On salt-ssh, cmd.script does not copy scripts to remote server / cp.cache_* broken on salt-ssh #48067
Comments
I am unable to replicate this behavior.
It is working correctly for me. and copying the script over to the minion and then running the command. |
Minion based approach works but when i am using salt ssh there is no output.
Any way to debug when using salt ssh? |
The only different in output is cache error. |
I am unable to replicate this at all, can you provide me more information on your setup? any config changes you have made from the basic setup? I am not able to replicate this, and it shouldn't be happening, so I don't know where the problem is for you. It would also be worth while to share the Daniel |
i got the same problem. salt-ssh --no-host-keys --user=root --passwd=xxxx --roster=scan 10.0.10.200 cmd.script salt://5848f863e4b051f7b59fa4ce.sh -l debug Salt Version: Dependency Versions: System Versions: |
Same problem 2019.2.0rc2 Related/probably duplicate: #11352 |
@saltstack/team-triage can yall take a look at this? |
Single State
|
I'll take a look at this today |
Okay, yeah, I got the same behavior using
I also tried |
Interesting - I just added |
Huh. Nope - I was wrong, it looks like it's not passing the script to the minion... |
Okay, I'm not quite sure exactly why, but I've managed to isolate the behavior. Using this Dockerfile for the minion:
And this Dockerfile for the master
Run the minion like so:
And the master:
Then create a script in
And try to run it:
This fails with a cache error. Sad. All is not lost, however!
Now re-run the cmd.script and it works! From what I've been able to tell the problem is that the minion never asks the master for the file - I've got some tests I want to run about caching, but ultimately you can at least work around it by copying the file directly to |
ow gosh darnit @waynew I didn't have the time to deal with yet another bug in the salt-ssh minefield, but your enthousiasm has truly inspired me 🥇 So here's where I'm starting. The thing that freaks me out is that the single state does work. States basically do some check&control juju before actually calling the modules themselves. You're quite right in that in one instance the file is copied over, and the other is not. That's because salt-ssh has some magic unicorn stuff I don't know about yet. |
well whaddayaknow |
Okay, so you can run To verify:
From what I'm led to understand - salt-ssh should be grabbing the file on run, zipping it up, and shipping it to the minion. For some reason this is not happening with |
The Salt state prepackages itself into a state pkg, it takes an entirely different path and I've therefore ignored it for now. The thing is, The real So my current hunch is |
:( I can think of 3 fixes:
The latter at first sight seems so obvious I wonder why this hasn't happened before; it looks like not every module-internal call to Bad news is all are non-trivial fixes so again unfortunately beyond my current timetable :( |
thing that also has me stumped now is how @gtmanfred could not replicate the behaviour. Should've been exactly the same looking at the code from his versions report??? |
Uses Also @waynew, I see you can change the description right? I think the description should be changed to something along the lines of |
@The-Loeki That might be true. TBH, the But I did notice that the client does try using its own fileclients - if it were possible to just have a ssh fileclient that can ask the master for the file over ssh, that would totally fix this issue (and probably many others in salt-ssh). I don't know what that takes to do, though. |
Well look at the Basically one would have to copy the stuff from the Now that I'm writing all of this down it looks like a huge job, but it's manageable ;) |
Looking at that overloaded thing by the way there's definitely no prepackaging or something going on. So for module calls the flow is direct, as opposed to executing states, which actually do prepackage themselves as archives, including calls & all (that's some true black magic if you ask me ;), haven't looked at that piece yet) |
huh
@terminalmage I'm still not saying I'm up for fixxing this, but can we bother you for some wisdom regarding a direction here? |
OK new idea: |
|
@waynew negative, nothing more than what's already in PR #51636. As @mchugh19 notes (see more discussion in the PR) the wrapper wraps incompletely, it wraps only explicitly wrapped functions (if you still follow). The PoC I did in #51636 basically lowers the wrapping one level in the code in the wrapper itself. The real problem however is that the wrapped functions aren't the only entrypoints; others call the same functions in such a way that the wrapper in it's current form will never be able to catch. After digging around I figured that the method I used in #51636 would be easiest to port deeper into the salt code so the 'wrap' could possibly be completely forgone (as the SSH get's basically become a special case of Salt Fileserver gets). |
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. |
Bump |
Thank you for updating this issue. It is no longer marked as stale. |
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. |
Bump |
Thank you for updating this issue. It is no longer marked as stale. |
[rss@server_web_10 tmp]$ salt-ssh --version salt-ssh -l debug -i "192.128.100.77" cmd.run "mkdir -p /home/mycapitaltrade/lc" [DEBUG ] LazyLoaded roots.envs Why does it get stuck for so long after the last step,Can someone help solve this,millions of thanks The above frequency is an occasional occurrence,It leads to a big head |
Same here when deploying salt ssh inside docker compose, with the following debug log:
|
while executing script on target server using salt-ssh i am getting following error
cmd:- sudo salt-ssh minion cmd.script source=salt://test.sh
minion:
Setup
test.sh script is present at master on the /srv/salt/
We are executing command considering script will be executed remotely on target server(minion).
Versions Report
Salt Version:
Salt: 2017.7.1
Dependency Versions:
cffi: 1.11.5
cherrypy: 3.5.0
dateutil: 2.7.0
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: 1.0.3
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: 1.3.7
pycparser: 2.18
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.12 (default, Dec 4 2017, 14:50:18)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: Ubuntu 16.04 xenial
locale: UTF-8
machine: x86_64
release: 4.4.0-112-generic
system: Linux
version: Ubuntu 16.04 xenial
The text was updated successfully, but these errors were encountered: