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

Connect bitbucket repository with jenkins on ec2

Raghvendra Singh May 3, 2013

Hi All

I am trying to configure jenkins with my bitbucke repository and i am not able to. Here is what i have done so far

1. Started an ec2 instance (ubuntu) and installed jenkins on it

2. installed git plugin on jenkins

3. Added the public key in deployment keys section of my repository on bitbucket

4. I verified that at my ec2 machine i can clone the repository using git@bitbucket.org....

5. Now i give my repository url in the git section of jenkins

and i get the following error

Failed to connect to repository : Command "git ls-remote -h git@bitbucket.org:apprick/apprickwebapp.git HEAD" returned status code 128:
stdout:
stderr: Host key verification failed.
fatal: The remote end hung up unexpectedly

Anyone any idea about it? I have tried various things but can't get it working.

3 answers

Suggest an answer

Log in or Sign up to answer
0 votes
m
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2013

Hi Raghvendra,

Make sure you have read the documentation on this page:

https://confluence.atlassian.com/display/BITBUCKET/Jenkins+Service+Management

There are some gotchas with Jenkins and Bitbucket.

The documentation also has a page that walks you through troubleshooting a service:

https://confluence.atlassian.com/display/BITBUCKET/Troubleshooting+Bitbucket+Services

If you try the things on this page and still have problems, you can send an email to support@bitbucket.org.

Mary

0 votes
Jozef Kotlár
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2013

ad 4. Did you verified your connection to bitbucket from the machine running jenkins logged in as user running jenkins daemon?

Raghvendra Singh May 5, 2013

Hi Jozef

Thanks for your response. Actually that is my question. Do i need to start jenkins as root user. If yes then how do do that?

Jozef Kotlár
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2013

Usually I am running every service as separate linux user - in this case as a user named jenkins. So I would login as that user and in that identity checked the connection (there will be question for storing key):

sudo su - jenkins

ssh git@bitbucket.org

After that you should have in home directory of user jenkins new file .ssh/known_hosts with entry for bitbucket.org.

If you run service as root user - which is not recommended for security - you should do it as user root.

0 votes
MJ
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 5, 2013

Hi Raghvendra, another user has had similar problems and asked about it here, you will find his question (and long conversation chain) here. Please have a look at that, perhaps you can find your answer there, the user runs into the same issue as you experience towards the end of the first page.

Raghvendra Singh May 5, 2013

Hi Mick

Thanks for thr response. I did read the thread before posting the question. But in the end the thread discussed the setup for mac. My doubt is whether i need to start jenkins as root to do that (which was not answered in the thread). If yes then how do i do that?

-raghu

TAGS
AUG Leaders

Atlassian Community Events