Reinstall of atlassian connect app for jira failing

Hi ,

I have developed jira app using atlassian-connect-spring-boot . In my test jira account i.e https://itsngage.atlassian.net . I uninstalled the app and removed the entry of host from attlasian_host table in dynamo db. Now when I am trying to reinstall app I am getting below error. Please help in solving this issue

May 9 08:39:34 ip-172-31-8-172 web: 2022-05-09 08:39:34.740 WARN 2096 — [nio-5000-exec-1] c.a.c.s.i.a.jwt.JwtAuthenticationFilter : Failed to authenticate request
May 9 08:39:34 ip-172-31-8-172 web: com.atlassian.connect.spring.internal.auth.jwt.UnknownJwtIssuerException: Could not find an installed host for the provided client key: 93a8756d-fc2e-38e7-af8d-ebeedba1a803
May 9 08:39:34 ip-172-31-8-172 web: at com.atlassian.connect.spring.internal.auth.AbstractConnectAuthenticationProvider.lambda$getHost$0(AbstractConnectAuthenticationProvider.java:93) ~[atlassian-connect-spring-boot-core-2.2.3.jar!/:na]

@Angage360 I take it you have atlassian.connect.allow-reinstall-missing-host disabled.

From the repository README :

Configuration

You can use a Spring properties file to configure the behaviour of your application. If you define properties in your properties file, they will override the default values set by atlassian-connect-spring-boot .

  • atlassian.connect.allow-reinstall-missing-host
    Atlassian hosts will sign all but the first installation request. If your add-on loses the host details during development, this flag enables installations to be accepted by your add-on.

Making your add-on production ready

Some of the default configuration for atlassian-connect-spring-boot is only safe in a development environment - you should enable a Spring profile called production if deploying to a production environment. There are a number of ways to set the active profiles of a Spring Boot application. For example, if launching your application using the Spring Boot Maven plugin:

mvn spring-boot:run -Drun.profiles=production

Thanks for answer. I tried setting atlassian.connect.allow-reinstall-missing-host: true in application.yml and re deployed the app. However it didn’t worked. Do I need to re publish the app after making this change?

@Angage360 you should not need to publish your app descriptor again.

it didn’t worked still get the same error

ay 9 13:40:00 ip-172-31-8-172 web: 2022-05-09 13:40:00.430 DEBUG 5454 — [nio-5000-exec-7] .a.AbstractConnectAuthenticationProvider : Parsed JWT: {“aud”:“https://api.angage360.com/jira”,“sub”:“61821030860f78006ba649d3”,“qsh”:“4a2e1de8ca74e6cafe8862d332fa3ac7a8e51e692bc6d798ea4dfedc14948bf4”,“iss”:“93a8756d-fc2e-38e7-af8d-ebeedba1a803”,“context”:{},“exp”:1652104500,“iat”:1652103600}
May 9 13:40:00 ip-172-31-8-172 web: 2022-05-09 13:40:00.444 DEBUG 5454 — [nio-5000-exec-7] .a.AbstractConnectAuthenticationProvider : Could not find an installed host for the provided client key: 93a8756d-fc2e-38e7-af8d-ebeedba1a803
May 9 13:40:00 ip-172-31-8-172 web: 2022-05-09 13:40:00.447 WARN 5454 — [nio-5000-exec-7] c.a.c.s.i.a.jwt.JwtAuthenticationFilter : Failed to authenticate request
May 9 13:40:00 ip-172-31-8-172 web: com.atlassian.connect.spring.internal.auth.jwt.UnknownJwtIssuerException: Could not find an installed host for the provided client key: 93a8756d-fc2e-38e7-af8d-ebeedba1a803

Please let me know if there is any alternative. This is affecting our client who is not able to re-install the app.

@epehrson any other suggestions which can help me to solve this.

Hi @Angage360,

This is a WARN message. Is it actually stopping your app from connecting to your site and doing anything? Or is it just a once off when you install it the first time?

Regards,
James.

@jrichards its stopping app installation. In jira I get error message as below.

Jira Cloud Message
We ran into a little trouble

It might just be a hiccup. Try again in a bit.

Try again

ERROR
May 10 07:39:46 ip-172-31-8-172 web: 2022-05-10 07:39:46.313 ERROR 9243 — [nio-5000-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] threw exception
May 10 07:39:46 ip-172-31-8-172 web: 2022-05-10 07:39:46.314 ERROR 9243 — [nio-5000-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: Collection is empty] with root cause
May 10 07:39:46 ip-172-31-8-172 web: 2022-05-10 07:39:46.316 ERROR 9243 — [nio-5000-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] threw exception
May 10 07:39:46 ip-172-31-8-172 web: 2022-05-10 07:39:46.322 ERROR 9243 — [nio-5000-exec-2] o.a.c.c.C.[Tomcat].[localhost] : Exception Processing ErrorPage[errorCode=0, location=/error]

Can one of you try reproducing it on your end?

Can it be because of below block in atlassian-connect.json https://marketplace-cdn.atlassian.com/files/1.3.20-AC/b6346ff8-cd66-4d49-990a-794e15dcc0b7 ?

“apiMigrations”: {
“signed-install”: false
},

Actually the issue is coming in new app installation

Can someone please help here

Hi @Angage360,

This is a community driven group with some Atlassian engineers included here trying to help. We aren’t on here 24/7 and aren’t able to provide updates at the speed you might be expecting.

The entry

“apiMigrations”: {
“signed-install”: false
}

is documented in Connect API migration and so you should be fine with that, although I don’t recommend it. As your using Atlassian Connect Spring Boot, setting it to true will work.

Without seeing your code, it’s hard to tell what’s happening.

Do you have a basic simple example that works? You can start with the documentation in Bitbucket

Regards,
James.