Demo for Bitbucket Connect fails

I’m following the demo for Connect for Bitbucket here: Getting started. On Step 7, when I try to register the app here Log in with Atlassian account, it tells me The add-on server returned invalid data. Please contact the add-on vendor for help. Here's the error we encountered - The content-type header was text/plain; charset=utf-8, but we expected application/json.

I’ve also tried changing the baseUrl attribute in atlassian-connect.json to my new ngrok URL, but this didn’t work.

Any tips?

Also, here’s a view of the ngrok admin console at localhost:4040:

Also, here’s the Summary of the response:
image

Welcome to the Atlassian developer community @AdamLeppek,

This problem is caused by a change in behavior in how Bitbucket Connect works:

It looks like the docs have not been updated to reflect. Please be sure to rank pages in the top right of the appropriate page and report problems.

Thanks a lot @ibuchanan! I take it that the solution recommended on that post you mentioned is this, by @JeroenDeRaedt:

Just changing the URL you use to point at the actual URL should mitigate this issue.

I don’t actually quite understand what this involves…

So sorry. Of course you wouldn’t know; you’re just getting started.

I think the problem is in step 6 where you set the AC_LOCAL_BASE_URL. Instead of ending with no path, you must now append atlassian-connect.json.

$ AC_LOCAL_BASE_URL=https://2c57c047.ngrok.com/atlassian-connect.json npm run start

Ok, I think we’re getting closer, but after I do this I still get the same error when I try to register the app. I get a 302 when the ngrok URL is used by itself, and I get a 404 when /atlassian-connect.json is appended.

Ah! I got it. I built the app using the root path, and registered the app by going directly to the /atlassian-connect.json resource. It seems to be working now, thanks a lot for the help.

1 Like

I am getting the same error but not able to figure out,

i build the app using this
AC_LOCAL_BASE_URL=https://022b-2401-4900-1a37-3657-654e-231a8734-hjefe.in.ngrok.io/atlassian-connect.json node app.js

and i am registering the app using https://022b-2401-4900-1a37-3657-654e-231a8734-hjefe.in.ngrok.io/atlassian-connect.json
but getting 404

@ibuchanan @AdamLeppek

Any update here? I am having similar issues with a redirect if i follow the documentation. If i update the app location to include /atlassian-connect.json i can register the app, but once i try and see it in action, the [guid]-app.js file shows a 404 so the module doesnt make a sucessful request using the AP library since it cant find that ifle.

Run this command - AC_LOCAL_BASE_URL=https://{your_ngrok_url} npm run start
then open this URL in the web browser which will be similar to “https://{your_ngrok_url}/atlassian-connect.json”
if it’s working fine and returns some json on the browser then copy the URL from the browser and add use it to register the app
While registering the app you may encounter “key already used error” then go to the atlassian-connect.json file and give the “key” a new unique value

1 Like