Install event calling //install and returning 404 error on install

It looks like there’s been a change to the /install event which is causing installation failures.

Instead of calling /install, it’s now calling //install and returning a 404 error.

Does this mean we should change our reference to the install event from /install to install in our atlassian-connect file?

Hi @RhysDiab,

  1. Are you saying we are calling your app’s install end point at {baseUrl}//install instead of {baseUrl}/install?
  2. Is this happening consistently for multiple tenants?
  3. Do you define your {baseUrl} with a trailing ‘/’?

I don’t think there has been any intentional change by Atlassian.

Regards,
Dugald

Hi @dmorrow.

Thanks for the quick response.

  1. That’s correct.

  2. It’s happening both when I run the app locally and in production. When I try to install the app on the marketplace, it won’t install, and the logs indicate it’s calling //installed.

  3. Yes I do. It hasn’t caused a problem up till now. If this is now an issue I can change it.

I saw in another thread there were changes being made to the fields returned from the /installed event, maybe something else was changed accidentally?

Let me know what you think the best way forward is.

Regards,
Rhys

Thanks @RhysDiab,
There were no code changes associated with the other thread. The engineers who maintain the installation code are not aware of any changes. We will continue looking into this.
Regards,
Dugald

Hi @RhysDiab,
After further investigation we still have not found any changes on our part. Is there a chance there could have been a change at your end? Maybe something subtle like a server config change causing less lenient URL parsing? Of course, you could test the removal of the trailing slash on your app descriptor’s baseUrl, but be aware of all its dependencies and that this will require a change in the Marketplace listing which takes hours to roll out to all tenants.
Regards,
Dugald

Thanks for looking into this @dmorrow.

It may well be from a change on my end. I did a deploy yesterday, but everything was working all yesterday after the deploy, including a number of new trials where the correct URL was called (’/installed’). But yes, completely possible I’ve goofed up somewhere.

I think I’ll change the install url from ‘/installed’ to ‘installed’ as this seems to fix the issue and only causes a minor update.

Thanks again, I really appreciate you looking into the issue.

UPDATE: Just checked. This issue is also occurring on older branches before my last release.

Regards,
Rhys

Thanks for the update now. We’ll close our side of the investigation for now.
Regards,
Dugald

I’m seeing the same issue as @RhysDiab. Everything was working fine when I shut down yesterday evening, but the app wouldn’t register at all this morning. I did some digging and came to the same conclusion – the marketplace is calling //installed instead of /installed.

I was able to repeat this by creating a new app with atlas-connect and following the basic instructions to get the dev loop running. Removing the slash from the atlassian-connect file gets around the problem, but that’s not documented anywhere.

I don’t know what changed, but that extra slash is causing problems.

Same problem started happening for me today too, with no any chances.

Also got this issue. Even my apps that I haven’t touched for months (but were still working at the time) are still registering this //installed 404 error.

Something’s definitely been changed in the registration process.

We also got this issue for all the projects. And we also didn’t touch them for month. Actually, I saw //installed issue a long time ago(when you’re running project locally), but that wasn’t an issue. Everything worked fine.

1 Like

Same here. Yesterday I just returned from 2 weeks holiday and nothing was released in the meantime. This is serious!

[EDIT] I confirm that one of our apps - Issue Templates for Jira Cloud can’t be installed since Feb 14 09:48:12 UTC.

It is built using ACE - “atlassian-connect-express”: “^4.0.1”

 "baseUrl": "{{localBaseUrl}}",
 "lifecycle": {
    "enabled": "/enabled",
    "installed": "/installed",
    "uninstalled": "/protected/uninstalled"
  },

What is very strange is that, the other app we have, which uses the exact format for installed hook works fine…:exploding_head:

[SOLUTION]
I have found a difference between two apps. In Issue Templates in config.json:

"localBaseUrl": "https://mydomain.herokuapp.com/",

I had an additional slash at the end of the url.
This worked fine before, but I guess that Atlassian did some cleaning of their code lately and it broke that.

I have just released the fix and can confirm it fixes the issue.

2 Likes

I’d like to extend the previous solution with changes that should fix your development environment with ngrok.

[SOLUTION FOR DEV ENV]

  1. Go to node_modules/atlassian-connect-express/lib/internal/registration/register-jira-conf.js

  2. Find createTunnel() function.

  3. There, please, find (I believe line 28 of the file):
    process.env.AC_LOCAL_BASE_URL = lbu.toString()

  4. Replace this row with:
    process.env.AC_LOCAL_BASE_URL = lbu.toString().replace(/\/+$/, '');

  5. Try to run your app.

The issue happens here:

var ltu = new URI(url);
// new URI() gets the correct URL without trailing slash in the end and returns URL with the trailing slash in the end.

Hope this will be helpful for someone.

[EDIT] Markup fix.

3 Likes

The engineering team have done some investigation which shows recent changes to the Atlassian Connect Spring Boot framework have resulted in it not handling the double forward slashes. The team are making changes to Atlassian Connect to ensure it doesn’t build URLs with double forward slashes.

2 Likes

Is this related to the ongoing incident: https://developer.status.atlassian.com/incidents/3gjx4dmlx7qv

It’s interesting. Although the incident says it has been fixed (https://clb.sh/509850), I’m still getting the same error in my development environment.

I guess I will need to modify the register-jira-conf.js file as suggested in previous posts.

Thanks for sharing that @piskunovigorm!

No, it was something else, problem with double slash still exists and I don’t think Atlassian is going to fix that. I believe it happened on Atlassian side (UPM module?), which started to call apps backends with double slashes if a baseUrl in your atlassian-connect.json contains / at the end of the url. It broke both apps based on ACE and based on connect-spring-boot