Skip to content

Problem when trying to fetch private git repository (npm install) #250

@weizenberg

Description

@weizenberg

Hello!

I used the s2i-nodejs task from the OpenShift tekton catalog), with the same parameters and settings.

My package.json contains private git (bitbucket) repository, so when the container trying to install the npm modules, it failed with the following message:

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/weizenberg/shared.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

I already defined the ssh secret using the Tekton Auth Tutorial, it's working with git-clone task.

I mounted the .ssh folder to the root folder (instead tekton/home), and run a check to ensure that folder exists with the ssh files:
lrwxrwxrwx. 1 root root 13 Aug 10 13:03 id_rsa -> ..data/id_rsa
lrwxrwxrwx. 1 root root 18 Aug 10 13:03 known_hosts -> ..data/known_hosts

I think the ssh directory should be exposed to the nodejs somehow in your container to solve this issue. You can refer the similar issue in the python container: sclorg/s2i-python-container#280

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions