Unable to Authenticate via SSH to Private Repository

Solution Verified - Updated -

Environment

  • Red Hat Openshift on AWS (ROSA)
    • v4.10.z
    • v4.11.z

Issue

  • Unable to authenticate via ssh to private repository when creating a working build config

Sample Errors:

oc new-app --source-secret=github-ssh git@github.com:test-its-container-service/test-private-repo.git

warning: Cannot check if git requires authentication.
error:  local file access failed with: stat git@github.com:test-its-container-service/test-private-repo.git: no such file or directory
error: unable to locate any images in image streams, templates loaded in accessible projects, template files, local docker images with name "https://github.com/test-its-container-service/test-private-repo.git"

Resolution

  • This is a known bug OCPBUGS-4812 and OCPBUGS-4813 resolved in OC client v4.12 and further.

  • Download the OC v4.12 and upgrade current OC cli. The latest versions also contains the fix.

Note: Don't upgrade the whole cluster. Only the oc command-line is needed.

Root Cause

  • The oc new-app command using a private Git repository no longer works with oc v4.10.z and v4.11.z. Specifically, the private Git repository is authenticating over SSH and this occurs when no image stream is specified in the command so that the language detection step is required.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments