我正在 Ubuntu 18.04 上使用 snapcraft catkin/catkin-tools 插件构建 ROS snap。该插件可以选择定义 rosinstall 文件以获取包依赖项。但是,构建过程失败并出现“Permission denied (publickey)”错误:
Installing wstool...
Initializing workspace (if necessary)...
Merging /root/parts/workspace/src/snap/local/snap.rosinstall
Updating workspace...
The authenticity of host 'github.com (140.82.118.3)' can't be established.
RSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Error updating workspace: Cloning into '/root/parts/workspace/src/src/catkin_simple'...
warning: templates not found /usr/share/git-core/templates
Warning: Permanently added 'github.com,140.82.118.3' (RSA) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
ERROR in config: Error processing 'catkin_simple' : [catkin_simple] Checkout of git@github.com:catkin/catkin_simple.git version None into /root/parts/workspace/src/src/catkin_simple failed.
在我的 snap.rosinstall 文件中,我只有公共 catkin_simple 插件:
- git:
local-name: catkin_simple
uri: git@github.com:catkin/catkin_simple.git
我的 snapcraft.yaml 的“部分”部分如下所示:
parts:
workspace:
plugin: catkin-tools
source: .
rosinstall-files: [snap/local/snap.rosinstall]
catkin-packages: [catkin_simple]
我已经尝试了不同的方法:
- 更改为 https 会导致错误:
warning: templates not found /usr/share/git-core/templates fatal: Unable to find remote helper for 'https'
. 我不明白这一点,因为它甚至是一个公共回购。 - 我用 sudo 添加了一个 SSH 密钥。
ssh -T git@github.com
和sudo ssh -T git@github.com
,以及一般的克隆都可以正常工作。 - 我检查了该文件夹是否
/usr/share/git-core/templates
存在,该文件夹在其他一些帖子中被标记为解决方案。
我唯一能想象的是,这个 VM 中缺少一些东西,而 snapcraft 是从一开始就开始的。但是,再次使用 git 作为 snapcraft.yaml 中的源(没有 rosinstall)可以正常工作,这是违反直觉的。
希望有人可以在这里添加清晰度。