Unique Constraint Violation Due to Value too Large for Column

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

The following error appears during a site restore when you are trying to migrate to an Oracle database:

(Auto-migrated image: description temporarily unavailable)

The following error appears in the log file:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 Caused by: java.sql.SQLException: ORA-12899: value too large for column "TEST"."LINKS"."DESTPAGETITLE" (actual: 256, maximum: 255) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:970) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3454) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:462)

followed by

1 2 3 org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.pages.Attachment#19858346]; SQL []; ORA-00001: unique constraint (TEST.SYS_C0038932) violated; nested exception is java.sql.SQLException: ORA-00001: unique constraint (TEST.SYS_C0038932) violated Caused by: java.sql.SQLException: ORA-00001: unique constraint (TEST.SYS_C0038932) violated

Cause

A column in your previous database is too long to insert into the oracle database you are migrating to, causing a commitAndRethrow. It is suspected that this causes the Attachments references to be written to the Attachments table, causing a PK violation when the actual Attachments are to be inserted.

Resolution

There is an entry in your existing database that is too long. It may be because of the encoding that is being used in your previous database, which does not match up to the encoding you have set for Oracle.

Once you fix entry so the column length is no longer too long and is unique, so you can get pas the error ORA-12899, you should no longer get the ORA-00001 error. Detailed instructions can be found at Cannot Restore XML Backup due to Value too Large for Column.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.