ssh-agent icon indicating copy to clipboard operation
ssh-agent copied to clipboard

Deployment key mapping not working with `vcstool` (from dirk-thomas/vcstool)

Open ericluwj opened this issue 4 years ago • 1 comments

I have created 2 sets of ssh keys + github deploy tokens so that my main git repo github action workflow can clone 2 other private git repos. However, 1 private repo could be cloned while the other could not.

Run webfactory/[email protected]:

Key(s) added:
256 SHA256:T352v3BwjjmEpVfq5D/p4YOIsszvXNhIKG7ZwuAyGDY [email protected]:asdf/aws-robotics-rosbag-uploader-ros1.git (ED25519)
256 SHA256:J7ESlzcWidq7HPE230ntxFjgn0q0Niz1GVKDmxWSp+Y [email protected]:asdf/aws-robotics-utils-common.git (ED25519)
Configuring deployment key(s)
Added deploy-key mapping: Use identity '/home/runner/.ssh/key-42ab39475dd17224c2a41707a74ac2f1fdac2e8dc2abf3518e365119422b5c17' for GitHub repository asdf/aws-robotics-rosbag-uploader-ros1
Added deploy-key mapping: Use identity '/home/runner/.ssh/key-049256e68ad1237c709c594734af12b208c23e67a38e5e493d53bdc81a911495' for GitHub repository asdf/aws-robotics-utils-common

However, with command vcs import --recursive --force /home/runner/work/vcc-ros/vcc-ros/.work/upstream_ws/src:

=== /home/runner/work/vcc/vcc/.work/upstream_ws/src/aws-robotics-rosbag-uploader-ros1 (git) ===
  Warning: Permanently added the RSA host key for IP address '192.30.255.113' to the list of known hosts.
  Already on 'main'
  Your branch is up to date with 'origin/main'.
  
  === /home/runner/work/vcc/vcc/.work/upstream_ws/src/aws-robotics-utils-common (git) ===
  Could not determine ref type of version: Warning: Permanently added the RSA host key for IP address '192.30.255.112' to the list of known hosts.
  ERROR: Repository not found.
  fatal: Could not read from remote repository.

It is noted that the 2nd repo failed to be downloaded via git clone. The branch has been double checked.

ericluwj avatar Sep 23 '21 13:09 ericluwj

There have been other issues (see #74 or #63 for examples) in the past when other tools than git try to clone repos, and these don't follow the .gitconfig configuration that is necessary to map deployment keys to repos.

What you can do to check:

After you ran this action here in your workflow, add a run step and try to git clone ...your-first-repo... and then git clone ...your-second-repo....

If that works (git can clone both), your key setup and deployment-key mapping works fine ✔️ , the issue then lies within the tool you're using.

I don't know what vcs import is or does. You'd need to find out if it brings its own git client under the hood or if it can be switched to using the system-provided git command.

Maybe the examples/caveats documented in the README for other platforms (here: https://github.com/webfactory/ssh-agent#additional-information-for-particular-tools-or-platforms) help you?

mpdude avatar Nov 18 '21 11:11 mpdude