During a workflow scheme migration we got error messages for two of the issues. The root cause is:
ERROR: duplicate key value violates unique constraint "pk_os_historystep")
Now the issues cannot be closed. A similar error occurs:
Could not move to history step for #17061: root cause: while inserting: [GenericEntity:OSHistoryStep][id,10001][caller,myuser][startDate,2010-05-17 20:44:50.207][status,Not Done][owner,][finishDate,2011-12-21 14:19:25.9][actionId,231][stepId,1][dueDate,null][entryId,17061] (SQL Exception while executing the following:INSERT INTO public.OS_HISTORYSTEP (ID, ENTRY_ID, STEP_ID, ACTION_ID, OWNER, START_DATE, DUE_DATE, FINISH_DATE, STATUS, CALLER) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_os_historystep"))
The database driver is PostgreSQL 8.4 JDBC4 managed by pgpool. Full trace during migration:
2011-12-21 10:17:42,007 JiraTaskExectionThread-17 ERROR myuser 617x43760x1 145jeni 10.10.0.249,192.168.1.3 /secure/project/SelectProjectWorkflowSchemeStep2.jspa [workflow.migration.enterprise.EnterpriseWorkflowMigrationHelper] Error occurred while migrating issue to a new workflow for project '...'. com.atlassian.jira.workflow.WorkflowException: com.opensymphony.workflow.StoreException: Could not move to history step for #17061: root cause: while inserting: [GenericEntity:OSHistoryStep][id,10001][caller,null][startDate,2010-05-17 20:44:50.207][status,open][owner,][actionId,0][stepId,1][dueDate,null][entryId,17061] (SQL Exception while executing the following:INSERT INTO public.OS_HISTORYSTEP (ID, ENTRY_ID, STEP_ID, ACTION_ID, OWNER, START_DATE, DUE_DATE, FINISH_DATE, STATUS, CALLER) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_os_historystep")) at com.atlassian.jira.workflow.OSWorkflowManager.migrateIssueToWorkflow(OSWorkflowManager.java:498) at com.atlassian.jira.workflow.migration.enterprise.EnterpriseWorkflowMigrationHelper.migrateIssues(EnterpriseWorkflowMigrationHelper.java:455) at com.atlassian.jira.workflow.migration.enterprise.EnterpriseWorkflowMigrationHelper.migrate(EnterpriseWorkflowMigrationHelper.java:358) at com.atlassian.jira.workflow.migration.WorkflowAsynchMigrator.call(WorkflowAsynchMigrator.java:33) at com.atlassian.jira.workflow.migration.WorkflowAsynchMigrator.call(WorkflowAsynchMigrator.java:18) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:359) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at com.atlassian.multitenant.impl.DefaultMultiTenantManager.runForTenant(DefaultMultiTenantManager.java:61) at com.atlassian.multitenant.juc.MultiTenantExecutors$WrappedRunnable.run(MultiTenantExecutors.java:160) at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:249) at java.lang.Thread.run(Thread.java:662) Caused by: com.opensymphony.workflow.StoreException: Could not move to history step for #17061: root cause: while inserting: [GenericEntity:OSHistoryStep][id,10001][caller,null][startDate,2010-05-17 20:44:50.207][status,open][owner,][actionId,0][stepId,1][dueDate,null][entryId,17061] (SQL Exception while executing the following:INSERT INTO public.OS_HISTORYSTEP (ID, ENTRY_ID, STEP_ID, ACTION_ID, OWNER, START_DATE, DUE_DATE, FINISH_DATE, STATUS, CALLER) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_os_historystep")) at com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore.moveToHistory(OfbizWorkflowStore.java:289) at com.atlassian.jira.workflow.OSWorkflowManager.migrateIssueToWorkflow(OSWorkflowManager.java:480) ... 14 more Caused by: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:OSHistoryStep][id,10001][caller,null][startDate,2010-05-17 20:44:50.207][status,open][owner,][actionId,0][stepId,1][dueDate,null][entryId,17061] (SQL Exception while executing the following:INSERT INTO public.OS_HISTORYSTEP (ID, ENTRY_ID, STEP_ID, ACTION_ID, OWNER, START_DATE, DUE_DATE, FINISH_DATE, STATUS, CALLER) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_os_historystep")) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:156) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:121) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:63) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:489) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:461) at com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore.moveToHistory(OfbizWorkflowStore.java:273) ... 15 more
Any ideas how to cope with that problem? Is it possible to increase some sequence or so?
We resolved the problem by cloning and deleting the problematic issues.
Hello, did you find some solution for this case ? I can't close some issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
did you find permanent solution for this case ?
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I need to keep all command and history log of the problematic issue, how should I do to clone this issue completely?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When cloning an Issue you have an option to clone all attachments. Unfortunately comments are not cloned. Maybe this plugin provides a solution: https://marketplace.atlassian.com/plugins/com.atlassian.cpji.cpji-jira-plugin
If this doesn't solve your problem please open a new question to reach more people than just me :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The cause seems to be a database inconsistency that can be discovered by running the following query (if there are no results there is no inconsistency of this type):
select id from os_currentstep intersect select id from os_historystep;
Atlassian Support is still investigating for a solution to remove this inconsistency.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.