java.io.IOException: Error writing to the database: Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name'

Atlassian JIRA | Felipe Kraemer | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When an anonymised backup is created, all sensitive data is replaced by a sequence of 'x' characters. This causes problems when restoring the backup, such as this: {noformat} Database error at cru_revision:4999 (table:row) of the input: Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name' INFO - Closing com.cenqua.fisheye.ctl.Restore$RestoreApplicationContext@3db158db: startup date [Wed Jul 31 13:50:53 BRT 2013]; root of context hierarchy INFO - *** application context closed *** java.io.IOException: Error writing to the database: Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name' at com.atlassian.crucible.migration.item.SQLBackup.restore(SQLBackup.java:205) at com.atlassian.crucible.migration.item.SQLBackup$1.restore(SQLBackup.java:169) at com.cenqua.fisheye.ctl.Restore.run(Restore.java:191) at com.cenqua.fisheye.ctl.Restore.main(Restore.java:267) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.cenqua.fisheye.FishEyeCtl.mainImpl(FishEyeCtl.java:99) at com.cenqua.fisheye.FishEyeCtl.main(FishEyeCtl.java:42) Caused by: java.sql.BatchUpdateException: Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name' at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2007) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1443) at com.atlassian.crucible.migration.item.DBImporter$BatchInserter.flush(DBImporter.java:313) at com.atlassian.crucible.migration.item.DBImporter$BatchInserter.executePS(DBImporter.java:308) at com.atlassian.crucible.migration.item.DBImporter$BaseInserter.execute(DBImporter.java:456) at com.atlassian.crucible.migration.item.DBImporter.importTable(DBImporter.java:182) at com.atlassian.crucible.migration.item.DBImporter.importData(DBImporter.java:134) at com.atlassian.crucible.migration.item.SQLBackup.restore(SQLBackup.java:188) ... 9 more Restore failed. This may leave your target FISHEYE_INST directory (/my/path/to/fecru-3.0.2) in an inconsistent state. {noformat} Maybe instead of replacing sensitive data by 'xxxx' it could replace by a hash that could be decrypted? This would avoid having duplicate entries in the backup due to 'xxxx' usage.

    Atlassian JIRA | 4 years ago | Felipe Kraemer
    java.io.IOException: Error writing to the database: Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name'
  2. 0

    When an anonymised backup is created, all sensitive data is replaced by a sequence of 'x' characters. This causes problems when restoring the backup, such as this: {noformat} Database error at cru_revision:4999 (table:row) of the input: Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name' INFO - Closing com.cenqua.fisheye.ctl.Restore$RestoreApplicationContext@3db158db: startup date [Wed Jul 31 13:50:53 BRT 2013]; root of context hierarchy INFO - *** application context closed *** java.io.IOException: Error writing to the database: Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name' at com.atlassian.crucible.migration.item.SQLBackup.restore(SQLBackup.java:205) at com.atlassian.crucible.migration.item.SQLBackup$1.restore(SQLBackup.java:169) at com.cenqua.fisheye.ctl.Restore.run(Restore.java:191) at com.cenqua.fisheye.ctl.Restore.main(Restore.java:267) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.cenqua.fisheye.FishEyeCtl.mainImpl(FishEyeCtl.java:99) at com.cenqua.fisheye.FishEyeCtl.main(FishEyeCtl.java:42) Caused by: java.sql.BatchUpdateException: Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name' at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2007) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1443) at com.atlassian.crucible.migration.item.DBImporter$BatchInserter.flush(DBImporter.java:313) at com.atlassian.crucible.migration.item.DBImporter$BatchInserter.executePS(DBImporter.java:308) at com.atlassian.crucible.migration.item.DBImporter$BaseInserter.execute(DBImporter.java:456) at com.atlassian.crucible.migration.item.DBImporter.importTable(DBImporter.java:182) at com.atlassian.crucible.migration.item.DBImporter.importData(DBImporter.java:134) at com.atlassian.crucible.migration.item.SQLBackup.restore(SQLBackup.java:188) ... 9 more Restore failed. This may leave your target FISHEYE_INST directory (/my/path/to/fecru-3.0.2) in an inconsistent state. {noformat} Maybe instead of replacing sensitive data by 'xxxx' it could replace by a hash that could be decrypted? This would avoid having duplicate entries in the backup due to 'xxxx' usage.

    Atlassian JIRA | 4 years ago | Felipe Kraemer
    java.io.IOException: Error writing to the database: Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name'
  3. 0

    Issue persisting long strings with Hibernate

    Stack Overflow | 7 years ago | lupefiasco
    java.sql.BatchUpdateException: Data truncation: Data too long for column 'introText' at row 1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    cant get it working [#1428232] | Drupal.org

    drupal.org | 2 years ago
    org.drupal.project.async_command.exception.DatabaseRuntimeException: java.sql.BatchUpdateException: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
  6. 0

    Duplicate entry xxx for Primary

    Google Groups | 6 years ago | ThorQue
    com.google.gwtorm.client.OrmException: insert failure on patch_set_ancestors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.sql.BatchUpdateException

    Duplicate entry 'xxx-10142-xxx' for key 'cru_source_name'

    at com.mysql.jdbc.PreparedStatement.executeBatchSerially()
  2. MySQL jdbc
    PreparedStatement.executeBatch
    1. com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2007)
    2. com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1443)
    2 frames
  3. com.atlassian.crucible
    SQLBackup$1.restore
    1. com.atlassian.crucible.migration.item.DBImporter$BatchInserter.flush(DBImporter.java:313)
    2. com.atlassian.crucible.migration.item.DBImporter$BatchInserter.executePS(DBImporter.java:308)
    3. com.atlassian.crucible.migration.item.DBImporter$BaseInserter.execute(DBImporter.java:456)
    4. com.atlassian.crucible.migration.item.DBImporter.importTable(DBImporter.java:182)
    5. com.atlassian.crucible.migration.item.DBImporter.importData(DBImporter.java:134)
    6. com.atlassian.crucible.migration.item.SQLBackup.restore(SQLBackup.java:188)
    7. com.atlassian.crucible.migration.item.SQLBackup$1.restore(SQLBackup.java:169)
    7 frames
  4. com.cenqua.fisheye
    Restore.main
    1. com.cenqua.fisheye.ctl.Restore.run(Restore.java:191)
    2. com.cenqua.fisheye.ctl.Restore.main(Restore.java:267)
    2 frames
  5. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  6. com.cenqua.fisheye
    FishEyeCtl.main
    1. com.cenqua.fisheye.FishEyeCtl.mainImpl(FishEyeCtl.java:99)
    2. com.cenqua.fisheye.FishEyeCtl.main(FishEyeCtl.java:42)
    2 frames