Ssh_exchange_identification: Connection closed by remote host

Problem: While running remote jobs I receive the following error:

  1:
Error initializing command: RuntimeError - Unable to create directory on remote system /var/tmp/foreman-ssh-cmd-ca5ff35e-3566-459a-adb9-33f3acfc26ed: exit code: 255
   2:
 ssh_exchange_identification: Connection closed by remote host
   3:
Exit status: EXCEPTION

This happens on some servers, from what I can see it may be because their realm is in a different realm than the content server. However, if you continue to run the remote execution job, it may some times work. In the settings I do have fallback to any proxy selected:

I am not seeing any information about the failed jobs on in the production.log file.

I am wondering if these clients are trying to process from a smart proxy but since we only have remote execution installed on the main Foreman server if that is the cause of the issue?

Expected outcome: Jobs work without the above error

Foreman and Proxy versions: 3.1.3

Foreman and Proxy plugin versions:

Distribution and version: Centos 7.9

Other relevant data:

You may be having DNS resolution issues and could try this to troubleshoot that.

Also, the solution to a problem that sounds very much like the one you’re experiencing is here.

Thanks for that. I followed the steps but I still ran into issues. After investigating further I found that many subnets that did not have a proxy listed for remote execution. I added them and now all seems good. Another thing to check!

1 Like