Checklist:
argocd version.$ argocd version
argocd: v1.3.2+a5a65cd
BuildDate: 2019-12-03T21:32:47Z
GitCommit: a5a65cdfe7c43fd1e3beada202d80c19bc50bd40
GitTreeState: clean
GoVersion: go1.12.6
Compiler: gc
Platform: darwin/amd64
argocd-server: v1.3.2+a5a65cd
BuildDate: 2019-12-03T21:32:18Z
GitCommit: a5a65cdfe7c43fd1e3beada202d80c19bc50bd40
GitTreeState: clean
GoVersion: go1.12.6
Compiler: gc
Platform: linux/amd64
Ksonnet Version: v0.13.1
Kustomize Version: Version: {Version:kustomize/v3.2.1 GitCommit:d89b448c745937f0cf1936162f26a5aac688f840 BuildDate:2019-09-27T00:10:52Z GoOs:linux GoArch:amd64}
Helm Version: v2.15.2
Kubectl Version: v1.14.0
Describe the bug
argocd-server-744fb699f7-7qf8j argocd-server time="2019-12-05T14:03:29Z" level=error msg="finished unary call with code Unknown" error="ssh: handshake failed: knownhosts: key is unknown" grpc.code=Unknown grpc.method=ValidateAccess grpc.service=repository.RepositoryService grpc.start_time="2019-12-05T14:03:29Z" grpc.time_ms=241.072 span.kind=server system=grpc
To Reproduce
Expected behavior
alt
$ argocd repo add ssh://[email protected]@source.developers.google.com:2022/p/example/r/my-repo --ssh-private-key-path ./argo-cd.id25519alt
$ argocd repo add ssh://[email protected]@source.developers.google.com:2022/p/example/r/my-repo --ssh-private-key-path ./argo-cd.id25519 --insecure-ignore-host-keyAlso, the command line says --insecure-ignore-host-key is deprecated and suggests --insecure-skip-server-validation but that flag doesn't exist.
alt
$ argocd repo add https://source.developers.google.com:2022/p/example-proj/r/my-repo after adding the child certificate from $ openssl s_client -showcerts -servername source.developers.google.com -connect source.developers.google.com:443 </dev/null in the UIAlso, the editor for known_host_keys is broken in that it doesn't accept the contents of the ~/.ssh/known_hosts_keys file.
Screenshots

Logs
argocd-server-744fb699f7-7qf8j argocd-server time="2019-12-05T14:03:29Z" level=error msg="finished unary call with code Unknown" error="ssh: handshake failed: knownhosts: key is unknown" grpc.code=Unknown grpc.method=ValidateAccess grpc.service=repository.RepositoryService grpc.start_time="2019-12-05T14:03:29Z" grpc.time_ms=241.072 span.kind=server system=grpc
//
error="Invalid hostname in request: [email protected] ...
//
argocd-server-744fb699f7-7qf8j argocd-server time="2019-12-05T14:07:04Z" level=error msg="finished unary call with code Unknown" error="ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain" grpc.code=Unknown grpc.method=ValidateAccess grpc.service=repository.RepositoryService grpc.start_time="2019-12-05T14:07:03Z" grpc.time_ms=499.563 span.kind=server system=grpc
//
Seeing the same on bitbucket - could it have a relation to a non-default port?
Related issue https://github.com/argoproj/argo-cd/issues/2890
I've tried v1.3.6 and v1.4.0-rc1
Sorry for the late reply, I was out on a well-earned vacation for a while :)
The known hosts management currently does not support all formats supported by SSH yet, most prominently it does not support multiple host specifications for the same key - as is the case with your known host data.
As a quick workaround, you should be able to remove the second hostname specification for the key in the first line of your known_hosts data, i.e. remove the ,[..ipv6addr]:2022 part after [source.developers.google.com]:2022 on line 1.
The fix to support multiple host names should not be hard to do, and I will send a PR shortly.
Most helpful comment
Sorry for the late reply, I was out on a well-earned vacation for a while :)
The known hosts management currently does not support all formats supported by SSH yet, most prominently it does not support multiple host specifications for the same key - as is the case with your known host data.
As a quick workaround, you should be able to remove the second hostname specification for the key in the first line of your known_hosts data, i.e. remove the
,[..ipv6addr]:2022part after[source.developers.google.com]:2022on line 1.The fix to support multiple host names should not be hard to do, and I will send a PR shortly.