Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
638 views
in Technique[技术] by (71.8m points)

tomcat - hudson cannot fetch from git repository

I have a Hudson server, and a git repository, both running on our server (an ubuntu machine).
Whenever I try to build my app with hudson, he says the follwing

Iniciado pelo usuário anonymous
Checkout:workspace / /usr/share/tomcat6/.hudson/jobs/ECF/workspace - hudson.remoting.LocalChannel@176150c
Using strategy: Default
Checkout:workspace / /usr/share/tomcat6/.hudson/jobs/ECF/workspace - hudson.remoting.LocalChannel@176150c
Fetching changes from the remote Git repository
Fetching upstream changes from ssh://git@192.168.0.10/git/germantech.git
ERROR: Problem fetching from servidor / servidor - could be unavailable. Continuing anyway
ERROR:  (Underlying report) : Error performing command: git fetch -t ssh://git@192.168.0.10/git/germantech.git +refs/heads/*:refs/remotes/origin/*
Command "git fetch -t ssh://git@192.168.0.10/git/germantech.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: Host key verification failed.
fatal: The remote end hung up unexpectedly

ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository

what am i missing here? Ideas? thanks in advance

EDIT

Ok, made it work!
first, i've logged with my hudson user (sudo su - -s /bin/bash tomcat6) and then, i've deleted my .ssh folder.
after this, i just followed this link, and made a ssh login without password
now, hudson can do a fetch without have to especify a password

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to create an ssh relationship between hudson and git server.

You only need to do this once.

Steps:

  1. Log in in the hudson machine with the hudson user.

  2. create a ssh private and public key:

    ssh-keygen -t dsa
    Leave an empty passphase.
    Now you have 2 files in the hudson home under the .ssh folder: id_dsa and id_dsa.pub.

  3. Copy the key to your repo using:

    ssh-copy-id -i ~/.ssh/id_dsa.pub hudson@gitserver.machine.com

  4. Log out and verify you can now ssh without having to provide a password.

Hudson should now be able to connect.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...