Loading Automation and/or Customer notifications in Jira Service Management throws Internal Server Error
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
Recent versions of Jira Service Management ( 2.5 and above ) should no longer be affected by this problem due to fixing the following bug:
Problem
In Service Management, when going to Project settings > Automation/Customer notifications
, the page fails to load and throws an Internal Server Error with 500 HTTP Status Code.
The following appears in the atlassian-jira.log:
2015-06-22 15:48:36,787 http-bio-8435-exec-11 ERROR admin 948x1772x1 1n761vc 192.168.10.10 /rest/servicedesk/automation/1/pages/settings/automation/TST [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: java.lang.NullPointerException: null value
com.atlassian.cache.CacheException: java.lang.NullPointerException: null value
at com.atlassian.cache.memory.DelegatingCache$DelegatingLoadingCache.get(DelegatingCache.java:322)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetManagerImpl.getAllActiveRuleSets(RuleSetManagerImpl.java:153)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetManagerImpl.getActiveRuleSetsByProject(RuleSetManagerImpl.java:137)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetServiceImpl.getActiveRuleSetsByProject(RuleSetServiceImpl.java:144)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetServiceImpl.getActiveRuleSetsByProject(RuleSetServiceImpl.java:152)
at com.atlassian.servicedesk.plugins.automation.internal.rest.AutomationSettingsPageResource.getAutomationPage(AutomationSettingsPageResource.java:99) <+3>
...
2017-02-15 02:01:45,470 http-nio-8730-exec-1 ERROR pau 121x4034x1 1p4e9ou 0:0:0:0:0:0:0:1 /rest/servicedesk/automation/1/pages/settings/automation/PAUS [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null
java.lang.NullPointerException
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleDao.createRule(RuleDao.java:134)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleDao.lambda$getForRuleSetRevisionIds$3(RuleDao.java:118)
...
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleDao.getForRuleSetRevisionIds(RuleDao.java:114)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleSetRevisionDao.getActiveRuleSetRevisions(RuleSetRevisionDao.java:173)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleSetDaoImpl.getActiveRuleSetsMappedByRuleSetId(RuleSetDaoImpl.java:158)
at com.atlassian.vcache.internal.core.DefaultRequestCache.lambda$get$15(DefaultRequestCache.java:43)
at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
at com.atlassian.vcache.internal.core.DefaultRequestCache.get(DefaultRequestCache.java:43)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetManagerImpl.getActiveRuleSetsMappedByRuleSetId(RuleSetManagerImpl.java:155)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetManagerImpl.getActiveRuleSetsByProjectId(RuleSetManagerImpl.java:133)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetManagerImpl.getActiveRuleSetsByProject(RuleSetManagerImpl.java:127)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetServiceImpl.getActiveRuleSetsByProject(RuleSetServiceImpl.java:147)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetServiceImpl.getActiveRuleSetsByProject(RuleSetServiceImpl.java:154)
at com.atlassian.servicedesk.plugins.automation.internal.rest.AutomationSettingsPageResource.getAutomationPage(AutomationSettingsPageResource.java:93)
... 3 filtered
2017-02-15 02:01:20,016 http-nio-8730-exec-11 ERROR pau 121x4032x1 1p4e9ou 0:0:0:0:0:0:0:1 /rest/servicedesk/notifications/1/outgoing-email-settings/11762/rules [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null
java.lang.NullPointerException
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleDao.createRule(RuleDao.java:134)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleDao.lambda$getForRuleSetRevisionIds$3(RuleDao.java:118)
...
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleDao.getForRuleSetRevisionIds(RuleDao.java:114)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleSetRevisionDao.getActiveRuleSetRevisions(RuleSetRevisionDao.java:173)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.dao.querydsl.RuleSetDaoImpl.getActiveRuleSetsMappedByRuleSetId(RuleSetDaoImpl.java:158)
at com.atlassian.vcache.internal.core.DefaultRequestCache.lambda$get$15(DefaultRequestCache.java:43)
at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
at com.atlassian.vcache.internal.core.DefaultRequestCache.get(DefaultRequestCache.java:43)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetManagerImpl.getActiveRuleSetsMappedByRuleSetId(RuleSetManagerImpl.java:155)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetManagerImpl.getActiveRuleSetsByProjectId(RuleSetManagerImpl.java:133)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetManagerImpl.getActiveRuleSetsByProject(RuleSetManagerImpl.java:127)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetServiceImpl.getActiveRuleSetsByProject(RuleSetServiceImpl.java:147)
at com.atlassian.servicedesk.plugins.automation.internal.configuration.ruleset.RuleSetServiceImpl.getActiveRuleSetsByProject(RuleSetServiceImpl.java:154)
... 3 filtered
Cause
There is a NULL value in one or more of the Service Management tables. In this case, according to the above stacktraces, the following Automation tables are most likely affected:
- AO_9B2E3B_RULE
- AO_9B2E3B_RULESET
- AO_9B2E3B_RULESET_REVISION
- AO_9B2E3B_RULE_EXECUTION
The following queries can be run to check these tables:
Select * from "AO_9B2E3B_RULE" where "ID" is null or "ORDINAL" is null or "RULESET_REVISION_ID" is null or "ENABLED" is null;
Select * from "AO_9B2E3B_RULESET" where "ACTIVE_REVISION_ID" is null or "ID" is null;
Select * from "AO_9B2E3B_RULESET_REVISION" where "CREATED_BY" is null or "CREATED_TIMESTAMP_MILLIS" is null or "DESCRIPTION" is null or "ID" is null or "NAME" is null or "RULE_SET_ID" is null or "TRIGGER_FROM_OTHER_RULES" is null or "IS_SYSTEM_RULE_SET" is null;
Select * from "AO_9B2E3B_RULE_EXECUTION" where "EXECUTOR_USER_KEY" is null or "FINISH_TIME_MILLIS" is null or "ID" is null or "OUTCOME" is null or "RULE_ID" is null or "START_TIME_MILLIS" is null;
Apart from the above, the following Automation tables should be checked as well:
- AO_9B2E3B_EXEC_RULE_MSG_ITEM
- AO_9B2E3B_IF_CONDITION_CONFIG
- AO_9B2E3B_IF_COND_CONF_DATA
- AO_9B2E3B_IF_COND_EXECUTION
- AO_9B2E3B_IF_EXECUTION
- AO_9B2E3B_IF_THEN
- AO_9B2E3B_IF_THEN_EXECUTION
- AO_9B2E3B_PROJECT_USER_CONTEXT
- AO_9B2E3B_RSETREV_PROJ_CONTEXT
- AO_9B2E3B_RSETREV_USER_CONTEXT
- AO_9B2E3B_THEN_ACTION_CONFIG
- AO_9B2E3B_THEN_ACT_CONF_DATA
- AO_9B2E3B_THEN_ACT_EXECUTION
- AO_9B2E3B_THEN_EXECUTION
- AO_9B2E3B_WHEN_HANDLER_CONFIG
- AO_9B2E3B_WHEN_HAND_CONF_DATA
The following queries can be run to check these tables:
Select * from "AO_9B2E3B_EXEC_RULE_MSG_ITEM" where "ID" is null or "RULE_EXECUTION_ID" is null or "RULE_MESSAGE_KEY" is null or "RULE_MESSAGE_VALUE" is null;
Select * from "AO_9B2E3B_IF_CONDITION_CONFIG" where "ID" is null or "IF_THEN_ID" is null or "MODULE_KEY" is null or "ORDINAL" is null;
Select * from "AO_9B2E3B_IF_COND_CONF_DATA" where "CONFIG_DATA_KEY" is null or "CONFIG_DATA_VALUE" is null or "ID" is null or "IF_CONDITION_CONFIG_ID" is null;
Select * from "AO_9B2E3B_IF_COND_EXECUTION" where "FINISH_TIME_MILLIS" is null or "ID" is null or "IF_CONDITION_CONFIG_ID" is null or "IF_EXECUTION_ID" is null or "OUTCOME" is null or "START_TIME_MILLIS" is null;
Select * from "AO_9B2E3B_IF_EXECUTION" where "FINISH_TIME_MILLIS" is null or "ID" is null or "IF_THEN_EXECUTION_ID" is null or "OUTCOME" is null or "START_TIME_MILLIS" is null;
Select * from "AO_9B2E3B_IF_THEN" where "ID" is null or "ORDINAL" is null or "RULE_ID" is null;
Select * from "AO_9B2E3B_IF_THEN_EXECUTION" where "FINISH_TIME_MILLIS" is null or "ID" is null or "IF_THEN_ID" is null or "OUTCOME" is null or "RULE_EXECUTION_ID" is null or "START_TIME_MILLIS" is null;
Select * from "AO_9B2E3B_PROJECT_USER_CONTEXT" where "ID" is null or "PROJECT_ID" is null or "STRATEGY" is null or "USER_KEY" is null;
Select * from "AO_9B2E3B_RSETREV_PROJ_CONTEXT" where "ID" is null or "PROJECT_ID" is null or "RULESET_REVISION_ID" is null;
Select * from "AO_9B2E3B_RSETREV_USER_CONTEXT" where "ID" is null or "RULESET_REVISION_ID" is null or "STRATEGY" is null or "USER_KEY" is null;
Select * from "AO_9B2E3B_THEN_ACTION_CONFIG" where "ID" is null or "IF_THEN_ID" is null or "MODULE_KEY" is null or "ORDINAL" is null;
Select * from "AO_9B2E3B_THEN_ACT_CONF_DATA" where "CONFIG_DATA_KEY" is null or "CONFIG_DATA_VALUE" is null or "ID" is null or "THEN_ACTION_CONFIG_ID" is null;
Select * from "AO_9B2E3B_THEN_ACT_EXECUTION" where "FINISH_TIME_MILLIS" is null or "ID" is null or "OUTCOME" is null or "START_TIME_MILLIS" is null or "THEN_ACTION_CONFIG_ID" is null or "THEN_EXECUTION_ID" is null;
Select * from "AO_9B2E3B_THEN_EXECUTION" where "FINISH_TIME_MILLIS" is null or "ID" is null or "IF_THEN_EXECUTION_ID" is null or "OUTCOME" is null or "START_TIME_MILLIS" is null;
Select * from "AO_9B2E3B_WHEN_HANDLER_CONFIG" where "ID" is null or "MODULE_KEY" is null or "ORDINAL" is null or "RULE_ID" is null;
Select * from "AO_9B2E3B_WHEN_HAND_CONF_DATA" where "CONFIG_DATA_KEY" is null or "CONFIG_DATA_VALUE" is null or "ID" is null or "WHEN_HANDLER_CONFIG_ID" is null;
Workarounds
Workaround #1
- Navigate to Administration > Add-ons > Manage add-ons page
- Locate Jira Service Management plugin, then disable and re-enable it
- Verify whether the problem persist. If it is, proceed to Workaround #2
Workaround #2
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
- Identify which table/column has a NULL value
- UPDATE the table/column to have a valid value instead (following the value of other rows in the same table/column - check with Atlassian support if unsure)
- Restart Jira