com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: Generic Entity Exception occurred in deleteByAnd (SQL Exception while executing the following:DELETE FROM configurationcontext WHERE FIELDCONFIGSCHEME=? (Deletion from CONFIGURATIONCONTEXT is forbidden!!!))

Atlassian JIRA | Svetlin Zarev | 9 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Our jira suffers from a bug that resets the issue type schemes of a lot of projects to the default one. After consulting with the support (https://support.atlassian.com/servicedesk/customer/portal/22/JSP-268659) i was able to find out the root cause: a dangerous DELETE.. WHERE ... statement: {code} com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: Generic Entity Exception occurred in deleteByAnd (SQL Exception while executing the following:DELETE FROM configurationcontext WHERE FIELDCONFIGSCHEME=? (Deletion from CONFIGURATIONCONTEXT is forbidden!!!)) com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: Generic Entity Exception occurred in deleteByAnd (SQL Exception while executing the following:DELETE FROM configurationcontext WHERE FIELDCONFIGSCHEME=? (Deletion from CONFIGURATIONCONTEXT is forbidden!!!)) at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.removeByAnd(DefaultOfBizDelegator.java:305) at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.removeByAnd(WrappingOfBizDelegator.java:157) at com.atlassian.jira.issue.context.persistence.FieldConfigContextPersisterImpl.removeContextsForConfigScheme(FieldConfigContextPersisterImpl.java:89) at com.atlassian.jira.issue.context.persistence.CachingFieldConfigContextPersister.removeContextsForConfigScheme(CachingFieldConfigContextPersister.java:122) at com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManagerImpl.updateFieldConfigScheme(FieldConfigSchemeManagerImpl.java:242) at com.atlassian.jira.web.action.admin.issuetypes.pro.AssociateIssueTypeSchemes.run(AssociateIssueTypeSchemes.java:134) at com.atlassian.jira.web.action.admin.issuetypes.pro.AssociateIssueTypeSchemes.doExecute(AssociateIssueTypeSchemes.java:110) at com.atlassian.jira.web.action.admin.issuetypes.pro.SelectIssueTypeSchemeForProject.doExecute(SelectIssueTypeSchemeForProject.java:204) at webwork.action.ActionSupport.execute(ActionSupport.java:165) .... {code} Please note the WHERE clause - it will deleted all issue type associations that share the same issue type scheme. The "..forbidden.." message is from the trigger I created in order to debug the issue: {code} create trigger CONF_CONTEXT_GUARDIAN on CONFIGURATIONCONTEXT for delete as begin rollback transaction raiserror 17000 'Deletion from CONFIGURATIONCONTEXT is forbidden!!!' end {code}

    Atlassian JIRA | 9 months ago | Svetlin Zarev
    com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: Generic Entity Exception occurred in deleteByAnd (SQL Exception while executing the following:DELETE FROM configurationcontext WHERE FIELDCONFIGSCHEME=? (Deletion from CONFIGURATIONCONTEXT is forbidden!!!))

    Root Cause Analysis

    1. com.atlassian.jira.exception.DataAccessException

      org.ofbiz.core.entity.GenericDataSourceException: Generic Entity Exception occurred in deleteByAnd (SQL Exception while executing the following:DELETE FROM configurationcontext WHERE FIELDCONFIGSCHEME=? (Deletion from CONFIGURATIONCONTEXT is forbidden!!!))

      at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.removeByAnd()
    2. com.atlassian.jira
      SelectIssueTypeSchemeForProject.doExecute
      1. com.atlassian.jira.ofbiz.DefaultOfBizDelegator.removeByAnd(DefaultOfBizDelegator.java:305)
      2. com.atlassian.jira.ofbiz.WrappingOfBizDelegator.removeByAnd(WrappingOfBizDelegator.java:157)
      3. com.atlassian.jira.issue.context.persistence.FieldConfigContextPersisterImpl.removeContextsForConfigScheme(FieldConfigContextPersisterImpl.java:89)
      4. com.atlassian.jira.issue.context.persistence.CachingFieldConfigContextPersister.removeContextsForConfigScheme(CachingFieldConfigContextPersister.java:122)
      5. com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManagerImpl.updateFieldConfigScheme(FieldConfigSchemeManagerImpl.java:242)
      6. com.atlassian.jira.web.action.admin.issuetypes.pro.AssociateIssueTypeSchemes.run(AssociateIssueTypeSchemes.java:134)
      7. com.atlassian.jira.web.action.admin.issuetypes.pro.AssociateIssueTypeSchemes.doExecute(AssociateIssueTypeSchemes.java:110)
      8. com.atlassian.jira.web.action.admin.issuetypes.pro.SelectIssueTypeSchemeForProject.doExecute(SelectIssueTypeSchemeForProject.java:204)
      8 frames
    3. webwork.action
      ActionSupport.execute
      1. webwork.action.ActionSupport.execute(ActionSupport.java:165)
      1 frame