Atlassian getting (401) unauthorized error installing from Heroku

I have moved my app up to Heroku for its production home. I have created new instances and installed my app successfully several times.

  • IMPORTANT NOTE: I only create a few new instances so I could ensure that the install worked successfully from a brand new instance that had never had an install of my app to it.

In my main stage instances, I have installed, uninstalled and reinstalled my 10+ times with no issues. So I cannot reproduce the issue that Atlassian is seeing. I could this thread and removed the code as specified: 401 (Unauthorized) after moving to Heroku. However, I am still successfully installing my app.

To this point, Atlassian support has not offered any steps to try and reproduce what they are seeing. I’ve worked with Heroku support and they have assured me that this issue does not sit on their side.

Finally, I have gone back through all of the steps I used to generate my ACE-based app, the installing it from the Marketplace steps and the Heroku setup steps and everything looks to be fine. I was wondering if I missed a flag or maybe needed to reconfigure my atlassian-connect.json or config.json files but again, according to the documentation I used to reach this point, everything looks good and is working just fine for me. But right now this is holding up my app from being approved to go public in the Marketplace so I thought I would reach out to the community for help. Please note, this is also my first app and first time through the approval process.

Anyway, has anyone else experienced this scenario where it works for you but not Atlassian? What are some other things I should check? My localBaseUrl in the config.json file is currently set to https://instance-auditor.heroku.com. If this should be set to something else, please advise but I have not found any documentation stating otherwise.

As always, thanks in advance for any assistance provided.

1 Like

Is your SSL certificate valid?

When I navigate to https://instance-auditor.heroku.com I’m getting a site is not secure error.

1 Like

Perhaps just a typo… should be: https://instance-auditor.herokuapp.com/

2 Likes

Yes it was a typo on my part. Thanks guys!

Correct Heroku URL is: https://instance-auditor.herokuapp.com.

When I hit this link my Atlassian-connect.json appears.

Also, I just ran the atlassian-connect.json file through the validator. It did not like the {{localBaseUrl}} but passed if I changed all instances of {{localBaseUrl}} to the actual Heroku url.

1 Like

Maybe I am not understanding this correctly, but shouldn’t the baseURL be set to whatever instance my app is installed on? For example, in my app I pull back a list of projects in one area and I have the project keys displayed as hyperlinks.

What I would expect to see for a project’s URL is: Log in with Atlassian account.

What I am seeing in my stage environment is: https://instance-auditor.herokuapp.com/browse/XYZ.

Of course, I can disable the hyperlink functionality and just display the project key in text format, but this makes me wonder if I have misconfigured my atlassian-connect.json (or config.json) file.

Please advise.

@LorenzoPhillips, the baseUrl that you define in your descriptor is for your app backend. This should not be confused with the other baseUrl value that you’ll get in the /installed payload (when the app is installed).

In that payload, you’ll see the following information:

{
  key: 'your-app-key-here',
  clientKey: 'client-key-here',
  publicKey: 'public-key-here',
  sharedSecret: 'shared-secret-here,
  serverVersion: 'you-can-ignore-this',
  pluginsVersion: 'your-app-version-here',
  baseUrl: 'https://the-customer-instance.atlassian.net',
  productType: 'jira',
  description: 'Atlassian JIRA at https://the-customer-instance.atlassian.net ',
  eventType: 'installed'
}

Above, that baseUrl is very different from your app descriptor’s base URL.

Roger that. I am updating my code where I use URLs to grab the Jira instance baseUrl from the parameters. So this should resolve any issues where I use URLs within the app itself.

Other than that, any ideas on why Atlassian can’t seem to install my app? Like I said, I am working with it now in Dev/Stage and I am having “zero” issues installing the app.

What does this actually mean? Can you be more specific? I tried installing with the url of your descriptor you posted above and it was able to install just fine. So I’m confused when you say Atlassian can’t install it.

1 Like

You an me both :slight_smile:

So the app is “pending approval” from Atlassian to become public in the marketplace. They have responded that they cannot install my app because they get a 401 unauthorized message. Since I cannot reproduce it, I’m not sure what they are doing. I have no steps from them just a screenshot.

I checked with Heroku and they have stated everything is fine. Now you have installed it. And I have installed it plenty of times! So they won’t approve my app because they can’t install it but have provided me with no information to help troubleshoot it.

The first version is super simple. It simply goes out and pulls information back. This is useful to Jira Admins like myself so I don’t have to manually count up the content when I do assessments of client environments. But the point was to keep it simple and get my first app into the marketplace.

I already have the 2.0 version ready to go that allows you to delete various things in an effort to keep you instance as clutter-free as possible.

But as long as you have successfully installed it, I have to say it something that Atlassian is doing wrong as they seem to be the only ones that can’t install it. :frowning:

Hey everyone,

Thanks for looking into this! It happened that there was something wrong with my cloud instance. I attempted this on a different instance and I was then able to install the app and test it out.

1 Like

Yes thank you to everyone (@rwhitbeck/@nmansilla)for your assistance—it was GREATLY appreciated! Thank you as well @Martin_Orz for getting me across the finish line!

This community has been awesome for me on my journey and I hope to be able to start giving back as you all have given to me. :slight_smile:

4 Likes