Can't host ACE Jira App on Heroku

Hi,

I’ve developed a Jira app locally using the ACE framework that I’ve tested and works fine.

I’m now at the stage where I’d like to list my app on the Marketplace privately so that I can closed beta test the app further.

I’ve followed the instructions here (https://bitbucket.org/atlassian/atlassian-connect-express/src/master/) to upload the app to heroku, which I’ve followed (https://truesight-backlog.herokuapp.com/). I’ve also attached a valid SSL cert.

After following these instructions I’m met with a 503 error that I’m having trouble diagnosing. I’ve done some trawling and found a few old forum posts that I’ve tried to replicate, but I’m still failing.

My understanding of the additional requirements to push to production are as follows:

  1. Change the config.json file to point to my heroku URL, I’m assuming this is done by changing “localBaseUrl” from “https://my-subdomain.herokuapp.com” to my own URL, in this case “https://my-subdomain.herokuapp.com” I’ve tried adjusting this but it doesn’t seem to have any effect

  2. I’ve also read that the index.js file needs to be changed, something about redirecting to /installed, but I’m not sure what that entails. Do I have to replace the following code?

    app.get('/', (req, res) => {
        res.redirect('/atlassian-connect.json');
    });

Any assistance would be appreciated.

The error log from heroku is

2019-11-16T09:32:03.243983+00:00 app[web.1]: at new SequelizeAdapter (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:56:33) 2019-11-16T09:32:03.243985+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:187:10) 2019-11-16T09:32:03.243988+00:00 app[web.1]: at Function.stores.create (/app/node_modules/atlassian-connect-express/lib/store/index.js:18:10) 2019-11-16T09:32:03.243990+00:00 app[web.1]: at stores (/app/node_modules/atlassian-connect-express/lib/store/index.js:12:17) 2019-11-16T09:32:03.243992+00:00 app[web.1]: at new Addon (/app/node_modules/atlassian-connect-express/lib/index.js:35:38) 2019-11-16T09:32:03.243994+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/index.js:222:12) 2019-11-16T09:32:03.243996+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:32:15) 2019-11-16T09:32:03.243998+00:00 app[web.1]: at Generator.next (<anonymous>) 2019-11-16T09:32:03.265358+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2019-11-16T09:32:03.265635+00:00 app[web.1]: npm ERR! errno 1 2019-11-16T09:32:03.266607+00:00 app[web.1]: npm ERR! my-app@0.0.1 start:node -r esm app.js2019-11-16T09:32:03.266766+00:00 app[web.1]: npm ERR! Exit status 1 2019-11-16T09:32:03.266928+00:00 app[web.1]: npm ERR! 2019-11-16T09:32:03.267073+00:00 app[web.1]: npm ERR! Failed at the my-app@0.0.1 start script. 2019-11-16T09:32:03.267188+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2019-11-16T09:32:03.275837+00:00 app[web.1]: 2019-11-16T09:32:03.275956+00:00 app[web.1]: npm ERR! A complete log of this run can be found in: 2019-11-16T09:32:03.276046+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-11-16T09_32_03_269Z-debug.log 2019-11-16T09:32:03.360864+00:00 heroku[web.1]: State changed from starting to crashed 2019-11-16T09:32:03.338790+00:00 heroku[web.1]: Process exited with status 1 2019-11-16T09:32:05.099495+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=truesight-backlog.herokuapp.com request_id=09e3f762-b8aa-42a6-9119-2098ba7a4428 fwd="121.200.4.221" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:32:05.956647+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=truesight-backlog.herokuapp.com request_id=c2e1ec4f-1139-424b-beca-1c7709e80cc7 fwd="121.200.4.221" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:32:10.186544+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=truesight-backlog.herokuapp.com request_id=bd252ba0-fd15-4581-afe3-1cfdd21755a2 fwd="121.200.4.221" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:32:10.972096+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=truesight-backlog.herokuapp.com request_id=e2c350da-b8dc-4a39-9e29-1441e8503959 fwd="121.200.4.221" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:32:12.476290+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=truesight-backlog.herokuapp.com request_id=7b38ab92-8dfb-473d-81e2-0e9c18bdd9c2 fwd="121.200.4.221" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:32:13.263968+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=truesight-backlog.herokuapp.com request_id=e1c6d9ec-d096-46ae-8d94-69b69e3c67f8 fwd="121.200.4.221" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:32:41.426173+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=truesight-backlog.herokuapp.com request_id=bb44510d-8d17-4088-9824-9d14b52ce440 fwd="104.192.136.197" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:42:18.986013+00:00 heroku[web.1]: State changed from crashed to down 2019-11-16T09:42:18.684557+00:00 app[api]: Scaled to web@1:Hobby by user quirky2000@gmail.com 2019-11-16T09:42:22.653422+00:00 heroku[web.1]: Starting process with commandnpm start2019-11-16T09:42:24.938253+00:00 app[web.1]: 2019-11-16T09:42:24.938281+00:00 app[web.1]: > my-app@0.0.1 start /app 2019-11-16T09:42:24.938284+00:00 app[web.1]: > node -r esm app.js 2019-11-16T09:42:24.938286+00:00 app[web.1]: 2019-11-16T09:42:25.526094+00:00 app[web.1]: Sat, 16 Nov 2019 09:42:25 GMT morgan deprecated default format: use combined format at node_modules/esm/esm.js:1:278827 2019-11-16T09:42:28.265020+00:00 app[web.1]: { logging: [Function], pool: undefined } 2019-11-16T09:42:28.359208+00:00 app[web.1]: /app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:1 2019-11-16T09:42:28.359212+00:00 app[web.1]: Error: Please install pg package manually 2019-11-16T09:42:28.359215+00:00 app[web.1]: at ConnectionManager._loadDialectModule (/app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:81:15) 2019-11-16T09:42:28.359217+00:00 app[web.1]: at new ConnectionManager (/app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:18:24) 2019-11-16T09:42:28.359220+00:00 app[web.1]: at new PostgresDialect (/app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/dialects/postgres/index.js:14:30) 2019-11-16T09:42:28.359222+00:00 app[web.1]: at new Sequelize (/app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/sequelize.js:322:20) 2019-11-16T09:42:28.359224+00:00 app[web.1]: at new SequelizeAdapter (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:56:33) 2019-11-16T09:42:28.359226+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:187:10) 2019-11-16T09:42:28.359228+00:00 app[web.1]: at Function.stores.create (/app/node_modules/atlassian-connect-express/lib/store/index.js:18:10) 2019-11-16T09:42:28.359231+00:00 app[web.1]: at stores (/app/node_modules/atlassian-connect-express/lib/store/index.js:12:17) 2019-11-16T09:42:28.359233+00:00 app[web.1]: at new Addon (/app/node_modules/atlassian-connect-express/lib/index.js:35:38) 2019-11-16T09:42:28.359235+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/index.js:222:12) 2019-11-16T09:42:28.359237+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:32:15) 2019-11-16T09:42:28.359239+00:00 app[web.1]: at Generator.next (<anonymous>) 2019-11-16T09:42:28.370693+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2019-11-16T09:42:28.370964+00:00 app[web.1]: npm ERR! errno 1 2019-11-16T09:42:28.372000+00:00 app[web.1]: npm ERR! my-app@0.0.1 start:node -r esm app.js2019-11-16T09:42:28.372165+00:00 app[web.1]: npm ERR! Exit status 1 2019-11-16T09:42:28.372329+00:00 app[web.1]: npm ERR! 2019-11-16T09:42:28.372467+00:00 app[web.1]: npm ERR! Failed at the my-app@0.0.1 start script. 2019-11-16T09:42:28.372586+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2019-11-16T09:42:28.379074+00:00 app[web.1]: 2019-11-16T09:42:28.379188+00:00 app[web.1]: npm ERR! A complete log of this run can be found in: 2019-11-16T09:42:28.379282+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-11-16T09_42_28_374Z-debug.log 2019-11-16T09:42:28.457616+00:00 heroku[web.1]: State changed from starting to crashed 2019-11-16T09:42:28.465033+00:00 heroku[web.1]: State changed from crashed to starting 2019-11-16T09:42:28.435312+00:00 heroku[web.1]: Process exited with status 1 2019-11-16T09:42:33.176143+00:00 heroku[web.1]: Starting process with commandnpm start2019-11-16T09:42:36.965410+00:00 app[web.1]: 2019-11-16T09:42:36.965430+00:00 app[web.1]: > my-app@0.0.1 start /app 2019-11-16T09:42:36.965432+00:00 app[web.1]: > node -r esm app.js 2019-11-16T09:42:36.965434+00:00 app[web.1]: 2019-11-16T09:42:37.773272+00:00 app[web.1]: Sat, 16 Nov 2019 09:42:37 GMT morgan deprecated default format: use combined format at node_modules/esm/esm.js:1:278827 2019-11-16T09:42:41.842284+00:00 app[web.1]: { logging: [Function], pool: undefined } 2019-11-16T09:42:41.965673+00:00 app[web.1]: /app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:1 2019-11-16T09:42:41.965678+00:00 app[web.1]: Error: Please install pg package manually 2019-11-16T09:42:41.965681+00:00 app[web.1]: at ConnectionManager._loadDialectModule (/app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:81:15) 2019-11-16T09:42:41.965683+00:00 app[web.1]: at new ConnectionManager (/app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:18:24) 2019-11-16T09:42:41.965686+00:00 app[web.1]: at new PostgresDialect (/app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/dialects/postgres/index.js:14:30) 2019-11-16T09:42:41.965688+00:00 app[web.1]: at new Sequelize (/app/node_modules/atlassian-connect-express/node_modules/sequelize/lib/sequelize.js:322:20) 2019-11-16T09:42:41.965690+00:00 app[web.1]: at new SequelizeAdapter (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:56:33) 2019-11-16T09:42:41.965692+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:187:10) 2019-11-16T09:42:41.965694+00:00 app[web.1]: at Function.stores.create (/app/node_modules/atlassian-connect-express/lib/store/index.js:18:10) 2019-11-16T09:42:41.965696+00:00 app[web.1]: at stores (/app/node_modules/atlassian-connect-express/lib/store/index.js:12:17) 2019-11-16T09:42:41.965698+00:00 app[web.1]: at new Addon (/app/node_modules/atlassian-connect-express/lib/index.js:35:38) 2019-11-16T09:42:41.965700+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/index.js:222:12) 2019-11-16T09:42:41.965702+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:32:15) 2019-11-16T09:42:41.965703+00:00 app[web.1]: at Generator.next (<anonymous>) 2019-11-16T09:42:41.980571+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2019-11-16T09:42:41.981015+00:00 app[web.1]: npm ERR! errno 1 2019-11-16T09:42:41.982304+00:00 app[web.1]: npm ERR! my-app@0.0.1 start:node -r esm app.js2019-11-16T09:42:41.982574+00:00 app[web.1]: npm ERR! Exit status 1 2019-11-16T09:42:41.982856+00:00 app[web.1]: npm ERR! 2019-11-16T09:42:41.983168+00:00 app[web.1]: npm ERR! Failed at the my-app@0.0.1 start script. 2019-11-16T09:42:41.983410+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2019-11-16T09:42:41.993568+00:00 app[web.1]: 2019-11-16T09:42:41.993678+00:00 app[web.1]: npm ERR! A complete log of this run can be found in: 2019-11-16T09:42:41.993768+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-11-16T09_42_41_986Z-debug.log 2019-11-16T09:42:42.064107+00:00 heroku[web.1]: State changed from starting to crashed 2019-11-16T09:42:42.043122+00:00 heroku[web.1]: Process exited with status 1 2019-11-16T09:44:03.456822+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=truesight-backlog.herokuapp.com request_id=c8a9d49a-b11f-4661-9c4a-ceecb0a47a41 fwd="104.192.136.197" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:45:55.532407+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=truesight-backlog.herokuapp.com request_id=24f1b3cc-139f-4c72-b89e-a52645c59e2f fwd="13.236.8.227" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:47:51.987346+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=truesight-backlog.herokuapp.com request_id=3f77d2f6-8b40-4f7e-b138-3fa711abf6ec fwd="121.200.4.221" dyno= connect= service= status=503 bytes= protocol=https 2019-11-16T09:47:52.847750+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=truesight-backlog.herokuapp.com request_id=29f54d13-1923-46ee-beb4-47a98efcfc01 fwd="121.200.4.221" dyno= connect= service= status=503 bytes= protocol=https

Hi,

Looks like error message is missing in your description, please try to run ‘heroku logs —tail’ and restart your app and see full error during start.

Thank you.

@BradQuirkQuirkules
From your error messages, you are missing the pg (postgtres database driver) package. And did you add a Postgres addon to Heroku?

And yes, you need to replace localBaseUrl with your truesight-backlog.herokuapp.com.

For testing, you don’t need to replace the root path / (or index).

Did you ever figure it out? Running into the same issue

Hi @eebalo, I (on a different account) ended up abandoning the Heroku approach in favour of using an AWS EC2 instance. Sorry I can’t be more help!

1 Like

thanks, @quirkules. I was about to try the same thing. thanks for responding

Note that it is perfectly possible to run an ACE app on Heroku - we have been running such an app since 2016 with thousands of customers and more than 1M users…
The key is to look at the node log file (indicated in the Heroku logs) to understand what caused the “crash”. It is also advisable to add a handled for uncaught exceptions (see the node js docs) to avoid such crashes, it at least log the exception details to the Heroku log.

Hi @david2 / @marc,

I have developed an ace connect app and I want to host the app on heroku as that seems the best option for now. But once I run all the commands that are mentioned here (https://bitbucket.org/atlassian/atlassian-connect-express/src/master/) and try to access the host it says “Application Error”. When I check Heroku logs it is not showing any errors. All I can see is that “App Crashed”. I don’t know what is causing this and I’m not sure how to fix this problem.

I cannot think of any other alternative due to costs issues. Please help.

I’m attaching the screenshot of the error that I’m facing below.

TIA.

The most likely is that you have a problem in your code, which throws an Exception that you are not catching and thus not logging. It can also be an exception in a Promise that you are not handling in a catch() handler.
Try running the same locally under a debugger and activate exception breakpoints (handled and unhandled) to see where the exception is.

To chime in with @david2, I have successfully deployed my (2) apps to Heroku and they are running just fine. I believe I used the same instructions that are being posted.

There are some assumptions made by ACE while you’re in Dev mode, so be sure you make all of the necessary updates for your app to run in prod mode (including the necessary modules) and be sure you setup your Heroku DB stuff.

I am opening to helping if anyone is still having issues.

Hi Guys,

Thanks for your response. I’m glad to say I was able to host it on Heroku once I did changes in my config.json file with proper variables for database. :slight_smile:

Also, @LorenzoPhillips what specs on Heroku do you suggest for a cloud addon? I was planning to go ahead with Standard dyno plan and dev postgres db plan. Kindly suggest, this is my first app :slight_smile:

I am working my way up the plan chain. So I started out with the Free tier. Just to make sure things were going to work. Once I added the second app, I started going over my free monthly dynos so I upgraded to the Hobby level ($7/month/app). Once the apps gain more traction, I plan to upgrade to standard where I think they’ll be able to live. My apps are not high performance and are only available to Jira/Confluence Admins so this should work for my needs now. The important thing is to make sure your apps “never sleep”. :slight_smile:

Let me know if you have any other questions. I am new to this as well, but I have everything setup and working properly and can deploy on-demand with updates. :slight_smile:

Hi @LorenzoPhillips,

Thanks for responding. Even my app is available only to Jira admins. I currently have hobby-dev plan set up. I’m not sure if I have to take up standard plan as I’m planning to go live on marketplace. Also, the heroku-postgres database is currently free. What would be the suitable plan if I’m going live on marketplace? Should I go ahead with hobby-dev plan now and upgrade when necessary or straight away deploy with standard plan? :slight_smile:

@PeskyToddler,

It really depends on what your app does, but when I started out I simply used the ACE-Heroku instructions and set it up accordingly. Heroku support told me this was fine. But if you’re still not sure, I would use Heroku’s Guided Price Estimator for assistance.

Things to note, if you think you’ll need more DB horsepower, I’d upgrade it now. I believe the docs stated that it was challenging to upgrade the DB so you’ll want to do that before you get a ton of users to avoid any outages to them. I’m still on the free DB right now as both of my apps are under 10MB in size.

Free dynos means your app will go to sleep if it is not used for a period of time. This may be ok in the beginning, but when you have paying customers, you don’t want them waiting for your app to wake up and launch. So, at the next tier, your app never sleeps and thus, is always available.

But again, I would start with what you have now. Get into the Marketplace and then make sure your app is accessible from Heroku and that you can successfully deploy app updates. Once you start hitting the 80% usage mark on the dynos (you’ll get an email notification), then I’d look into upgrading the dynos or if you don’t want your app to sleep you can upgrade now.

Or if you have the money, you can choose higher tiers out of the gate. But my approach is to move up in plans as my customers/traffic warranted it. There’s no sense in paying hundreds of dollars per month for (3) customers, right? :wink:

Hi @david2

Do we need to Purchase the Heroku For that? Or we can directly use the heroku. Please let me know.
Thanks

You need a paid subscription of heroku.

what changes you made please in config.json i m pretty much in the same boat