Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Error while executing /usr/bin/git in docker build command (ext priv dependencie) launch by Pipeline

David NOGUES January 14, 2020

Hi everybody,

For many projects in nodeJS, we use to launch pipelines which make first a npm install, then a npm test and finally a docker build before to send the built package to GCP.

On my example, my app have a private dependency on a private repo on the same account.

We created a couple of ssh keys and added the public key on the dest repo so the npm install and the npm test work perfectly in the pipeline !

But when the pipeline try to lauch the buil (docker build), it starts correctly and the engine try to access to the external dependency (like the npm install...) and we got the error :

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@bitbucket.org/*****/********
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.
npm ERR! npm ERR! exited with error code: 128

 

  • The repo exists
  • We declare the key in the pipeline. before the error we can see that the id is correctly added : Identity added: /root/.ssh/id_rsa (*******)

 

This worked perfectly like this the last time we tried to build. But it seems that somethings changed...

 

We spent 1,5 day to try many different things but we always got the same error.

Please is there anybody who can help use ?

Many thanks,

David.

1 answer

0 votes
Max Binnewies
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 22, 2020

Hi David,

Are you still experiencing this issue?

It's a bit hard to debug this remotely. As a first step can you please try to generate a new key pair in the settings for Bitbucket Pipelines(Repo settings, then look under "Pipelines") in your Node repo. Then copy the public key and add it to the account settings of the repo you are trying to clone. There is an explanation how to do that here in Step 4.

I realise that you have probably already done that, but often these errors are a result of faulty copy+paste or something similar. If you are still having issues you can contact support for more help.

Thanks,

Max

David NOGUES January 23, 2020

Hi Max,

Thanks for your answer. We still experiencing this issue... And yes we already did exactly what you say. We don't have any problem when the pipeline just do a npm install and get the dependencies.

We have the problem only when the pipeline try to build the node project. In this config, it is not the pipeline which launch the npm install in its env but a new env with  a new node pod launch by the dockerfile file...

In the dockerfile we try to manually add the private key to read the repo and we are enable to make a git clone from the fresh pod when the pipeline launch the build. So i think that our keys are good.

The problem, i think, is around the "Host key verification failed". So we tried to manually add the host fingerprint in the known_host file but we still have the error..

David

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events