salt icon indicating copy to clipboard operation
salt copied to clipboard

raise salt.exceptions.SaltClientError

Open teliduxing008 opened this issue 8 years ago • 5 comments

Description of Issue/Question

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).) procedure: from salt.client.ssh.client import SSHClient client = SSHClient(c_path='/etc/salt/master') print client.cmd(tgt='192.168.75.175', arg='*',fun='test.ping', salt_user='root', salt_passwd='passwd', roster='scan')

Error: raise salt.exceptions.SaltClientError('salt-ssh could not be run because it could not generate keys.\n\nYou can probably resolve this by executing this script with increased permissions via sudo or by running as root.\nYou could also use the '-c' option to supply a configuration directory that you have permissions to read and write to.') salt.exceptions.SaltClientError: salt-ssh could not be run because it could not generate keys.

You can probably resolve this by executing this script with increased permissions via sudo or by running as root. You could also use the '-c' option to supply a configuration directory that you have permissions to read and write to.

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

from salt.client.ssh.client import SSHClient client = SSHClient(c_path='/etc/salt/master') print client.cmd(tgt='192.168.75.175', arg='*',fun='test.ping', salt_user='root', salt_passwd='passwd', roster='scan')

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) Salt Version: Salt: 2015.8.8

Dependency Versions: Jinja2: 2.2.1 M2Crypto: Not Installed Mako: 0.3.4 PyYAML: 3.11 PyZMQ: 14.5.0 Python: 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) RAET: Not Installed Tornado: 4.2.1 ZMQ: 4.0.5 cffi: Not Installed cherrypy: 3.2.2 dateutil: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed libgit2: Not Installed libnacl: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pygit2: Not Installed python-gnupg: Not Installed smmap: Not Installed timelib: Not Installed

System Versions: dist: centos 6.9 Final machine: x86_64 release: 2.6.32-696.el6.x86_64 system: CentOS 6.9 Final

teliduxing008 avatar Jan 25 '18 05:01 teliduxing008

first, arg would be a list of arguments that are passed on the commandline without keywords

salt-ssh <tgt> state.sls <arg1> <arg2> this=<kwarg1>

since test.ping doesn't need any, you should not be setting arg.

Second, are you running this script with sudo or not?

And third, 2015.8.8 is end of lifed, i would highly recommend upgrading to a newer version.

http://repo.saltstack.com/

Thanks, Daniel

gtmanfred avatar Jan 25 '18 19:01 gtmanfred

My script is ok when the terminal is running, but it does not work in pychram-ide, but I need to test if the separate salt-master and salt-ssh frameworks can control all the hosts but not the master-minion scheme, Is there a best practice master-ssh document? I am a novice, hoping to get help.

Thanks Robin

teliduxing008 avatar Jan 26 '18 00:01 teliduxing008

We do not really have any best practice documentation.

https://docs.saltstack.com/en/latest/topics/ssh/

gtmanfred avatar Jan 26 '18 15:01 gtmanfred

ok,thanks

Robin

teliduxing008 avatar Jan 27 '18 00:01 teliduxing008

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.

stale[bot] avatar May 12 '19 01:05 stale[bot]