Got a Duplicate key value error after migration from Cloud to Data center

Hi, after migration while i trying link issues i get an error " ```
ecure/LinkJiraIssue.jspa [c.a.j.p.link.remotejira.LinkJiraIssue] Error occurred creating link: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:IssueLink][sequence,null][destination,24141][linktype,10000][source,24175][id,15502] (SQL Exception while executing the following:INSERT INTO public.issuelink (ID, LINKTYPE, SOURCE, DESTINATION, SEQUENCE) VALUES (?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint “pk_issuelink”

And when i try to resolve that problem that way Duplicate key value errors in logs in Jira Server using PostgreSQL | Jira | Atlassian Documentation

On select * from “issuelink_ID_seq” i got next error: relation “issuelink_ID_seq” does not exist
How can i fix that

Hi @IlyaZhuravlev,

Welcome to Developer Community. The document you linked to is specifically for PostgreSQL and errors in Active Objects table which isn’t what it looks like here as you’re referring to the issuelink table.

What I think is happening is you’re trying to link an issue, the table issuelink already has data, but the sequence for generating the values for the ID column needs to be reset to be greater than the max value of the table. However, the table doesn’t have a separate sequence.

This document might be of more help

Specifically, you’re looking for IssueLink entry in sequence_value_item.

Regards,
James.

1 Like