I'm building a ROS snap with the snapcraft catkin/catkin-tools plugin on Ubuntu 18.04. This plugin has the option to define rosinstall files to fetch package dependencies. However, the build process fails with a "Permission denied (publickey)" error:
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.
In my snap.rosinstall file I have only the public catkin_simple plugin:
- git:
local-name: catkin_simple
uri: git@github.com:catkin/catkin_simple.git
The "parts" part of my snapcraft.yaml looks as follows:
parts:
workspace:
plugin: catkin-tools
source: .
rosinstall-files: [snap/local/snap.rosinstall]
catkin-packages: [catkin_simple]
I already tried different approaches:
warning: templates not found /usr/share/git-core/templates
fatal: Unable to find remote helper for 'https'
. I don't understand this since it is even a public repo.ssh -T git@github.com
and sudo ssh -T git@github.com
, as well as cloning in general work fine./usr/share/git-core/templates
exists, which was marked as a solution in some other posts.The only thing I can imagine is that something is missing in this VM, which snapcraft is starting at the beginning. However, again, using git as a source in snapcraft.yaml (without rosinstall) works fine, which is counterintuitive.
Hope that someone can add clarity here.
I will mark the question as solved since it will be fixed in the following pull request: