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

Trying to create a new Bitbucket app - Something went wrong

scott-macd September 12, 2019

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
Atlassian Team members are employees working across the company in a wide variety of roles.
September 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.

scott-macd September 13, 2019

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"
]
}
scott-macd September 13, 2019

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
Atlassian Team members are employees working across the company in a wide variety of roles.
September 13, 2019

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

scott-macd September 13, 2019

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
AUG Leaders

Atlassian Community Events