Unknown error or NullPointerException when creating a project in Jira server

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

Problem

When trying to create a new Service Management project in Jira, the process fails and the application throws the following error message on the UI - "Hmm... we couldn't create your project due to an unknown error. Try refreshing the page to start again.".

Diagnosis

Along with the error message from the UI, you'll also see one of the below in the atlassian-jira.log.

Symptom 1:

 /rest/project-templates/1.0/templates [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: An error occurred while notifying that a project was created
java.lang.RuntimeException: An error occurred while notifying that a project was created
	at com.atlassian.jira.bc.project.DefaultProjectService.notifyHandlersOfProjectCreated(DefaultProjectService.java:396)
	at com.atlassian.jira.bc.project.DefaultProjectService.createProjectInternal(DefaultProjectService.java:378)
	at com.atlassian.jira.bc.project.DefaultProjectService.createProject(DefaultProjectService.java:348)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 
/rest/project-templates/1.0/templates [c.a.jira.project.ProjectCreateRegistrarImpl] The handler with id com.atlassian.greenhopper.project.PermissionSchemeProjectCreateHandlerImpl.ProjectCreateHandler threw an exception while handling a notification about a project being created
java.lang.NullPointerException
	at com.atlassian.jira.permission.DefaultPermissionSchemeService.updateSchemeToReturnUsername(DefaultPermissionSchemeService.java:436)
	at com.atlassian.jira.permission.DefaultPermissionSchemeService.access$2200(DefaultPermissionSchemeService.java:58)
	at com.atlassian.jira.permission.DefaultPermissionSchemeService$13.apply(DefaultPermissionSchemeService.java:331)

Symptom 2:

2018-10-24 11:40:40,037 http-nio-8080-exec-21 ERROR admin 700x542x2 cbw5kl 0:0:0:0:0:0:0:1 /rest/project-templates/1.0/templates [c.a.jira.project.ProjectCreateRegistrarImpl] The handler with id com.atlassian.jira.project-templates-plugin:apply-project-template-handler threw an exception while handling a notification about a project being created
java.lang.NullPointerException
	at net.oauth.signature.OAuthSignatureMethod.normalizeUrl(OAuthSignatureMethod.java:161)
	at net.oauth.signature.OAuthSignatureMethod.getBaseString(OAuthSignatureMethod.java:155)
	at net.oauth.signature.OAuthSignatureMethod.getSignature(OAuthSignatureMethod.java:81)
	at net.oauth.signature.OAuthSignatureMethod.sign(OAuthSignatureMethod.java:53)
	at net.oauth.OAuthMessage.sign(OAuthMessage.java:296)
	at net.oauth.OAuthMessage.addRequiredParameters(OAuthMessage.java:286)
	at net.oauth.OAuthAccessor.newRequestMessage(OAuthAccessor.java:91)
	at net.oauth.OAuthAccessor.newRequestMessage(OAuthAccessor.java:97)
	at com.atlassian.oauth.consumer.core.ConsumerServiceImpl.sign(ConsumerServiceImpl.java:164)
	at com.atlassian.oauth.consumer.core.ConsumerServiceImpl.sign(ConsumerServiceImpl.java:140)
	at com.atlassian.oauth.consumer.core.ConsumerServiceImpl.sign(ConsumerServiceImpl.java:115)
	... 3 filtered

2022-03-22 16:35:36,659+0000 http-nio-8080-exec-1 ERROR admin 995x207x1 xr1tav 0:0:0:0:0:0:0:1 /rest/project-templates/1.0/templates [c.a.jira.project.ProjectCreateRegistrarImpl] The handler with id com.atlassian.jira.project-templates-plugin:apply-project-template-handler threw an exception while handling a notification about a project being created
java.lang.RuntimeException: Failed to deserialise stored rpc.url URI (https://) reason: Expected authority
	at com.atlassian.applinks.core.property.ApplicationLinkProperties.getUri(ApplicationLinkProperties.java:373)
	at com.atlassian.applinks.core.property.ApplicationLinkProperties.getRpcUrl(ApplicationLinkProperties.java:169)
	at com.atlassian.applinks.core.link.DefaultApplicationLink.getRpcUrl(DefaultApplicationLink.java:87)
	at com.atlassian.applinks.core.auth.ApplicationLinkRequestFactoryFactoryImpl$AbsoluteURLRequestFactory.createRequest(ApplicationLinkRequestFactoryFactoryImpl.java:174)
	at com.atlassian.servicedesk.internal.feature.applink.ServiceDeskAppLinkManagerImpl.buildGetRequest(ServiceDeskAppLinkManagerImpl.java:216)
	at com.atlassian.servicedesk.internal.feature.applink.ServiceDeskAppLinkManagerImpl.lambda$makeGetRequest$3(ServiceDeskAppLinkManagerImpl.java:102)

Cause

For symptom 1:

Jira encountered a Null Pointer Exception on the permission scheme, where it expected to find a reference to the permission scheme.
This can be confirmed with the SQL query:

select * from schemepermissions where perm_type = 'user' and (perm_parameter in (select user_key from app_user where lower_user_name not in (select lower_user_name from cwd_user)) or perm_parameter not in (select user_key from app_user));
  • Related bug:  JRA-59781 - Getting issue details... STATUS

For symptom 2:

While setting up the new project details, Jira tries to validate the data for an existing application link with Confluence, and if that process fails, the creation of the project fails as well.
This can happen due to a corruption of the Application Link between Jira and Confluence, however, it may not be possible to ascertain what caused the corruption to begin with (could be caused by directly manipulating data on the database, migration/restore processes, etc).

(info) Note that in some cases the application link may not even show up in the UI, in those cases, an easy way to confirm whether a corrupted link exists would be to generate a support zip, and search for '<application-links>' in the '<Support_Zip>/application-properties/application.xml' file.


Resolution

For symptom 1:

  1. Execute the below SQL to identify problematic records:

    select * from schemepermissions where perm_type = 'user' and (perm_parameter in (select user_key from app_user where lower_user_name not in (select lower_user_name from cwd_user)) or perm_parameter not in (select user_key from app_user));
  2. Stop Jira
  3. Back up the Jira database using the native DB tools.
  4. Remove the problematic records from the schemepermissions table
  5. Start Jira.
  6. Test by editing the scheme.

If there are groups or users that do not exist in the Jira instance, proceed to add them manually in Jira UI.

For symptom 2:

The best way to correct the problem caused by the link corruption is to remove the existing application link, and then re-create it if necessary.
In cases where the application link cannot be found on the UI, you may refer to the steps from Remove an application link from Jira server using SQL to remove the existing link.

(info) Removing an application link is a non-destructive process, which means that no existing information is lost. Upon re-creating the link everything should be working as before.


Last modified on Mar 30, 2022

Was this helpful?

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