Unable to install ACE Jira app from Heroku

233 views Asked by At

I've got my Atlassian Connect app set up using the instructions at the ACE BitBucket site, and I've been manually deploying my app to development instances using ngrok tunnels as usual. The app works fine, all pages show properly and the application itself does what it's supposed to (in development mode)

Now, I'm trying to use Heroku for my production deployments, and the app builds and deploys just fine, with no errors showing in heroku logs --tail. I can clearly see the atlassian-connect.json descriptor being deployed to the appropriate URL on Heroku.

However, when I try to use URL to the deployed descriptor on Heroku to install my app in one of my test Jira instances, I get the following error in Jira:

The app host returned HTTP response code 503 when we tried to contact it during installation. Please try again later or contact the app vendor.

These are the logs I get from Heroku, with no obvious errors being thrown anywhere:

2020-04-03T04:51:11.256336+00:00 heroku[router]: at=info method=GET path="/atlassian-connect.json" host=example-app.herokuapp.com request_id=4676badf-c37f-4440-b017-1b1ec5f00023 fwd="18.234.32.227" dyno=web.1 connect=1ms service=4ms status=200 bytes=1354 protocol=https

2020-04-03T04:51:11.255764+00:00 app[web.1]: ::ffff:10.5.179.3 - - [03/Apr/2020:04:51:11 +0000] "GET /atlassian-connect.json HTTP/1.1" 200 905 "-" "Apache-HttpClient/4.5.12 (Java/1.8.0_242)"

Lastly, here's my atlassian-connect.json file:

{
    "key": "example-app",
    "name": "Example App",
    "baseUrl": "{{localBaseUrl}}",
    "authentication": {
        "type": "jwt"
    },
    "lifecycle": {
        "installed": "installed"
    },
    "scopes": [
        "READ"
    ],
    "modules": {
        "jiraProjectPages": [
            {
                "key": "example-app-page-jira",
                "location": "system.top.navigation.bar",
                "name": {
                    "value": "Example app"
                },
                "url": "/example-app",
                "iconUrl": "{{localBaseUrl}}/images/example.svg",
                "conditions": [{
                    "condition": "user_is_logged_in"
                }]
            },
            {
                "key": "example-app-2-page-jira",
                "location": "system.top.navigation.bar",
                "name": {
                    "value": "Example app 2"
                },
                "url": "/example-app-2",
                "iconUrl": "{{localBaseUrl}}/images/example2.svg",
                "conditions": [{
                    "condition": "user_is_logged_in"
                }]
            }
        ]
    }
}

Here's what I've tried so far:

  • Defining a route for /installed in index.js, giving the status code 200, like so:
app.get('/installed', (req, res) => {
        res.send('success');
    });
  • Updating the pg and sequelize packages
  • Uploading the descriptor as a private app to the Atlassian Marketplace and installing from there

Nothing seems to work; does anyone have any idea what's causing this error?

1

There are 1 answers

0
A. Vance On BEST ANSWER

Turns out the issue was something I thought I'd dealt with, but really hadn't.

The issue was the /installed endpoint in the end; as you can see in the descriptor, I had defined the lifecycle endpoint as "installed" instead of "/installed", so the response was never being received.

Changing that line to "/installed" fixed everything.