The app host returned HTTP response code 403

Hi,

I am getting following error when i install the cloud app, initially it worked after changing the descriptor file then started giving this error even after revert changes and i don’t see any error message on log console.

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

note: I am using ngrok with development mode

Thanks,
Prasad

any help on this? i have blocked with this issue :frowning:

Hi @prasad.rambanam,

Have you tried uninstalling and then re-installing the app from your Cloud instance? There is a credentials.json file which will speed up your development. You enter the details in it as mentioned here and then, you will be able to register, install, run, test and de-register your app using a single command.

Cheers,
Anmol

yes, i have unistalled and reinstalled but error is same, even i have installed on other instance but error is same.

I am developing app with spring boot so can i use credentials.json file?

can you help me to understand on this, I have created new app and added module on descriptor file and installed then it worked without any issues then I have added few more modules to descriptor and then try to install but it is started giving the 403 error on front end, no error on log file.

why it is not allowing to modify the descriptor file? if i modify the descriptor file then do i have to do any configuration changes? I am not understanding this :frowning:

Can you please share your logs?

2019-08-06 11:53:35.030  INFO 3756 --- [  restartedMain] com.acis.itsm.AddonApplication           : Starting AddonApplication on DESKTOP-DF2GLNR with PID 3756 (C:\Users\acis200\Desktop\new_repo\itsm-for-jira-cloud\target\classes started by acis200 in C:\Users\acis200\Desktop\new_repo\itsm-for-jira-cloud)
2019-08-06 11:53:35.034  INFO 3756 --- [  restartedMain] com.acis.itsm.AddonApplication           : No active profile set, falling back to default profiles: default
2019-08-06 11:53:35.108  INFO 3756 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-08-06 11:53:35.109  INFO 3756 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-08-06 11:53:36.193  INFO 3756 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-08-06 11:53:36.274  INFO 3756 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 74ms. Found 1 repository interfaces.
2019-08-06 11:53:36.920  INFO 3756 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$b82e77c0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-08-06 11:53:37.625  INFO 3756 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 9090 (http)
2019-08-06 11:53:37.651  INFO 3756 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-08-06 11:53:37.651  INFO 3756 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.21]
2019-08-06 11:53:37.777  INFO 3756 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-08-06 11:53:37.777  INFO 3756 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2666 ms
2019-08-06 11:53:38.011  INFO 3756 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-08-06 11:53:41.854  INFO 3756 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2019-08-06 11:53:43.303  INFO 3756 --- [  restartedMain] liquibase.executor.jvm.JdbcExecutor      : SELECT COUNT(*) FROM acis_prasad.DATABASECHANGELOGLOCK
2019-08-06 11:53:43.570  INFO 3756 --- [  restartedMain] liquibase.executor.jvm.JdbcExecutor      : SELECT COUNT(*) FROM acis_prasad.DATABASECHANGELOGLOCK
2019-08-06 11:53:43.832  INFO 3756 --- [  restartedMain] liquibase.executor.jvm.JdbcExecutor      : SELECT `LOCKED` FROM acis_prasad.DATABASECHANGELOGLOCK WHERE ID=1
2019-08-06 11:53:44.649  INFO 3756 --- [  restartedMain] l.lockservice.StandardLockService        : Successfully acquired change log lock
2019-08-06 11:53:46.409  INFO 3756 --- [  restartedMain] liquibase.executor.jvm.JdbcExecutor      : SELECT MD5SUM FROM acis_prasad.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL LIMIT 1
2019-08-06 11:53:46.659  INFO 3756 --- [  restartedMain] liquibase.executor.jvm.JdbcExecutor      : SELECT COUNT(*) FROM acis_prasad.DATABASECHANGELOG
2019-08-06 11:53:46.908  INFO 3756 --- [  restartedMain] l.c.StandardChangeLogHistoryService      : Reading from acis_prasad.DATABASECHANGELOG
2019-08-06 11:53:46.910  INFO 3756 --- [  restartedMain] liquibase.executor.jvm.JdbcExecutor      : SELECT * FROM acis_prasad.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
2019-08-06 11:53:48.457  INFO 3756 --- [  restartedMain] l.lockservice.StandardLockService        : Successfully released change log lock
2019-08-06 11:53:49.104  INFO 3756 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
        name: default
        ...]
2019-08-06 11:53:49.197  INFO 3756 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.10.Final}
2019-08-06 11:53:49.200  INFO 3756 --- [  restartedMain] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2019-08-06 11:53:49.426  INFO 3756 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2019-08-06 11:53:50.228  INFO 3756 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2019-08-06 11:53:51.064 DEBUG 3756 --- [  restartedMain] org.hibernate.SQL                        : drop table if exists atlassian_host
2019-08-06 11:53:52.091 DEBUG 3756 --- [  restartedMain] org.hibernate.SQL                        : create table atlassian_host (client_key varchar(255) not null, addon_installed bit not null, base_url varchar(255), created_by varchar(255), created_date datetime, description varchar(255), last_modified_by varchar(255), last_modified_date datetime, oauth_client_id varchar(255), product_type varchar(255), public_key varchar(512), service_entitlement_number varchar(255), shared_secret varchar(255), primary key (client_key)) engine=InnoDB
2019-08-06 11:53:53.106  INFO 3756 --- [  restartedMain] o.h.t.schema.internal.SchemaCreatorImpl  : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@c9c9098'
2019-08-06 11:53:53.111  INFO 3756 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-08-06 11:53:53.877 DEBUG 3756 --- [  restartedMain] c.a.c.s.i.a.jwt.JwtAuthenticationFilter  : Filter 'jwtAuthenticationFilter' configured for use
2019-08-06 11:53:53.914  INFO 3756 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2019-08-06 11:53:54.257 DEBUG 3756 --- [  restartedMain] .s.i.l.LifecycleControllerHandlerMapping : 2 mappings in 'lifecycleControllerHandlerMapping'
2019-08-06 11:53:54.415  INFO 3756 --- [  restartedMain] .s.s.UserDetailsServiceAutoConfiguration :

Using generated security password: 44ea70d1-4743-4fb1-bf9a-643e11cf22d8

2019-08-06 11:53:54.532  INFO 3756 --- [  restartedMain] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@394b7eb0, org.springframework.security.web.context.SecurityContextPersistenceFilter@423721fc, org.springframework.security.web.header.HeaderWriterFilter@6e0197e6, org.springframework.security.web.csrf.CsrfFilter@65cdb1c, org.springframework.security.web.authentication.logout.LogoutFilter@29dadd7a, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@7d36923, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@392bb4e3, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@706f074e, org.springframework.security.web.session.SessionManagementFilter@369af1e4, org.springframework.security.web.access.ExceptionTranslationFilter@3c23c9ab]
2019-08-06 11:53:54.562  INFO 3756 --- [  restartedMain] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@74e1010e, org.springframework.security.web.context.SecurityContextPersistenceFilter@195f8739, org.springframework.security.web.header.HeaderWriterFilter@8d2784e, org.springframework.security.web.authentication.logout.LogoutFilter@7946ae5, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@36e90f37, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6a3a140, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1da8a9d2, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@5ba35681, org.springframework.security.web.session.SessionManagementFilter@48c0ca1, org.springframework.security.web.access.ExceptionTranslationFilter@53e614, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7c1ff2b5]
2019-08-06 11:53:54.690  INFO 3756 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-08-06 11:53:54.756  WARN 3756 --- [  restartedMain] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2019-08-06 11:53:54.939  INFO 3756 --- [  restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2019-08-06 11:53:55.173  INFO 3756 --- [  restartedMain] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2019-08-06 11:53:55.281  WARN 3756 --- [  restartedMain] .AtlassianConnectDevelopmentModeListener : Accepting installations signed by unknown hosts. This setting poses a security risk, and should not be used in production deployments.
2019-08-06 11:53:55.281  WARN 3756 --- [  restartedMain] .AtlassianConnectDevelopmentModeListener : Enabled debug mode for the JavaScript API. This mode leads to reduced performance, and should not be used in production deployments.
2019-08-06 11:53:55.337  INFO 3756 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 9090 (http) with context path ''
2019-08-06 11:53:55.340  INFO 3756 --- [  restartedMain] com.acis.itsm.AddonApplication           : Started AddonApplication in 21.08 seconds (JVM running for 21.555)
2019-08-06 11:56:52.638  INFO 3756 --- [nio-9090-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-08-06 11:56:52.639  INFO 3756 --- [nio-9090-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2019-08-06 11:56:52.647  INFO 3756 --- [nio-9090-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 8 ms
2019-08-06 11:56:52.707 DEBUG 3756 --- [nio-9090-exec-1] c.a.c.s.i.d.RootRedirectController       : Redirecting / to /atlassian-connect.json

my descriptor file:

{
	"key": "app-for-jira-cloud",
	"baseUrl": "https://d943003e.ngrok.io",
	"name": "menu For Jira Cloud (Spring Boot)",
	"authentication": {
		"type": "jwt"
	},
	"lifecycle": {
		"installed": "/installed",
		"uninstalled": "/uninstalled"
	},
	"scopes": [
		"READ",
		"WRITE"
	],
	"apiMigrations": {
		"gdpr": true
	},
	"modules": {
		"webItems": [
			{
				"key": "atlaskit-page-jira",
				"location": "system.top.navigation.bar",
				"name": {
					"value": "Atlaskit"
				},
				"url": "/atlaskit"
			},
			{
				"name": {
					"value": "ACIS"
				},
				"location": "system.top.navigation.bar",
				"url": "/index",
				"key": "acis-menu"
			},
			{
				"name": {
					"value": "Menu 1"
				},
				"url": "/menu-first",
				"key": "acis-menu-1",
				"location": "acis-menu/acis-menu-section",
				"weight": 1
			},
			{
				"name": {
					"value": "Assets Management"
				},
				"url": "/menu-second",
				"key": "acis-menu-2",
				"location": "acis-menu/acis-menu-section",
				"weight": 2
			},
			{
				"name": {
					"value": "Setup Service Management"
				},
				"url": "/menu-third",
				"key": "acis-menu-3",
				"location": "acis-menu/acis-menu-section",
				"weight": 3
			},
			{
				"name": {
					"value": "menu-four"
				},
				"url": "/menu-four",
				"key": "acis-menu-4",
				"location": "acis-menu/acis-menu-section",
				"weight": 4
			}
		],
		"webSections": [
			{
				"name": {
					"value": "Hello"
				},
				"location": "acis-menu",
				"key": "acis-menu-section"
			}
		]
	}
}

@aagrawal2 do you see any issues in my descriptor or log messages ?

@prasad.rambanam I don’t see any issues in your app descriptor, but your app logs seem to be truncated right before the interesting part. Which log lines are produced specifically associated with the installation request?

Do you have an installation record for the given host in the app’s database? If not, do you have the configuration property atlassian.connect.allow-reinstall-missing-host enabled?

Which version of atlassian-connect-spring-boot are you using?

@epehrson that is what i am seeing in the log message, after that i see the descriptor file.

Do you have an installation record for the given host in the app’s database?

no, i don’t see any data in the database

do you have the configuration property atlassian.connect.allow-reinstall-missing-host enabled?

yes

Which version of atlassian-connect-spring-boot are you using?

<atlassian-connect-spring-boot.version>2.0.0-beta-1</atlassian-connect-spring-boot.version>

Can you please make sure you have set logging.level.com.atlassian.connect.spring: DEBUG in your application configuration? You really should be seeing logs for the installation request.

I have already set that logging already :frowning:

@prasad.rambanam, that sounds very strange.

Creating an app using the Maven archetype, and then installing, uninstalling and reinstalling, I get the following logs for the reinstallation:

c.a.c.s.i.a.jwt.JwtAuthenticationFilter  : Retrieved JWT from request
c.a.c.s.i.a.j.JwtAuthenticationProvider  : Parsed JWT: {"sub":"...","qsh":"...","iss":"...","context":{},"exp":1566226019,"iat":1566225119}
c.a.c.s.i.a.j.JwtAuthenticationProvider  : Canonical request for incoming JWT: [CanonicalHttpServletRequest@2ba5a478 method = 'POST', relativePath = '/installed', parameterMap = '[]']
c.a.c.s.i.a.j.JwtAuthenticationProvider  : Verified JWT for host https://example.atlassian.net (...) 
.s.i.l.LifecycleControllerHandlerMapping : Mapped to public org.springframework.http.ResponseEntity<java.lang.Void> com.atlassian.connect.spring.internal.lifecycle.LifecycleController.installed(com.atlassian.connect.spring.internal.lifecycle.LifecycleEvent,com.atlassian.connect.spring.AtlassianHostUser)
c.a.c.s.i.lifecycle.LifecycleController  : Saved installation for host https://example.atlassian.net (...)

If you’re not even getting the first log line (“Retrieved JWT from request”), but you’re seeing other logs, I guess it means the app has never been installed on the particular tenant, and that the host is sending you an unsigned installation request that your app for some reason rejects.

@epehrson yes, it is very strange!

I have created new app and that worked without any issues but I am trying to understand why i am getting this error message and how to fix!