Error when trying to configure a knowledge base in a Service Management project

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

   

Summary

A Knowledge Base space cannot be configured in any Jira Service Management (JSM) project:

  • The following error is thrown when trying to select a space via the other knowledge base menu (not the one from the Project Settings menu:

    We're having trouble communicating with the application. Wait a minute, then try again


  • Either of the 2 errors listed below is thrown when trying to select a space in the knowledge base configuration page of a Service Management project (via the page Project Settings > Knowledge base):
    • Error 1

      There was a problem completing the current request


    • Error 2

      {"status-code":500,"stack-trace":"java.lang.NullPointerException\n\tat 
       
      com.atlassian.confluence.plugins.rest.entities.builders.SpaceEntityBuilder.getSpaceIdFromSpaceDescriptionId(SpaceEntityBuilder.java:98)\n\tat com.atlassian.confluence.plugins.rest.entities.builders.SpaceEntityBuilder.build(SpaceEntityBuilder.java:65)\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.toSearchResultEntity(DefaultRestSearchService.java:270)\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.toSearchResultEntityList(DefaultRestSearchService.java:259)\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.makeSearchResultsEntityList(DefaultRestSearchService.java:219)\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.fullSearch(DefaultRestSearchService.java:214)\n\tat com.atlassian.confluence.plugins.rest.resources.SearchService.doSiteSearch(SearchService.java:133)\n\tat com.atlassian.confluence.plugins.rest.resources.SearchService.doSearch(SearchService.java:104)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:497)\n\tat com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:234)\n\tat com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:100)\n\tat 




Environment

  • Jira Service Management Server/Data Center (any version).
  • With Confluence Server/Data Center (any version), or Confluence Cloud

Cause

The root causes can be split into 2 categories, depending if the issue occurs when using Confluence Server / Data Center, or Confluence Cloud.

Case where Confluence Server (or Data Center) is used as a Knowledge Base

Root Cause 1 - The application link is configured with "Oauth" (without impersonation)

The application link between the Jira and Confluence applications is not configured with "Oauth (Impersonation)". It is configured with "Oauth" (without impersonation).

As per the documentation Guide to link Knowledge Base to Jira Service Desk for unlicensed user, "Oauth (Impersonation)" should be used in the application link configuration. When using Oauth without impersonation, it will not be possible to configure a knowledge base space in any Service Management project, and the error There was a problem completing the current request will be thrown.

(info) The fact that this integration is not working properly when using "Oauth" (without impersonation) in the application link configuration is being tracked as a bug: JSDSERVER-5977 - Getting issue details... STATUS

Root Cause 2 - Username mismatch/permission issue

The user who is trying to configure the knowledge base does not have an account in the Confluence application with the exact same username as in Jira.

As per the documentation Guide to link Knowledge Base to Jira Service Desk for unlicensed user, we need to make sure that users (including Agents and Service Desk Customers) exist in both Jira and Confluence. If the user who is configuring the KB space for the SD project does not exist in Confluence, then this user won't be able to browse for the spaces in Confluence and the error There was a problem completing the current request will be thrown.

(warning) It is important that the username is exactly the same on both Jira and Confluence side for the knowledge base integration to work. If the user has different usernames in both applications, then the error will be thrown.

Root Cause 3 - Reverse proxy configuration issue

There is a reverse proxy misconfiguration either on the Jira or Confluence side.

Root Cause 4 - Confluence index issue

The issue is caused by a corrupted index in Confluence side.

Case where Confluence Cloud is used as a Knowledge Base

Root Cause 5 - Misconfiguration between Jira Server/DC and Confluence Cloud

The integration between Confluence Cloud and Jira Server is not correctly configured, or an incorrect Jira Service Management version is used.

The Knowledge Base integration using Confluence Cloud is only possible in Jira Service Management 4.12.0 and above, therefore if you are using a lower version, this integration won't be possible. Also, as explained in the documentation Set up a knowledge base with Confluence Cloud, applications links should not be configured between Jira Server and Confluence Cloud for this integration. Instead, we should:

  • first integrate Jira Server and Confluence Cloud via the page ⚙ > Applications > Confluence Cloud integration
  • and then configure the knowledge base in the Service Management project settings.

If an application link was created between Jira Server and Confluence Cloud instead of using the new page ⚙ > Applications > Confluence Cloud integration, it will not be possible to configure a knowledge base space in any Service Management project, and the error There was a problem completing the current request will be thrown.

Root Cause 6 - Known bug

The JSM application is impacted by the bug JSDSERVER-12210 - Getting issue details... STATUS which triggers a stackOverflowError due to too many calls made to the HTTPBasicAuthFilter class.

Diagnosis

Root Cause 1

  • In Jira, go to ⚙ > Applications > Application links
    • click on edit next to the Confluence application link
    • if Oauth is being used (instead of "Oauth (impersonation)", then this root cause applies
  • Another evidence showing that this root cause might be relevant is the presence of the error below in the Jira logs:

    2023-01-09 09:25:13,180+0000 http-nio-8080-exec-16 url: /jira/rest/servicedesk/1/servicedesk/<JSM_PROJECT_KEY>/kb/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX/space; user: someuser ERROR someuser 565x91549x1 1lmbgkl XXX.XX.XX.XXX,XX.XX.XX.XX /rest/servicedesk/1/servicedesk/<JSM_PROJECT_KEY>/kb/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX/space [c.a.s.i.api.applink.BaseAppLinkResponseHandler] Applink request has returned an error with status code 401: {"message":"Client must be authenticated to access this resource.","status-code":401}

Root Cause 2

  • Check if the user who is facing the error in Jira exists in Confluence with the exact same username:
    • in Jira, get the username of the user who is trying to configure the knowledge base in the Service Management project and who is getting the error.
    • in Confluence, search for this exact username in ⚙ > General configuration > Users
    • if the username is missing in Confluence, then this root cause applies
  • Another evidence showing that this root cause might be relevant is the presence of the error below in the Jira logs:

    2023-01-09 09:25:13,180+0000 http-nio-8080-exec-16 url: /jira/rest/servicedesk/1/servicedesk/<JSM_PROJECT_KEY>/kb/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX/space; user: someuser ERROR someuser 565x91549x1 1lmbgkl XXX.XX.XX.XXX,XX.XX.XX.XX /rest/servicedesk/1/servicedesk/<JSM_PROJECT_KEY>/kb/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX/space [c.a.s.i.api.applink.BaseAppLinkResponseHandler] Applink request has returned an error with status code 401: {"message":"Client must be authenticated to access this resource.","status-code":401}

Root Cause 3

  • Create an un-proxied application link between Jira and Confluence as per How to create an unproxied application link
  • If the error goes away while setting up the knowledge space, then it is an indication that there is some proxy configuration issue either on the Jira or Confluence side.

Root Cause 4

If the following error is thrown in the Jira UI while configuring the KB article in the Project Settings menu, then this root cause is relevant:

{"status-code":500,"stack-trace":"java.lang.NullPointerException\n\tat 
 
com.atlassian.confluence.plugins.rest.entities.builders.SpaceEntityBuilder.getSpaceIdFromSpaceDescriptionId(SpaceEntityBuilder.java:98)\n\tat com.atlassian.confluence.plugins.rest.entities.builders.SpaceEntityBuilder.build(SpaceEntityBuilder.java:65)\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.toSearchResultEntity(DefaultRestSearchService.java:270)\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.toSearchResultEntityList(DefaultRestSearchService.java:259)\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.makeSearchResultsEntityList(DefaultRestSearchService.java:219)\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.fullSearch(DefaultRestSearchService.java:214)\n\tat com.atlassian.confluence.plugins.rest.resources.SearchService.doSiteSearch(SearchService.java:133)\n\tat com.atlassian.confluence.plugins.rest.resources.SearchService.doSearch(SearchService.java:104)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:497)\n\tat com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:234)\n\tat com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:100)\n\tat  

The same error might be find in the atlassian-jira.log file too:

2019-01-09 17:08:52,447 https-jsse-nio-8443-exec-10 ERROR lsuggs.adm 1028x312218x1 11p9ih7 10.5.101.59 /rest/servicedesk/1/servicedesk/MT/kb/a6675d46-777b-3940-9823-351f893cb7d3/space [c.a.s.i.api.applink.BaseAppLinkResponseHandler] Applink request has returned an error with status code 500: {"status-code":500,"stack-trace":"java.lang.NullPointerException\r\n\tat com.atlassian.confluence.plugins.rest.entities.builders.SpaceEntityBuilder.getSpaceIdFromSpaceDescriptionId(SpaceEntityBuilder.java:89)\r\n\tat com.atlassian.confluence.plugins.rest.entities.builders.SpaceEntityBuilder.build(SpaceEntityBuilder.java:59)\r\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.toSearchResultEntity(DefaultRestSearchService.java:280)\r\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.toSearchResultEntityList(DefaultRestSearchService.java:270)\r\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.makeSearchResultsEntityList(DefaultRestSearchService.java:218)\r\n\tat com.atlassian.confluence.plugins.rest.service.DefaultRestSearchService.fullSearch(DefaultRestSearchService.java:214)\r\n\tat com.atlassian.confluence.plugins.rest.resources.PrototypeSearchService.doSiteSearch(PrototypeSearchService.java:128)\r\n\tat com.atlassian.confluence.plugins.rest.resources.PrototypeSearchService.doSearch(PrototypeSearchService.java:101)\r\n\tat sun.reflect.GeneratedMethodAccessor7645.invoke(Unknown Source)\r\n\tat 


Root Cause 5

  • In the Jira UI:
    • Go to ⚙ > Applications > Application links
    • Check if there is an application link configured with Confluence Cloud
    • If there is one, then go to Project Settings > Knowledge Base in the JSM project and check which Confluence application is selected
    • if the Confluence application that is selected is the same one that is configured in the Application Links page, then Root Cause 5 is relevant
  • Another way to check if this root cause might be relevant is to look for the error below the atlassian-servicedesk.log file. If it is found, this root cause is relevant:

    2023-01-04 15:42:40,134-0500 https-jsse-nio-8443-exec-72 url:/issues/rest/se...f470471b9511/space username:someuser ERROR <SANITIZED_DATA> /rest/servicedesk/1/servicedesk/<PROJECT_KEY>/kb/36788208-a28b-3d05-ae86-f470471b9511/space [internal.api.applink.BaseAppLinkResponseHandler] Applink request has returned an error with status code 403: {"message":"Current user not permitted to use Confluence","statusCode":403}

Root Cause 6

Check the Jira logs in the file atlassian-jira.log file, and look for the following stackOverflowError error which should be triggered when accessing the end point /rest/servicedesk/1/servicedesk/<JSM_PROJECT_KEY>/kb/CONFLUENCE_CLOUD/space:

{code}
2023-01-18 15:04:33,240-0500 https-jsse-nio-8443-exec-1591 url:/issues/rest/se...LUENCE_CLOUD/space username:someuser ERROR <SANITIZED_DATA> /rest/servicedesk/1/servicedesk/<JSM_PROJECT_KEY>/kb/CONFLUENCE_CLOUD/space [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null
java.lang.StackOverflowError
	at com.sun.jersey.core.util.KeyComparatorHashMap.containsKey(KeyComparatorHashMap.java:359)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:102)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
	at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105)
{code}

If this error is found, then Root Cause 6 is relevant.

Solution

Root Cause 1

  • Make sure that Jira and Confluence share the same user base, and then configure the application links using "Oauth (impersonation)" on both Jira and Confluence sides
  • If "Oauth (impersonation)" can't be used because there is a different set of users in Jira and Confluence, then it will be necessary to configure the Confluence application with "Anonymous access" per Setting Up Public Access

Root Cause 2

Make sure that the user who is trying to configure a knowledge base exists in the Confluence user base.

Root Cause 3

Review and fix the Proxy configuration on the Jira (and/or Confluence) side.

Root Cause 4

Rebuild the Search Index in Confluence.

Root Cause 5

Configure the Confluence Cloud instance in ⚙ > Applications > Confluence Cloud integration, as per the documentation Set up a knowledge base with Confluence Cloud:

Root Cause 6

Short Term Workaround:

Re-start the Jira application (or all the Jira nodes).

(warning) Please note that the issue will only be fixed temporarily, and that over time, it will occur again. Therefore it is not a long term workaround.

Long Term Workaround:

Upgrade the JSM application to any of the fixed versions listed in the bug JSDSERVER-12210 - Getting issue details... STATUS




Last modified on Feb 14, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.