Unable to connect bitbucket from Jenkins

Olivia Chow January 7, 2021

I have setup the application links for Jenkins from Bitbucket.

For the outgoing authentication, I have created a consumer from Jenkins with the plugin of "Manage Bitbucket Server consumers"

However, I have no idea what information is required and how to get them in order to configure the part of Incoming Authentication, especially the Consumer Key and public key. 

Besides, in the Bitbucket Server integration setting of Jenkins, I have inserted the personal access token generated by my bitbucket admin, however, the connection is still failed. 

 

2 answers

1 vote
Ganesh Babu
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2021

Hello @Olivia Chow 

Welcome to the Atlassian Community...!!!

You can make use of this Add-on developed by Atlassian for a ease and smooth connection between bitbucket and jenkins.

https://marketplace.atlassian.com/apps/1222132/jenkins-integration-for-bitbucket-server?hosting=server&tab=overview

Document - https://plugins.jenkins.io/atlassian-bitbucket-server-integration/

Please check on the consumer key and shared secret on the application links detail page in Jenkins as same data needs to be copied on Bitbucket during the creation of application link

Olivia Chow January 8, 2021

Thanks. 

I already create a personal access token from the Bitbucket and use the token to connect Bitbucket from Jenkins. However, it said the connection is failed. I am sure that the instance base URL of bitbucket is correct. It's very odd..

Besides, I capture a log message from the Bitbucket container which 10.176.x.x is the ip of my desktop and 172.19.0.26 is the internal ip of nginx-proxy-ssl. 

2021-01-07 17:07:43,485 WARN [http-nio-7990-exec-41] my_user_name_in_jenkins @SLDATYx1027x9557x0 1b19i56 10.176.x.x, 172.19.0.26 "GET /rest/applinks/3.0/status/1186df59-f2e4-34fc-95c2-245b77f5af0e HTTP/1.1" c.a.a.i.m.remote.TryWithCredentials You do not have an authorized access token for the remote resource.

It seems the problem is shown here but I have no idea about the cause and how to fix it. 

Ganesh Babu
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2021
Olivia Chow January 11, 2021

Thank you for the information. But I am not quite familiar what should I check on my nginx-ssl-proxy container based on the links you provided. 

In fact, my jra, bitbucket and confluence can successfully connected to each other with using hostname alias, e.g. https://jira.domain/.

Also, I have successfully tried to connect the Jenkins to Confluence and Jira with Confluence Publisher plugin (refer to Capture.PNG) and Jira plugin (refer to Capture2.PNG) with credential of username and password. 

So, it is so odd that only connection via personal access token is failure. 

 

Capture2.PNG

Capture.PNG

Olivia Chow January 11, 2021

Thank you for the information. But I am not quite familiar what should I check on my nginx-ssl-proxy container based on the links you provided. 

In fact, my jra, bitbucket and confluence can successfully connected to each other with using hostname alias, e.g. https://jira.domain/.

Also, I have successfully tried to connect the Jenkins to Confluence and Jira with Confluence Publisher plugin (refer to Capture.PNG) and Jira plugin (refer to Capture2.PNG) with credential of username and password. 

So, it is so odd that only connection via personal access token is failure. 

 

Capture.PNGCapture2.PNG

Olivia Chow January 11, 2021

Thank you for the information. But I am not quite familiar what should I check on my nginx-ssl-proxy container based on the links you provided. 

In fact, my jra, bitbucket and confluence can successfully connected to each other with using hostname alias, e.g. https://jira.domain/.

Also, I have successfully tried to connect the Jenkins to Confluence and Jira with Confluence Publisher plugin  and Jira plugin with credential of username and password. 

So, it is so odd that only connection via personal access token is failure. 

0 votes
Sandesh Shetty
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.
January 7, 2021

@Olivia Chow 

May be this video link is helpful for you!!

kindly accept the answer if it is helpful!!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events