No such file or directory: '/home/stanley/.ssh/stanley_rsa
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
i got a error when i run core.remote
st2 run core.remote hosts='10.69.10.1:5000' cmd='echo123'
.
id: 65ae14e509204db1549f4a31
action.ref: core.remote
context.user: st2admin
parameters:
cmd: echo123
hosts: 10.69.10.1:5000
status: failed
start_timestamp: Mon, 22 Jan 2024 07:10:29 UTC
end_timestamp: Mon, 22 Jan 2024 07:10:29 UTC
result:
error: "Unable to connect to any one of the hosts: ['10.69.10.1:5000'].
connect_errors={
"10.69.10.1": {
"failed": true,
"succeeded": false,
"timeout": false,
"return_code": 255,
"stdout": "",
"stderr": "",
"error": "Failed connecting to host 10.69.10.1. [Errno 2] No such file or directory: '/home/stanley/.ssh/stanley_rsa'",
"traceback": "Traceback (most recent call last):\
File \\"/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/runners/parallel_ssh.py\\", line 278, in _connect\
client.connect()\
File \\"/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/runners/paramiko_ssh.py\\", line 171, in connect\
self.client = self._connect(host=self.hostname, socket=self.bastion_socket)\
File \\"/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/runners/paramiko_ssh.py\\", line 747, in _connect\
passphrase_reqd = self._is_key_file_needs_passphrase(self.key_files)\
File \\"/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/runners/paramiko_ssh.py\\", line 841, in _is_key_file_needs_passphrase\
cls.from_private_key_file(file, password=None)\
File \\"/opt/stackstorm/st2/lib/python3.8/site-packages/paramiko/pkey.py\\", line 249, in from_private_key_file\
key = cls(filename=filename, password=password)\
File \\"/opt/stackstorm/st2/lib/python3.8/site-packages/paramiko/rsakey.py\\", line 64, in __init__\
self._from_private_key_file(filename, password)\
File \\"/opt/stackstorm/st2/lib/python3.8/site-packages/paramiko/rsakey.py\\", line 190, in _from_private_key_file\
data = self._read_private_key_file(\\"RSA\\", filename, password)\
File \\"/opt/stackstorm/st2/lib/python3.8/site-packages/paramiko/pkey.py\\", line 321, in _read_private_key_file\
with open(filename, \\"r\\") as f:\
FileNotFoundError: [Errno 2] No such file or directory: '/home/stanley/.ssh/stanley_rsa'\
"
}
}"
traceback: " File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2actions/container/base.py", line 117, in _do_run
runner.pre_run()
File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/runners/paramiko_ssh_runner.py", line 206, in pre_run
self._parallel_ssh_client = ParallelSSHClient(**client_kwargs)
File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/runners/parallel_ssh.py", line 90, in __init__
connect_results = self.connect(raise_on_any_error=raise_on_any_error)
File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/runners/parallel_ssh.py", line 131, in connect
raise NoHostsConnectedToException(msg)
but i only exec ssh command is ok
ssh 10.69.10.1 -p 5000
i try
cp ~/.ssh/id_rsa /home/stanley/.ssh/stanley_rsa
again run
st2 run core.remote hosts='10.69.10.1:5000' cmd='echo123'
error don't resolved
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the core.remote command and compare its SSH setup with the successful interactive ssh command. Read st2common/runners/paramiko_ssh.py and st2common/runners/parallel_ssh.py around the reported connection and key-file paths. Done means the action connects with the documented key configuration or reports a clear, actionable error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100