Go failed to clone my repository with submodule

1,425 views
Skip to first unread message

Tony Wei

unread,
Feb 4, 2016, 8:26:59 PM2/4/16
to go-cd
My GoCD is installed the latest one 16.1.0.

The error shows:
Material update failed for material 'MyRave' because: Working directory: pipelines/flyweight/17503bcb-3003-4cd5-ab37-83f1343aa241 . Cause: Error performing command: --- Command --- git submodule update --- Environment --- {} --- INPUT ---- --OUTPUT --- --- ERROR --- STDERR: Cloning into 'COMPANY.AmazonSimpleServices'... STDERR: Host key verification failed. STDERR: fatal: Could not read from remote repository. STDERR: STDERR: Please make sure you have the correct access rights STDERR: and the repository exists. STDERR: Clone of 'g...@github.com:COMANY/SimpleServiceWrappers.git' into submodule path 'Medidata.AmazonSimpleServices' failed ---

But I am able to clone my repository in the local environment of the go agent.

Please help out!

Thanks very much!

Varsha Varadarajan

unread,
Feb 9, 2016, 2:30:50 AM2/9/16
to go-cd
Hi Tony,

Is it possible that the git url that you have provided while adding materials is incorrect? The url g...@github.com:COMANY/SimpleServiceWrappers.git seemed like a typo. There is also another possibility where the ssh keys have to be generated for the go-agent. But since you mentioned that you could run it locally, it is very likely that the url needs to be changed.

Thanks,
Varsha

Varsha Varadarajan

unread,
Feb 9, 2016, 3:10:55 AM2/9/16
to go-cd
Hi Tony, 

Another thing that I forgot to mention was that the Material Update happens on the server. The material (your git repository) is first cloned into the flyweight folder on the server and once a job is assigned to a go-agent, the material is cloned again on the agent. Please check that the ssh keys are set for the go user running the go-server. 

Thanks,
Varsha

On Friday, 5 February 2016 06:56:59 UTC+5:30, Tony Wei wrote:

Tony Wei

unread,
Feb 9, 2016, 11:45:18 PM2/9/16
to go-cd
Hi Varsha,

In my last email I replaced some of words such as COMPANY because it contains confidential info and they got nothing to do with the error, and you can't access to the mentioned repo because it is private one.

Anyway, the error is the following:

Material update failed for material 'MyRave' because: Working directory: pipelines/flyweight/8d863e92-c000-4b3c-bf8c-710936e33c5f . Cause: Error performing command: --- Command --- git submodule update --- Environment --- {} --- INPUT ---- --OUTPUT --- --- ERROR --- STDERR: Cloning into 'Medidata.AmazonSimpleServices'... STDERR: Host key verification failed. STDERR: fatal: Could not read from remote repository. STDERR: STDERR: Please make sure you have the correct access rights STDERR: and the repository exists. STDERR: Clone of 'g...@github.com:mdsol/SimpleServiceWrappers.git' into submodule path 'Medidata.AmazonSimpleServices' failed ---

I checked the Go server by logging as go, and manually ran git clone with github token which I use for go pipeline materials, and this manual clone works - it means the Go server system with go account and credential doesn't have any problem with submodule and anything else.

Please advise.

Thanks again.

Varsha Varadarajan

unread,
Feb 10, 2016, 3:01:23 AM2/10/16
to go-cd
Hi Tony,

When the go-server clones a repository, it also updates the submodules present. The command that generates the error is git submodule update, which is the first time the go-server tries to use remote url for the submodule. So, the clone of the repository which has the submodule can work when the correct access rights are given but the access rights for the submodule itself may not be set. Could you please do the following on the Go server as the 'go' user to check that the correct access rights are given? You could use a temp folder within it to do so.

git clone --branch=<branch> <remote_url> <path_of_destination_directory>
cd <destination_directory>
git submodule init
git submodule sync
git submodule foreach --recursive git submodule sync
git submodule update

Thanks,
Varsha

On Friday, 5 February 2016 06:56:59 UTC+5:30, Tony Wei wrote:

Tony Wei

unread,
Feb 10, 2016, 12:48:41 PM2/10/16
to go-cd
Hi Varsha,

I followed your suggestion and got trouble when running "git submodule update"

The authenticity of host github.com can't be established
...

I fixed it by creating a file called config (permission 600) at .ssh/, and having 2 lines:

Host *
    StrictHostKeyChecking no

Thanks very much for providing guidance and assistance.
Reply all
Reply to author
Forward
0 new messages