Error "We can't create this issue for you right now..." | Duplicated INSERT to OS_WFENTRY

Karol Siedlaczek January 14, 2022

Hi, I've recently upgraded my Jira Server from 8.13.3 LTS to 8.20.2 LTS. Besides that I've also changed database from PostgreSQL 10 to PostgreSQL 13.

Of course I know that is unsupported version, but it depended on many other factos and back to older version is the last resort (if that is the reason of my problems)


Error pops up when creating a issue, entire messege in GUI sounds like this:
"We can't create this issue for you right now, it could be due to unsupported content you've entered into on ore more of the issue field. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file"


I've checked logs (atlassian-jira-sql.log) and usually when this error pops up the following situation happens:

2022-01-14 16:59:23,777+0100 http-nio-8080-exec-24 karol.siedlaczek 1019x604319x1 128lwzv /secure/QuickCreateIssue.jspa 2ms "INSERT INTO public.OS_WFENTRY (ID, NAME, INITIALIZED, STATE) VALUES ('183644', 'SUP: Service Request workflow', 'null', '0')"
2022-01-14 16:59:23,778+0100 http-nio-8080-exec-24 karol.siedlaczek 1019x604319x1 128lwzv /secure/QuickCreateIssue.jspa 1ms "SELECT NAME, INITIALIZED, STATE FROM public.OS_WFENTRY WHERE ID='183644'"
2022-01-14 16:59:23,780+0100 http-nio-8080-exec-24 karol.siedlaczek 1019x604319x1 128lwzv /secure/QuickCreateIssue.jspa 2ms "INSERT INTO public.OS_WFENTRY (ID, NAME, INITIALIZED, STATE) VALUES ('183644', 'SUP: Service Request workflow', 'null', '0')"
org.postgresql.util.PSQLException:
    ERROR: duplicate key value violates unique constraint "pk_os_wfentry" Detail: Key (id)=(183644) already exists.

So as you can see INSERT command to os_wfentry table is duplicated and this is a reason of error because it refers to the same id 


This is error from atlassian-jira.log:

2022-01-14 16:59:23,996+0100 http-nio-8080-exec-24 ERROR karol.siedlaczek 1019x604319x1 128lwzv 10.255.4.222,0:0:0:0:0:0:0:1 /secure/QuickCreateIssue.jspa [c.a.j.bc.issue.DefaultIssueService] Error creating issue:
com.atlassian.jira.exception.CreateException: Could not create workflow instance: root cause: while inserting: [GenericEntity:OSWorkflowEntry][name,SUP: Service Request workflow][id,183644][state,0] (SQL Exception while executing the following:INSERT INTO public.OS_WFENTRY (ID, NAME, INITIALIZED, STATE) VALUES (?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_os_wfentry"
Detail: Key (id)=(183644) already exists.))

And this is the correct flow of creating issue in shorter version:
INSERT INTO public.OS_WFENTRY (creating record for wf, currently with state=0)
INSERT INTO public.OS_CURRENTSTEP (creating status, I think so)
INSERT INTO public.jiraissue (creating issue)
UPDATE public.OS_WFENTRY (update to set state=1)

So finally my question - Why in some cases Jira duplicates INSERT to OS_WFENTRY? It interrupts entire further creation process because of PSQLException
Thanks you in advance for helping everyone interested

1 answer

0 votes
Sachin Dhamale
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 11, 2022

@Karol Siedlaczek ,

Some times some DB entries corrupted or enter incorrectly which causing this issue.

You can try to run integrity checker and fix all wrong entries if it has any.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.2
TAGS
AUG Leaders

Atlassian Community Events