Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Connect test add-on installation problem

Frédéric Tardieu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2015

Hi all, 

I tried to complete a full development cycle for a JIRA connect add-on, taking as a start basis the JIRA Activity tutorial, and installing it on Heroku. All the process went fine, but when I finally try to install it on my On Demand JIRA, I get the following error:

The add-on host did not respond when we tried to contact it at "https://jira-activity-ft.herokuapp.com//installed" during installation (the attempt timed out). Please try again later or contact the add-on vendor.

So I guess a route may be not defined, and I put this in the routes/index.js:

app.get('/installed', addon.authenticate(), function (req, res) {
res..writeHead(200, {'Content-Type': 'text/event-stream'});
});

But then I get this message:

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

Can you please tell me what I'm missing there?

Thank you,

Fred

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Answer accepted
Garry May September 26, 2015

Hi Frédéric,

I feel your pain - I just spent the better part of an evening dealing with the same error!  

In my case the problem was three fold.

  1. I hadn't defined the /installed route, as you pointed out.  In dev mode this is setup for you but in prod we are supposed to code them to ensure the Lifecycle Payload is stored in our database - again I think this is done for us in dev mode.  To get it running setup the route (shown below) and don't worry about the database/saving process.
  2. I then had to provision a database for my heroku app - see postgres provisioning-the-add-on
  3. Then I had to fix-up my package.json to ensure I had dependancies for both jugglingdb and jugglingdb-postgress(shown below)
Route code
app.get('/installed', function (req, res) {
    res.status(200);
});
Package.json
{
  "name": "some-app-id",
  "description": "The description of some-app",
  "version": "0.0.1",
  "engines": {
    "node": "4.1.1",
	"npm": "2.14.4"
  },
  "private": true,
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "atlassian-connect-express": "~1.0.1",
    "express": "~3.3.4",
    "express-hbs": "*",
	"jugglingdb": "0.2.x",
    "jugglingdb-postgres": "latest",
    "jugglingdb-sqlite3": "0.0.5",
    "static-expiry": ">=0.0.5"
  }
}

Have a crack at that - I hope it helps!

Garry

Frédéric Tardieu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2015

Hi Garry, Thank you for sharing, you solved my problem! Actually I was missing 2 points: - the explicit /installed route, and your analysis explains why, - I reached the point and added missing jugglingdb & jugglingdb-postgres, but in my case I put 0.2.1 version instead of 0.2.x for jugglingdb. As a matter of fact, switching to 0.2.x for this dependency made the add-on start normally on Heroku. With 0.2.1, the add-on was failing to start with a "Failed to initialize postgres storage adapter: TypeError: Cannot read property 'tableName' of undefined" message. Again, with 0.2.x version, the adapter starts normally. In the end, I see with PostgreSQL Studio plugin on my application (you should try it, it's nice) that a table named AddonSettings is correctly created in the DB at add-on start on Heroku. And, finally, the add-on can be installed on a Cloud JIRA without problem... So a big thank you to you, I will be able to sleep a little bit more than the past days! Cheers, Fred

Rajagopal R June 14, 2017

Hi,

I am trying to release my JIRA addon in atlassian marketplace. But, before that i have to host addon in online and upload. So, I used heroku and deployed files from github as shown.deployGithubfilesinHeroku.JPG

For HTTP request status I used,

app.get('/installed', function (req, res) {
res.send(200);
res.redirect('/atlassian-connect.json');
});

Now, using this link in upload add-on I get the error message as


"The add-on host did not respond when we tried to contact it at "https://jiraaddon.herokuapp.com/installed" during installation (the attempt timed out). Please try again later or contact the add-on vendor."

 

What is the exact problem in this. How can I solve this issue. Can you please tell me how to recover this problem and upload add-on in JIRA.

Lee Alexis Bermejo March 22, 2018

the route:

app.get('/installed', function (req, res) {
    res.status(200);
});

still timedout for me.

 

i revised it to 

app.get('/installed', function (req, res) { 
res.send(200);
});

 

Also added a POST route as well since JIRA seems to do a POST request instead.


app.post('/installed', function (req, res) {
res.send(200);
});
Like # people like this
2 votes
Travis Smith
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2015

The /installed route is defined automatically by Atlassian Connect Express. Because the URL is showing two forward slashes in the URL, I'm guessing the base URL of your descriptor has an extra slash. Remove that and hopefully your add-on will install correctly. 

Frédéric Tardieu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 15, 2015

Hi Travis, Unfortunately, removing the last / at the end of the base URL does not change the problem: add-on can not be installed still, with the following message: The add-on host did not respond when we tried to contact it at "https://jira-activity-ft.herokuapp.com/installed"; during installation (the attempt timed out). Please try again later or contact the add-on vendor. Here is the atlassian-connect.json file content: { "key": "jira-activity-ft", "name": "JIRA Project Activity", "description": "A Connect add-on that displays JIRA projects in a table", "vendor": { "name": "Atlassian Developer Relations", "url": "https://developer.atlassian.com/"; }, "baseUrl": "https://jira-activity-ft.herokuapp.com";, "links": { "self": "{{localBaseUrl}}/atlassian-connect.json", "homepage": "{{localBaseUrl}}/atlassian-connect.json" }, "authentication": { "type": "jwt" }, "lifecycle": { // atlassian-connect-express expects this route to be configured to manage the installation handshake "installed": "/installed" }, "scopes": [ "READ" ], "modules": { "generalPages": [ { "key": "activity", "location": "system.top.navigation.bar", "name": { "value": "Activity" }, "url": "/activity", "conditions": [{ "condition": "user_is_logged_in" }] } ] } } Here is the routes/index.js file content: odule.exports = function (app, addon) { // Root route. This route will serve the `atlassian-connect.json` unless the // documentation url inside `atlassian-connect.json` is set app.get('/', function (req, res) { res.format({ // If the request content-type is text-html, it will decide which to serve up 'text/html': function () { res.redirect('/atlassian-connect.json'); }, // This logic is here to make sure that the `atlassian-connect.json` is always // served up when requested by the host 'application/json': function () { res.redirect('/atlassian-connect.json'); } }); }); // The following is stub code for a Hello World app provided by ACE. // You can remove this section since it's not used in this tutorial, // or leave it here – it makes no difference to this add-on. // This is an example route that's used by the default "generalPage" module. // Verify that the incoming request is authenticated with Atlassian Connect app.get('/hello-world', addon.authenticate(), function (req, res) { // Rendering a template is easy; the `render()` method takes two params: name of template // and a json object to pass the context in res.render('hello-world', { title: 'Atlassian Connect' //issueId: req.query('issueId') }); } ); // Add any additional route handlers you need for views or REST resources here... app.get('/activity', addon.authenticate(), function(req, res) { res.render('activity', { title: "JIRA activity" }); }); }; Any idea? Thanks a lot, Fred

0 votes
Deniz Oğuz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2015

You should check JIRA server's logs for extra error messages.

Frédéric Tardieu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2015

Point is that when I log in as an administrator to my cloud JIRA, and when I go to the system administration panel, there is no log available: Location of atlassian-jira.log Could not find atlassian-jira.log. But anyway being a new comer on Atlassian Connect, I believe that the problem must be on the plugin side. I don't know for instance if the definition of the "installed" route is correct. Fred

TAGS
AUG Leaders

Atlassian Community Events