org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:INSERT INTO notification (ID, SCHEME, EVENT, EVENT_TYPE_ID, TEMPLATE_ID, notif_type, notif_parameter) VALUES (?, ?, ?, ?, ?, ?, ?) (Data truncation: Data too long for column 'notif_parameter' at row 1)

Atlassian JIRA | Ian Daniel [Atlassian] | 10 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Recently I have tried to upgrade the Jira instance (on testing server). We use mysql as a database. before: Jira v5.2.4#845-sha1:c9f4cc4 after: Jira v6.0-rc1#6085-sha1:c75e730 During the upgrade, data migration failed with the exception in the ticket description. {code} Exception thrown during upgrade: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:UPDATE userassociation SET SOURCE_NAME = ? WHERE SINK_NODE_ID=? AND SINK_NODE_ENTITY=? AND ASSOCIATION_TYPE=? (Duplicate entry 'przemyslaw.marcinows-24682-Issue-WatchIssue' for key 'PRIMARY') com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:UPDATE userassociation SET SOURCE_NAME = ? WHERE SINK_NODE_ID=? AND SINK_NODE_ENTITY=? AND ASSOCIATION_TYPE=? (Duplicate entry 'przemyslaw.marcinows-24682-Issue-WatchIssue' for key 'PRIMARY') at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.bulkUpdateByAnd(DefaultOfBizDelegator.java:694) at com.atlassian.jira.entity.Update$WhereContext.execute(Update.java:136) at com.atlassian.jira.entity.EntityEngineImpl.execute(EntityEngineImpl.java:45) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039$AssociationVisitor.lowercaseThisRow(UpgradeTask_Build6039.java:250) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039$AssociationVisitor.visit(UpgradeTask_Build6039.java:218) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039$AssociationVisitor.visit(UpgradeTask_Build6039.java:193) at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl$3.consume(SelectQueryImpl.java:147) at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.consumeWith(SelectQueryImpl.java:129) at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.visitWith(SelectQueryImpl.java:142) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039.updateNamesToLowercase(UpgradeTask_Build6039.java:174) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039.updateSimpleColumn(UpgradeTask_Build6039.java:144) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039.doUpgrade(UpgradeTask_Build6039.java:95) at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeTaskSuccess(UpgradeManagerImpl.java:673) at com.atlassian.jira.upgrade.UpgradeManagerImpl.runUpgradeTasks(UpgradeManagerImpl.java:526) at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgrade(UpgradeManagerImpl.java:456) at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeeded(UpgradeManagerImpl.java:399) at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeededAndAllowed(UpgradeManagerImpl.java:333) at com.atlassian.jira.upgrade.UpgradeLauncher.checkIfUpgradeNeeded(UpgradeLauncher.java:100) at com.atlassian.jira.upgrade.UpgradeLauncher.start(UpgradeLauncher.java:49) at com.atlassian.jira.startup.DefaultJiraLauncher$3.run(DefaultJiraLauncher.java:117) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:315) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:209) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:105) at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:30) at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:69) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:33) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:64) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:54) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:UPDATE userassociation SET SOURCE_NAME = ? WHERE SINK_NODE_ID=? AND SINK_NODE_ENTITY=? AND ASSOCIATION_TYPE=? (Duplicate entry 'przemyslaw.marcinows-24682-Issue-WatchIssue' for key 'PRIMARY') at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:650) at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.bulkUpdateByAnd(DefaultOfBizDelegator.java:685) ... 37 more {code} I had to {code} ALTER TABLE jira.userassociation DROP PRIMARY KEY; {code} and then upgrade proceeded to the sucessful end. {code} SELECT COUNT(*), SOURCE_NAME, SINK_NODE_ID FROM jira.userassociation GROUP BY SOURCE_NAME, SINK_NODE_ID HAVING COUNT(*)>1; {code} Results with hundreds of duplicated rows which prevents me from recreating primary key back again.

    Atlassian JIRA | 4 years ago | Matt
    com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:UPDATE userassociation SET SOURCE_NAME = ? WHERE SINK_NODE_ID=? AND SINK_NODE_ENTITY=? AND ASSOCIATION_TYPE=? (Duplicate entry 'przemyslaw.marcinows-24682-Issue-WatchIssue' for key 'PRIMARY')
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Recently I have tried to upgrade the Jira instance (on testing server). We use mysql as a database. before: Jira v5.2.4#845-sha1:c9f4cc4 after: Jira v6.0-rc1#6085-sha1:c75e730 During the upgrade, data migration failed with the exception in the ticket description. {code} Exception thrown during upgrade: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:UPDATE userassociation SET SOURCE_NAME = ? WHERE SINK_NODE_ID=? AND SINK_NODE_ENTITY=? AND ASSOCIATION_TYPE=? (Duplicate entry 'przemyslaw.marcinows-24682-Issue-WatchIssue' for key 'PRIMARY') com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:UPDATE userassociation SET SOURCE_NAME = ? WHERE SINK_NODE_ID=? AND SINK_NODE_ENTITY=? AND ASSOCIATION_TYPE=? (Duplicate entry 'przemyslaw.marcinows-24682-Issue-WatchIssue' for key 'PRIMARY') at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.bulkUpdateByAnd(DefaultOfBizDelegator.java:694) at com.atlassian.jira.entity.Update$WhereContext.execute(Update.java:136) at com.atlassian.jira.entity.EntityEngineImpl.execute(EntityEngineImpl.java:45) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039$AssociationVisitor.lowercaseThisRow(UpgradeTask_Build6039.java:250) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039$AssociationVisitor.visit(UpgradeTask_Build6039.java:218) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039$AssociationVisitor.visit(UpgradeTask_Build6039.java:193) at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl$3.consume(SelectQueryImpl.java:147) at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.consumeWith(SelectQueryImpl.java:129) at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.visitWith(SelectQueryImpl.java:142) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039.updateNamesToLowercase(UpgradeTask_Build6039.java:174) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039.updateSimpleColumn(UpgradeTask_Build6039.java:144) at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6039.doUpgrade(UpgradeTask_Build6039.java:95) at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeTaskSuccess(UpgradeManagerImpl.java:673) at com.atlassian.jira.upgrade.UpgradeManagerImpl.runUpgradeTasks(UpgradeManagerImpl.java:526) at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgrade(UpgradeManagerImpl.java:456) at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeeded(UpgradeManagerImpl.java:399) at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeededAndAllowed(UpgradeManagerImpl.java:333) at com.atlassian.jira.upgrade.UpgradeLauncher.checkIfUpgradeNeeded(UpgradeLauncher.java:100) at com.atlassian.jira.upgrade.UpgradeLauncher.start(UpgradeLauncher.java:49) at com.atlassian.jira.startup.DefaultJiraLauncher$3.run(DefaultJiraLauncher.java:117) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:315) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:209) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:105) at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:30) at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:69) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:33) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:64) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:54) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:UPDATE userassociation SET SOURCE_NAME = ? WHERE SINK_NODE_ID=? AND SINK_NODE_ENTITY=? AND ASSOCIATION_TYPE=? (Duplicate entry 'przemyslaw.marcinows-24682-Issue-WatchIssue' for key 'PRIMARY') at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:650) at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.bulkUpdateByAnd(DefaultOfBizDelegator.java:685) ... 37 more {code} I had to {code} ALTER TABLE jira.userassociation DROP PRIMARY KEY; {code} and then upgrade proceeded to the sucessful end. {code} SELECT COUNT(*), SOURCE_NAME, SINK_NODE_ID FROM jira.userassociation GROUP BY SOURCE_NAME, SINK_NODE_ID HAVING COUNT(*)>1; {code} Results with hundreds of duplicated rows which prevents me from recreating primary key back again.

    Atlassian JIRA | 4 years ago | Matt
    com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:UPDATE userassociation SET SOURCE_NAME = ? WHERE SINK_NODE_ID=? AND SINK_NODE_ENTITY=? AND ASSOCIATION_TYPE=? (Duplicate entry 'przemyslaw.marcinows-24682-Issue-WatchIssue' for key 'PRIMARY')

    Root Cause Analysis

    1. org.ofbiz.core.entity.GenericDataSourceException

      SQL Exception while executing the following:INSERT INTO notification (ID, SCHEME, EVENT, EVENT_TYPE_ID, TEMPLATE_ID, notif_type, notif_parameter) VALUES (?, ?, ?, ?, ?, ?, ?) (Data truncation: Data too long for column 'notif_parameter' at row 1)

      at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate()
    2. org.ofbiz.core
      SQLProcessor.executeUpdate
      1. org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:375)
      1 frame