Getting "Failed to load resource error" when running private addon

I finally was able to load my private addon to the atlassian marketplace, however in order to install it I had to the authentication type to “none” and to delete the lifecycle part from the descriptor. This is how it looks now:

{
“key”: “ju-qtc”,
“name”: “Jira Utilities for QTC”,
“description”: “Used to implement several utilities specific to requirements at QTC”,
“vendor”: {
“name”: “Condumex”
},
“baseUrl”: “https://www.ehmjuqtc.tk”,
“authentication”: {
“type”: “none”
},
“scopes”: [
“READ”
],
“modules”: {
“webPanels”: [
{
“url”: “/issue-launch-ext-mail-panel?issueKey={issue.key}&baseUrl={hostBaseUrl}”,
“location”: “atl.jira.view.issue.left.context”,
“conditions”: [
{
“condition”: “entity_property_equal_to”,
“params”: {
“entity”: “issuetype”,
“propertyKey”: “showextmailpanelto”,
“objectName”: “typename”,
“value”: “peerreview”
}
}
],
“weight”: 50,
“name”: {
“value”: “Launch External Mail App”
},
“key”: “launch-ext-mail-panel”
}
],
“jiraReports”: [
{
“url”: “/prreport?projectKey={project.key}&baseUrl={hostBaseUrl}”,
“description”: {
“value”: “This report shows metrics about the number of reviews that required re-review, had a problem with the issues found and their resolution as well as how many issues were found and solved in the review”
},
“reportCategory”: “other”,
“thumbnailUrl”: “https://www.ehmjuqtc.tk/img/PeerReviewMetrics.png”,
“name”: {
“value”: “Peer Reviews Report”
},
“key”: “peer-review-report”
}
]
}
}

However when I try to run the report I get this error:

Failed to load resource: the server responded with a status of 404 (Not Found)

This is how the URL of the request looks:

https://www.ehmjuqtc.tk/prreport?projectKey=PRJT1&baseUrl=&xdm_e=https%3A%2F%2Fqtc-jira1.atlassian.net&xdm_c=channel-ju-qtc__peer-review-report&cp=&xdm_deprecated_addon_key_do_not_use=ju-qtc&lic=none&cv=1001.0.0-SNAPSHOT

On my Dev environment it is working, but I am using jwt authentication, this is how the request looks:

https://da7fcd2a61d7.ngrok.io/prreport?projectKey=SBASYS&baseUrl=&xdm_e=https%3A%2F%2Fehm-jiradev1.atlassian.net&xdm_c=channel-ju-qtc__peer-review-report&cp=&xdm_deprecated_addon_key_do_not_use=ju-qtc&lic=none&cv=1001.0.0-SNAPSHOT&jwt=eyJ0eXAiO

You can see the requests are very similar. However I removed jwt authentication and lifecycle from Prod server as I saw that recommendation on this site, doing that I was able to upload the addon from marketplace, however it is not running properly.

Thanks,

Edgar

Hi @EdgarHernandezMeraz,

I assume this is about an app for Jira Cloud, correct? Always make sure to set the correct category for your posts so it’s easier to understand for others what your post is about. :slight_smile:

Is your app frontend only? I.e. can you maybe share more details what you used to develop your app? (e.g. any of the Atlassian connect frameworks for example?) If your app is frontend only it makes sense that you needed set authentication to none, but if your app does have a backend this is not the solution.

Right now it looks like your main problem is that your production server is indeed returning a 404 for https://www.ehmjuqtc.tk/prreport so you should have a look whether your application was deployed correctly.

Cheers,
Sven

Hi Sven,

Sorry, I don´t have much experience with this site to submit questions. I am also new to uploading addons to the marketplace.

Correct, I am doing this for Jira Cloud and I am using the Atlassian Connect Express framework. The addon is working fine on the Dev Jira Cloud server. I am using ngrok on Dev server.

To upload/register the addon to the marketplace I am using a EC2 Linux Red Hat instance with Apache. I was able to register the descriptor file to the marketplace, but getting errors now that I want to install the addon on another Jira Cloud server from the marketplace.

I made changes to the descriptor, changing authentication type to “jwt” and adding /installed to the lifecycle, it looks like this in that part:

“authentication”: {
“type”: “jwt”
},
“lifecycle”: {
“installed”: “/installed”
},

I also modified the index.js file to add the route handler for /installed. The file looks like this:

export default function routes(app, addon) {
// Redirect root path to /atlassian-connect.json,
// which will be served by atlassian-connect-express.
app.get(’/’, (req, res) => {
res.redirect(’/atlassian-connect.json’);
});

// Add additional route handlers here...

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

app.get('/issue-launch-ext-mail-panel', addon.authenticate(), function (req, res) {      	 	
  res.render('issue-launch-ext-mail-panel', {
      issueKey:req.query['issueKey']
    }
  );
});

app.get('/prreport', addon.authenticate(), function (req, res) {      	 		  
  res.render('prreport', {
      projectKey:req.query['projectKey']
    }
  );
});

};

Now, I am getting this error when trying to install the addon:

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

What could be wrong or what I am missing?

Thanks,

Edgar

Thanks for the extra info! The 404 message is correct since https://www.ehmjuqtc.tk/install is indeed returning a 404. It looks like you might not have started your Node application on your server?

Cheers,
Sven

Yes, if i put https://www.ehmjuqtc.tk/install on the browser I get 404 message.

How should I start the Node application?. if I use npm start, that will run ngrok, because I just copied the whole directory that was working from the Dev environment.

Not an ACE user myself but according to the README you want to set the NODE_ENV environment variable to production. Have you tried that?

https://bitbucket.org/atlassian/atlassian-connect-express/src/master/

No, I haven’t because I saw in the config.json file that on production you need to specify some database like progress for storage. Currently my addon does not have to store data, just make JQL queries to get information and show it as report. Maybe I can set the variable, but change the storage type to be memory as it is specified on the “development” section

That is correct. You need to decide if you want to use ACE and therefore have a backend which needs a database or, if you know that your backend is never going to make calls to the Atlassian instance, you can go with a fully static app.

In the case of a static app you indeed want to set the authentication to none and you also don’t need a database. But herr I would strongly suggest ditching your EC2 instance and hosting your static resources in an S3 Bucket or using AWS Amplify instead.

If there is however even only a slight chance that in the future your app might want to store data or will need to call the Jira REST API from the backend then you should go with ACE & database from the start as making the switch later on can be very hard.

Hope this helps!

Cheers,
Sven

Actually, my app is making calls to JIRA REST API to get the information from Jira projects, but I am not storing the information in a DB. I can consider use a DB in the future, but now, I just want to make the test that I am able to register my app to the marketplace and make sure it is working when I install it.