siemens / meta-iot2050

SIMATIC IOT2050 Isar/Debian Board Support Package
MIT License
130 stars 77 forks source link

Cloning : Host key verification failed #221

Closed MickaelDelanoe closed 2 years ago

MickaelDelanoe commented 2 years ago

Hello,

I want adding a git project with a personal recipes.

...
SRCREV = "87782cad64659b70dcd8422545a54f3ddfbaae6e"
SRC_URI += "git://git@git.aquassay.net/tools/opwee.git;protocol=ssh"
LICENSE = "CLOSED"
...

As I want clone the repo by SSH, so I generated and do the necessary to able to clone the repo. But I encounter an error during the build :

WARNING: opwee-core-1.0-r0 do_fetch: Failed to fetch URL git://git@git.aquassay.net/tools/opwee.git;protocol=ssh, attempting MIRRORS if available
ERROR: opwee-core-1.0-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; unset _PYTHON_SYSCONFIGDATA_NAME; export GIT_PROXY_COMMAND="oe-git-proxy"; export NO_PROXY="*"; export PATH="/work/isar/scripts:/work/isar/bitbake/bin:/usr/sbin:/usr/bin:/sbin:/bin"; export HOME="/tmp/tmpzq_2v5q4"; LANG=C git -c core.fsyncobjectfiles=0 clone --bare --mirror ssh://git@git.aquassay.net/tools/opwee.git /build/downloads/git/git.aquassay.net.tools.opwee.git --progress failed with exit code 128, output:
Cloning into bare repository '/build/downloads/git/git.aquassay.net.tools.opwee.git'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

ERROR: opwee-core-1.0-r0 do_fetch: Fetcher failure for URL: 'git://git@git.aquassay.net/tools/opwee.git;protocol=ssh'. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /build/tmp/work/iot2050-debian-arm64/opwee-core/1.0-r0/temp/log.do_fetch.75
ERROR: Task (/repo/recipes-aquassay/opwee-core/opwee-core.bb:do_fetch) failed with exit code '1'

I do not understand why the key verification enter in trouble, because I tried to clone manually my git repo into build/download/test and it works well.

I tried to increase the id_rsa right, but not effects ...

Do you have an idea ?

Best Regards,

jan-kiszka commented 2 years ago

You need to pass in a private key into the build env, and that will also skip host-key validation. See https://kas.readthedocs.io/en/latest/command-line.html, looking for SSH_PRIVATE_KEY.

Or pass a complete .ssh folder into build env, likely a filter one that only contains the needed keys, but also the right known_hosts file. That is achieved via --ssh-dir as kas command line option.

MickaelDelanoe commented 2 years ago

I used ./kas-container --ssh-dir /home/... build ... and it's work well. Thank you.