kestra-io / kestra

:zap: Workflow Automation Platform. Orchestrate & Schedule code in any language, run anywhere, 500+ plugins. Alternative to Zapier, Rundeck, Camunda, Airflow...
https://kestra.io
Apache License 2.0
10.61k stars 908 forks source link

Unable to connect to Github through sync due to UnknownHostKey #3477

Open ziegelstein opened 6 months ago

ziegelstein commented 6 months ago

Describe the issue

I used the following workflow:

id: test-git-sync-public
namespace: test

tasks:
  - id: git
    type: io.kestra.plugin.git.Sync
    url: git@github.com:username/public-repository.git # Changed for privacy
    branch: main

which resulted in the following error:

2024-04-05 15:30:53.393
Start cloning from 'git@github.com:username/public-repository.git'
2024-04-05 15:30:54.941
git@github.com:username/public-repository.git: UnknownHostKey: github.com. RSA key fingerprint is d5:2c:63:d9:bc:75:9d:de:b1:4e:36:28:9f:7a:9c:39
2024-04-05 15:30:54.941
git@github.com:username/public-repository.git: UnknownHostKey: github.com. RSA key fingerprint is d5:2c:63:d9:bc:75:9d:de:b1:4e:36:28:9f:7a:9c:39
UnknownHostKey: github.com. RSA key fingerprint is d5:2c:63:d9:bc:75:9d:de:b1:4e:36:28:9f:7a:9c:39

I also tried to add an password and connect to a private repository, which resulted in the following error:

git@github.com:username/private-repository.git: remote hung up unexpectedly
[ssh://git@github.com:22](ssh://git@github.com/): org.eclipse.jgit.transport.CredentialItem$YesNoType:The authenticity of host 'github.com' can't be established.
RSA key fingerprint is d5:2c:63:d9:bc:75:9d:de:b1:4e:36:28:9f:7a:9c:39.
Are you sure you want to continue connecting?

I discuesed this on Slack and we came to the conclusion to open an bug report for it.

Expected Behaviour:

I can directly connect to github through the git.sync module, or have an option to accept certs when configuring it.

Environment

brian-mulier-p commented 6 months ago

As said on slack you may have a corrupted ~/.ssh/known_hosts file as I can't reproduce the issue even if deleting it

ziegelstein commented 6 months ago

Hello!

How did you tried to reproduce the issue? After opening the issue, I tried the same flow in an newly created lxc container and vm inside proxmox. They both generate the same result.

I will try this also on bare-metal once I have time. This is either an issue on Proxmox or Kestra, I will update this issue once I have tested more.

brian-mulier-p commented 6 months ago

I tried locally but erasing my whole known_host file

anna-geller commented 2 months ago

Hi @ziegelstein, could you try perhaps using the new SyncFlows or SyncNamespaceFiles tasks on the latest version?