Salt master not able to connect to gitfs remote

1.6k Views Asked by At

I am trying to configure remote github repo as the salt server root but it can't make the authentication successful with the pub/priv keypair. I have given the location of the keys in the /etc/salt/master file as well.

Below are the logs I am getting:

2018-11-05 01:48:32,197 [salt.utils.gitfs :1574][ERROR   ][21391] Error occurred fetching gitfs remote 'git@[github-endpoint].git': failed to start SSH session: Unable to exchange encryption keys
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/utils/gitfs.py", line 1552, in _fetch
    fetch_results = origin.fetch(**fetch_kwargs)
  File "/usr/lib64/python2.7/site-packages/pygit2/remote.py", line 405, in fetch
  File "/usr/lib64/python2.7/site-packages/pygit2/errors.py", line 64, in check_error
GitError: failed to start SSH session: Unable to exchange encryption keys

I have checked the keypair and connection to the github endpoint. I am able to sync the repo manually in the server.

1

There are 1 best solutions below

0
On

I found with the same issue and I finally solved with the following steps:

  1. I create a new ssh key: ssh-keygen -f gitfs_ssh -C '[email protected]'
  2. Then, I read that an empty line at the end of the private key could be fatal for libssh2, so I removed the empty lines at the bottom of the file (added by ssh-keygen at creation time) and then the new key began to work.

More info in this link