It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

404 when installing my first cloud addon

Hello,

I have followed instructions for creating my own Addon via  node.js https://bitbucket.org/atlassian/atlassian-connect-express?_ga=2.196421675.604162594.1526506219-323932314.1487801975

 

I am running my node.js server on AWS and I have it configured with SSL (took a few days of configuration).

 

After overcoming SSL errors when trying to add a new add-on, I am now faced with this 404 error:

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

 

How can I obtain better logs than Audit Logs? I'd like to find the root cause. I'm running on a free development instance to get the plugin/add-on working.

 

I have configured config.json and atlassian-connect.json to have the correct URL.

I keep seeing this "/installed" URL needs to have a route, so I added [app.get('/installed')] and [app.post('/installed')] inside routes/index.js

 

Nothing seems to be working. Does anyone have any ideas?

 

Thank you in advance,

Dritan

4 answers

Hi Peter,

Prior to posting here I already did the simple tutorial with ngrok from local machine which generates an HTTPS link for installing to cloud JIRA. But that tutorial was not very useful with static html data that doesn't make use of the very same framework you're advertising for add-ons.

 

None of the links you provided actually explain happening under the hood with atlassian-connect so I can debug the step causing the 404.

Those tutorials/guides could be more useful if they were more technically descriptive. For instance:

- first it takes the localBaseUrl from config.json and propagates it everywhere including atlassian-connect.json

- second, atlassian-connect checks that the routes defined in the json have valid folder paths

- third ... 

 

As you can see, I've already gone through the effort to go beyond local machine relying on 3rd party ngrok, I have set up a public secure server from which this add-on will live. I just need to get through the preliminaries and finally utilize your APIs to create my 'functional requirement' add-on.

 

How can I get more detailed logs as to what is causing the 404? Was this "add-on" component not designed for developers in mind - who are technical - who need verbose logs instead of "something went wrong"? 

 

I'd love to get technical support with this issue.

 

Thank you,

Dritan

Dritan, did you get any response on this issue or have you found any solution? I'm stuck exactly in this situation. My atlassian-connect.json is invisible to the browser and to JIRA (returns 404).

Like Syed_Farhan likes this

Had exactly the same problem just now. On a hunch I decided to have the homepage return an empty HTML as well. Hadn't defined anything for that one, so it was returning a 404 before. After adding an empty HTML page it continues to the next step. Rather important piece of information...

Like Guilherme Schumacher likes this

I too was having this issue.  My solution was to remove the 

addon.authenticate(),

 section of the code.  I'm not sure why the authenticate wasn't working since I had generated an API token etc... but I'll look into that at a later time.  

Like Guilherme Schumacher likes this

Having the same issue. The plugin was working fairly before but now its 404. 

Like # people like this
0 votes

Hi @Dritan Xhabija,

Do you know which url you are calling that gives you a 404?

I would take a look at the Jira Cloud getting started guide: https://developer.atlassian.com/cloud/jira/platform/getting-started/

Or the Confluence Cloud getting started guide: https://developer.atlassian.com/cloud/confluence/getting-started/

Both of those have extra information on how Atlassian Connect Express works.

I would also recommend that you build it on your local machine first and use ngrok to make it available on the internet. That will exclude all AWS related problems.

I also want to invite you into our Developer Community: https://community.developer.atlassian.com. It's a separate community for people who are building apps on top of our products.

Cheers,

Peter

app.get("/atlassian-connect.json", (req, res, next) => { const isHttps = req.secure || req.header("x-forwarded-proto") === "https";
return res.status(200).json({ apiMigrations: { gdpr: true }, name: "Headlines for Jira", description: "This plugin shows the recent updated tickets and branches of all projects a user is working on", key: "headlines-jira", baseUrl: `${isHttps ? "https" : "http"}://${req.get("host")}`, lifecycle: { installed: "/jira/events/install", uninstalled: "/jira/events/uninstall", enabled: "/jira/events/enabled", disabled: "/jira/events/disabled" }, vendor: { name: "Productbox", url: "https://www.productbox.dev" }, authentication: { type: "jwt" }, scopes: ["READ", "ACT_AS_USER"], apiVersion: 1, modules: { generalPages: [ { key: "headlines", location: "system.top.navigation.bar", name: { value: "Headlines" }, url: "/headlines", conditions: [ { condition: "user_is_logged_in" } ] } ] } }); });

Thats what I did and it worked 

My plugin was working before but now I have the same problem. 

My solution was:

  • Remove the addon.authenticate() from the routes.
  • Add the following route handler:
    app.post('//installed', function (req, res) {
         res.send(200);
    };

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you