0

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:

  • Changing to https results in the error: 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.
  • I added a SSH key with sudo. Both ssh -T git@github.com and sudo ssh -T git@github.com, as well as cloning in general work fine.
  • I checked that the folder /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.

pixelpress
  • 109
  • 1
  • 14
  • The warning (templates not found) is harmless but suggests something is a little "off" in the system Git installation (normally there are sample hooks in the templates directory). The "unable to find remote helper for https" indicates that something else is wrong with the install as well. The rejection of the ssh key indicates a bad / wrong ssh key, which doesn't square with the manual test either. It's not at all clear to me what's gong wrong here. – torek Jan 06 '20 at 10:35

1 Answers1

0

I will mark the question as solved since it will be fixed in the following pull request:

https://github.com/snapcore/snapcraft/pull/2852

pixelpress
  • 109
  • 1
  • 14