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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Trying to create a new Bitbucket app - Something went wrong Edited

Trying to follow the tutorial at https://developer.atlassian.com/cloud/bitbucket/getting-started and as soon as I get to the step to "Create an app" by visiting https://bitbucket.org/account/apps and pasting my app url, I get a server side 500 error after the browser sends a post request to https://bitbucket.org/!api/internal/account/{my-account-id}/apps/, where {my-account-id} is my actual bitbucket account id.

The only information shown in the UI just says "Something went wrong".

JSON response from the server also doesn't display anything useful:

{"type": "error", "error": {"message": "Something went wrong", "id": "2ca1739fca004effa2ddb0b1b1e1e7a1"}}

 

Bitbucket appears to be hitting my test application correctly and receives a valid response. Here's the JSON that is being fetched at that app URL:

{ "key":"example-app", "name":"Example App", "description":"An example app for Bitbucket", "vendor":{ "name":"Angry Nerds", "url":"https://www.atlassian.com/angrynerds" }, "baseUrl":"http://904aca29.ngrok.io", "authentication":{ "type":"jwt" }, "lifecycle":{ "installed":"/installed", "uninstalled":"/uninstalled" }, "modules":{ "webhooks":[ { "event":"*", "url":"/webhook" } ], "webItems":[ { "url":"http://example.com?repoPath={repository.full_name}", "name":{ "value":"Example Web Item" }, "location":"org.bitbucket.repository.navigation", "key":"example-web-item", "params":{ "auiIcon":"aui-iconfont-link" } } ], "repoPages":[ { "url":"/connect-example?repoPath={repository.full_name}", "name":{ "value":"Example Page" }, "location":"org.bitbucket.repository.navigation", "key":"example-repo-page", "params":{ "auiIcon":"aui-iconfont-doc" } } ], "webPanels":[ { "url":"/connect-example?repoPath={repository.full_name}", "name":{ "value":"Example Web Panel" }, "location":"org.bitbucket.repository.overview.informationPanel", "key":"example-web-panel" } ] }, "scopes":[ "account", "repository" ], "contexts":[ "account" ]}

 

1 answer

1 accepted

1 vote
Answer accepted
seanaty Atlassian Team Sep 12, 2019

Sorry for the bad error message. This is because your app lifecycle callbacks need to use https which really means your baseUrl needs to be https.

Thanks, not sure how I managed to miss that, however even once I switch everything over to HTTPS I still see the exact same result. Only difference is I give it a https URL, and I've updated the environment variable before starting the example app so it uses the HTTPS url as well. It's reflected in the json that gets requested.

{
"key": "example-app",
"name": "Example App",
"description": "An example app for Bitbucket",
"vendor": {
"name": "Angry Nerds",
"url": "https://www.atlassian.com/angrynerds"
},
"baseUrl": "https://e02daed9.ngrok.com/",
"authentication": {
"type": "jwt"
},
"lifecycle": {
"installed": "/installed",
"uninstalled": "/uninstalled"
},
"modules": {
"webhooks": [
{
"event": "*",
"url": "/webhook"
}
],
"webItems": [
{
"url": "http://example.com?repoPath={repository.full_name}",
"name": {
"value": "Example Web Item"
},
"location": "org.bitbucket.repository.navigation",
"key": "example-web-item",
"params": {
"auiIcon": "aui-iconfont-link"
}
}
],
"repoPages": [
{
"url": "/connect-example?repoPath={repository.full_name}",
"name": {
"value": "Example Page"
},
"location": "org.bitbucket.repository.navigation",
"key": "example-repo-page",
"params": {
"auiIcon": "aui-iconfont-doc"
}
}
],
"webPanels": [
{
"url": "/connect-example?repoPath={repository.full_name}",
"name": {
"value": "Example Web Panel"
},
"location": "org.bitbucket.repository.overview.informationPanel",
"key": "example-web-panel"
}
]
},
"scopes": [
"account",
"repository"
],
"contexts": [
"account"
]
}

Thanks, not sure how I missed that. Updating everything to HTTPS however still seems to give me the exact same result. Supplied URL is HTTPS, and the baseURL in the JSON is showing HTTPS. The rest is the same:

 

{"key":"example-app","name":"Example App","description":"An example app for Bitbucket","vendor":{"name":"Angry Nerds","url":"https://www.atlassian.com/angrynerds"},"baseUrl":"https://e02daed9.ngrok.com/","authentication":{"type":"jwt"},"lifecycle":{"installed":"/installed","uninstalled":"/uninstalled"},"modules":{"webhooks":[{"event":"*","url":"/webhook"}],"webItems":[{"url":"http://example.com?repoPath={repository.full_name}","name":{"value":"Example Web Item"},"location":"org.bitbucket.repository.navigation","key":"example-web-item","params":{"auiIcon":"aui-iconfont-link"}}],"repoPages":[{"url":"/connect-example?repoPath={repository.full_name}","name":{"value":"Example Page"},"location":"org.bitbucket.repository.navigation","key":"example-repo-page","params":{"auiIcon":"aui-iconfont-doc"}}],"webPanels":[{"url":"/connect-example?repoPath={repository.full_name}","name":{"value":"Example Web Panel"},"location":"org.bitbucket.repository.overview.informationPanel","key":"example-web-panel"}]},"scopes":["account","repository"],"contexts":["account"]}
seanaty Atlassian Team Sep 13, 2019

Are you sure you're using the right ngrok URL? Should it not be ngrok.io?

Thank you, that was indeed the issue. I guess the URL format has changed for ngrok at some point as the documentation for the tutorial uses .com, I had just replaced the example ID with my own. Appears to all be working correctly now.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,892 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you