Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot connect bitbucket cloud organisation to jira server

Menno van den Ende August 29, 2018

I cannot connect jira server to bitbucket cloud.

When trying to connect i receive the following error:

The authentication with Bitbucket has failed. Please check your OAuth settings.

I've checked the team account name, OAuth Key and Secret 10 times, and i'm 100% sure they are correct.

I've checked the atlassion-jira.log and found the following error:

2018-08-29 13:06:12,629 http-nio-8080-exec-3 WARN balticode 786x49775x1 h4dbnl [some ip adresses here] /secure/admin/AddBitbucketOrganization.jspa [c.a.j.p.d.s.bitbucket.webwork.AddBitbucketOrganization] Error redirect user to bitbucket server.
java.lang.IllegalArgumentException: Response body is incorrect. Can't extract a token from an empty string

A little bit of searching on google resulted in this link. However, when looking at my server configuration, timezone is set correctly and synced with NTP, see screenshot: http://prntscr.com/ko7kdx

What else could be wrong? Using jira software 7.11.0

Thanks in advance!

1 answer

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 30, 2018

Menno,

Are you behind a proxy by any chance? If so, if you bypass the proxy does the issue persist? You can also try putting Jira in Safe Mode to see if an add-on is causing the issue.

For the workaround is there a way to manually sync it to double-check?

Lastly you can try recreating the OAuth consumer:

  1. Log in Bitbucket using the the right team or user account
  2. From Bitbucket settings -> OAuth, Revoke the JIRA access -> Delete the existing JIRA OAuth consumer
  3. Add a new OAuth consumer as follows:
    • Name: any name
    • Callback URL: http://jira:8080 (Jira URL)
    • Grant ALL Permissions
    • Save
  4. Use the new tokens for adding DVCS Account in JIRA

If the problem persists, follow these steps to enable debug logging so that we can have more visibility on what happens in the backend:

  1. From JIRA, go to JIRA Administration -> System -> Logging and Profiling
  2. Click Configure logging level for another package
  3. Add org.apache.http as package name -> Leave logging level as TRACE -> Add
  4. Click Configure logging level for another package (again)
  5. Add com.atlassian.jira.plugins.dvcs as package name -> Leave logging level as TRACE -> Add
  6. Add the DVCS Account again for JIRA to log the DEBUG messages
  7. Generate a fresh Support Zip

Once you have that, I can make a support ticket for you so you can send it to us and we can investigate.

Regards,

Shannon

Menno van den Ende August 30, 2018

Dear Shannon,

Thank you for your response.

Our jira is running behind apache, so it's accessible by a url without port 8080 behind it.

I've also tried to use our server ip address with port 8080 behind it in the OAuth consumer settings callback url field, but that also didn't work.

Trying safe mode also didn't improve anything, still the same error message.

I've also generated a new OAuth customer for the team with all permissions, but unfortunateley that also din't solve the problem.

I've generated a support zip like you requested. Please note i received the following message after generating: 

Support ZIP has been created but some items might be missing

Do i need to upload it here or do i need to wait until a support ticket has been created?

Thank you :)

Menno

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 30, 2018

Thank you, Menno!

I created the support ticket now, so please check your email for that link.

You can then attach your support ticket directly to the case and we can have a look at your logs.

Regards,

Shannon

apatormaciejs
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 28, 2018

I have the same error. The above solutions do not work. Did you solve the problem?

 

Maciej

Menno van den Ende November 28, 2018

 

 

Yes. Basically I just repeated the steps suggested by @Shannon S multiple times and after about 5 attempts it somehow worked. So i hope that's also the case for you...

 

Below are the steps I did like 5 times. Good luck... :S

 

Lastly you can try recreating the OAuth consumer:

  1. Log in Bitbucket using the the right team or user account
  2. From Bitbucket settings -> OAuth, Revoke the JIRA access -> Delete the existing JIRA OAuth consumer
  3. Add a new OAuth consumer as follows: 
    • Name: any name
    • Callback URL: http://jira:8080 (Jira URL)
    • Grant ALL Permissions
    • Save
  4. Use the new tokens for adding DVCS Account in JIRA

     

capri
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 29, 2019

Had the same issue. The problem was caused by the current time that was set on the Jira instance. It was just wrong. After I fixed the local time on the machine I was able to connect both applications again.

Like Menno van den Ende likes this

Suggest an answer

Log in or Sign up to answer