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" ]}
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"
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"]}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure you're using the right ngrok URL? Should it not be ngrok.io?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!
Join an Atlassian Community Event!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.