Getting Data too long for column 'cru_revision' at row 1 error when migrating to external database

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Migration process to an external database is interrupted because of:

Creating table definitions...
1 rows written, 0 tables completed.
2 rows written, 1 tables completed.
698 rows written, 1 tables completed.
1458 rows written, 1 tables completed.
2549 rows written, 1 tables completed.
3474 rows written, 1 tables completed.
5001 rows written, 1 tables completed.
6565 rows written, 2 tables completed.
6565 rows written, 3 tables completed.
6566 rows written, 3 tables completed.
6904 rows written, 3 tables completed.
8150 rows written, 3 tables completed.
9210 rows written, 3 tables completed.
9660 rows written, 3 tables completed.
10640 rows written, 3 tables completed.
11446 rows written, 3 tables completed.
Database error at cru_revision:4999 (table:row) of the input: Data truncation: Data too long for column 'cru_revision' at row 1 null
Database migration failed: com.atlassian.crucible.migration.ParseException: null
Data truncation: Data too long for column 'cru_revision' at row 1
Database migration failed: java.sql.BatchUpdateException: Data truncation: Data too long for column 'cru_revision' at row 1

And inside log file is possible to see:

010-05-30 22:20:16,415 ERROR [ThreadPool1] fisheye.app DBEditHelper-doGet - Database migration failed: java.sql.BatchUpdateException: Data truncation: Data too long for column 'cru_revision' at row 1 
java.sql.BatchUpdateException: Data truncation: Data too long for column 'cru_revision' at row 1

Cause

The column size for cru_revision in table cru_revision has exceeded the default size varchar(100).

Resolution

Edit the SQL file FISHEYE_HOME\sql\MYSQL\schema\tables_67.sql observing query below:

create table cru_revision (cru_revision_id integer not null, cru_create_date bigint, cru_commit_date bigint, cru_author_name varchar(255), cru_deletion bit, cru_file_type varchar(15), cru_binary bit, cru_added bit, cru_modified bit, cru_moved bit, cru_copied bit, cru_detail_version integer, cru_source_name varchar(100), cru_path integer, cru_revision varchar(100), cru_revision_display_name varchar(255), cru_upload_item integer, primary key (cru_revision_id), unique (cru_source_name, cru_path, cru_revision)) ENGINE=InnoDB;

And increase the column size cru_revision varchar(100) to cru_revision varchar(200). Finally try to perform migration again.

 

Last modified on Feb 19, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.