Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

duplicate key value violates unique constraint "pk_propertyentry"?

Timothy Harris
Contributor
January 29, 2017

Has anyone seen this in the JIRA Log before.

org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_propertyentry"

 

It is occurring after a migration of data from a cloud instance to a server instance.

Server is latest 7.3.

 

4 answers

3 votes
Frédéric Esnault
Contributor
April 27, 2022

Hi there,

I'm facing this issue now, and i found a table called sequence_value_item in jira db.

It holds seq_id for seq_name.

In my case I had this issue with pk_customfieldvalue, id was already used.

I found that max(id) from customfieldvalue was way above seq_id for seq_name CustomFieldValue in sequence_value_item.

I updated it using this query :

update sequence_value_item set seq_id=(select max(id)+100 from customfieldvalue) where seq_name='CustomFieldValue';

Restarted Jira and tested again, issue fixed.

oleg.buzinov May 23, 2023

Thank you. This solution helped me in the same case.

Like • Frédéric Esnault likes this
0 votes
Sumeet Pannu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 17, 2017

Yeah, same question here.

0 votes
mark_schaal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2017

I am also experiencing this. Migrating from Cloud to the latest version of JIRA Server (7.3.x) and using a new license.

Any resolution or guidance? 

0 votes
Timothy Harris
Contributor
January 29, 2017

The full stack trace is below:

 

2017-01-30 11:09:21,177 https-jsse-nio-8443-exec-20 ERROR      [o.a.c.c.C.[.[localhost].[/].[action]] Servlet.service() for servlet [action] in context with path [] threw exception [com.opensymphony.module.propertyset.PropertyImplementationException: Failed operation: SetOperation[entityName=ApplicationUser,entityId=10001,propertyKey=user.last.issue.type.id,newType=5,newMapper=TypeMapper[handler=StringPropertyHandler,valueEntity=OSPropertyString]]] with root cause
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_propertyentry"
  Detail: Key (id)=(30030) already exists.
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2101)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1834)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:510)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:386)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:332)
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
	at com.querydsl.sql.dml.SQLInsertClause.execute(SQLInsertClause.java:382)
	at com.atlassian.jira.database.IdGeneratingSQLInsertClause.executeWithId(IdGeneratingSQLInsertClause.java:71)
	at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore$SetOperation.insert(CachingOfBizPropertyEntryStore.java:614)
	at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore$SetOperation.upsert(CachingOfBizPropertyEntryStore.java:605)
	at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.lambda$tx$6(CachingOfBizPropertyEntryStore.java:295)
	at com.atlassian.jira.database.DefaultQueryDslAccessor$1.lambda$executeQuery$0(DefaultQueryDslAccessor.java:83)
	at com.atlassian.jira.database.DatabaseAccessorImpl.executeQuery(DatabaseAccessorImpl.java:67)
	at com.atlassian.jira.database.DefaultQueryDslAccessor$1.executeQuery(DefaultQueryDslAccessor.java:82)
	at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.query(CachingOfBizPropertyEntryStore.java:285)
	at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.tx(CachingOfBizPropertyEntryStore.java:293)
	at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.access$300(CachingOfBizPropertyEntryStore.java:72)
	at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore$SetOperation.perform(CachingOfBizPropertyEntryStore.java:592)
	at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.retry(CachingOfBizPropertyEntryStore.java:304)
	at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.setEntry(CachingOfBizPropertyEntryStore.java:148)
	at com.atlassian.jira.propertyset.CachingOfBizPropertySet.setImpl(CachingOfBizPropertySet.java:183)
	at com.opensymphony.module.propertyset.AbstractPropertySet.set(AbstractPropertySet.java:502)
	at com.opensymphony.module.propertyset.AbstractPropertySet.setString(AbstractPropertySet.java:300)
	at com.atlassian.jira.user.preferences.JiraUserPreferences.setString(JiraUserPreferences.java:109)
	at com.atlassian.jira.user.UserIssueTypeManagerImpl.setIssueType(UserIssueTypeManagerImpl.java:66)
	at com.atlassian.jira.user.UserIssueTypeManagerImpl.setLastUsedIssueTypeId(UserIssueTypeManagerImpl.java:32)
	... 2 filtered
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
	at com.sun.proxy.$Proxy93.setLastUsedIssueTypeId(Unknown Source)
	... 2 filtered
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:136)
	at com.sun.proxy.$Proxy93.setLastUsedIssueTypeId(Unknown Source)
	at com.atlassian.jira.quickedit.action.QuickCreateIssue.doDefault(QuickCreateIssue.java:224)
	... 3 filtered
	at java.lang.reflect.Method.invoke(Method.java:498)
	at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
	at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
	... 2 filtered
	at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63)
	... 7 filtered
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	... 52 filtered
	at com.atlassian.greenhopper.jira.filters.ClassicBoardRouter.doFilter(ClassicBoardRouter.java:62)
	... 7 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 58 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:76)
	... 1 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:74)
	... 36 filtered
	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
	... 10 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 4 filtered
	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
	... 29 filtered
	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
	... 29 filtered
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events