Search code examples
gitubuntu-18.04roscatkinsnapcraft

Git warning "templates not found" while building ROS snap from rosinstall file


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.
[email protected]: 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 [email protected]: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: [email protected]: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 [email protected] and sudo ssh -T [email protected], 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.


Solution

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

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