Creating web link results in DataAccessExeption, what can i do?

Stefan Arnold
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 7, 2017

Hey guys,

i created new instance of jira and imported our old backed up instance.
(imported old home directory and mysqldump) I did this several times before without any problems.

This time everything worked fine too and everthing in jira is working. But now i tried to create a weblink in an issue but always getting an DataAccessException.

2017-06-07 09:58:33,661 http-nio-127.0.0.1-8080-exec-1099 ERROR      [o.a.c.c.C.[.[localhost].[/].[action]] Servlet.service() for servlet [action] in context with path [] threw exception [com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:RemoteIssueLink][summary,null][statusiconurl,null][statuscategorycolorname,null][issueid,62219][statusdescription,null][globalid,null][statusname,null][statusiconlink,null][title,bla][url,http://google.de][statuscategorykey,null][applicationname,null][statusicontitle,null][iconurl,http://google.de/favicon.ico][id,10004][relationship,null][icontitle,null][applicationtype,null][resolved,null] (SQL Exception while executing the following:INSERT INTO remotelink (ID, ISSUEID, GLOBALID, TITLE, SUMMARY, URL, ICONURL, ICONTITLE, RELATIONSHIP, RESOLVED, STATUSNAME, STATUSDESCRIPTION, STATUSICONURL, STATUSICONTITLE, STATUSICONLINK, STATUSCATEGORYKEY, STATUSCATEGORYCOLORNAME, APPLICATIONTYPE, APPLICATIONNAME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry '10004' for key 'PRIMARY'))] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '10004' for key 'PRIMARY'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
        at com.mysql.jdbc.Util.getInstance(Util.java:408)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
        at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
        at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
        at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
        at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:673)
        at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:205)
        at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:178)
        at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:83)
        at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:556)
        at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:542)
        at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:97)
        at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:296)
        at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.createValue(WrappingOfBizDelegator.java:172)
        at com.atlassian.jira.entity.EntityEngineImpl.createValue(EntityEngineImpl.java:29)
        at com.atlassian.jira.issue.link.RemoteIssueLinkStoreImpl.createRemoteIssueLink(RemoteIssueLinkStoreImpl.java:56)
        at com.atlassian.jira.issue.link.DefaultRemoteIssueLinkManager.createRemoteIssueLink(DefaultRemoteIssueLinkManager.java:87)
        at com.atlassian.jira.bc.issue.link.DefaultRemoteIssueLinkService.create(DefaultRemoteIssueLinkService.java:212)
        ... 3 filtered
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
        at com.sun.proxy.$Proxy271.create(Unknown Source)
        ... 3 filtered
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy668.create(Unknown Source)
        at com.atlassian.jira.web.action.issue.AbstractIssueLinkAction.createLink(AbstractIssueLinkAction.java:119)
        at com.atlassian.jira.web.action.issue.AbstractIssueLinkAction.createLink(AbstractIssueLinkAction.java:109)
        at com.atlassian.jira.plugin.link.web.AddWebLink.doExecute(AddWebLink.java:67)
        ... 1 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:80)
        ... 1 filtered
        at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:78)
        ... 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)
        ... 28 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)

It says duplicate entry 10004 for key Primary. When i look in database there are multiple more remotelinks.

Why does it know wanna use 10004? Is there a way to change this value that the next web link gets the Max(remotelink.id)+1 ?

Creating issuelinks is possible without problems.

Any ideas?

1 answer

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2021

Problem was 

(Duplicate entry '10004' for key 'PRIMARY'))] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '10004' for key 'PRIMARY'

you need to remove on old backup and the import.

Suggest an answer

Log in or Sign up to answer