TeamCity 6.5.6 Upgrade to 7.0.2

I ran the TeamCity upgrade to 7.0.2 today and ran into a in issue with one of the dml portions of the upgrade. We are using a MySql 5.0.77 database and I have not been able to find a solution in all my searching. The closest I can find is that the encoding may be wrong or that the column is not big enough. Any ideas what would cause this problem?

[2012-05-21 00:34:45,286]   INFO - de.versioning.ConvertPerformer - Converter 504[class:TruncateVcsVersionConverter] starting...
[2012-05-21 00:34:47,364]  ERROR - rs.TruncateVcsVersionConverter - Copy of vcs history data failed, restore table vcs_history
[2012-05-21 00:34:47,442]  ERROR -   jetbrains.buildServer.SERVER - Exception occured while applying converters
jetbrains.buildServer.serverSide.versioning.ConvertException: Converter jetbrains.buildServer.serverSide.versioning.converters.TruncateVcsVersionConverter failed with error: Unexpected exception SQLException: SQL error when doing: DML query
SQL query: insert into vcs_history (modification_id, user_name, description, change_date, register_date, vcs_root_id, changes_count, version, display_version) select modification_id, user_name, description, change_date, register_date, vcs_root_id, changes_count, substr(version, 1, 200), substr(display_version, 1, 200) from vcs_history_old
SQL exception: Incorrect string value: '\xE2\x80\xA8\x0A*i...' for column 'description' at row 40437
    at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convertImpl(BaseSqlConverter.java:134)
    at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convert(BaseSqlConverter.java:69)
    at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterStepJavaClass(ConvertPerformer.java:169)
    at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterSteps(ConvertPerformer.java:139)
    at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverter(ConvertPerformer.java:90)
    at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverters(ConvertPerformer.java:78)
    at jetbrains.buildServer.serverSide.versioning.VersionManager.upgradeIt(VersionManager.java:391)
    at jetbrains.buildServer.serverSide.versioning.VersionManager.checkVersionsAndUpgradeSchemaIfNeeded(VersionManager.java:359)
    at jetbrains.buildServer.serverSide.versioning.VersionManager$2.run(VersionManager.java:415)
    at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.withDB(TeamCityDatabaseManager.java:598)
    at jetbrains.buildServer.serverSide.versioning.VersionManager.ensureActualDatabase(VersionManager.java:411)
    at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerInternal(TeamCityDispatcherServlet.java:334)
    at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerSafe(TeamCityDispatcherServlet.java:585)
    at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$400(TeamCityDispatcherServlet.java:17)
    at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$6.run(TeamCityDispatcherServlet.java:1)
    at java.lang.Thread.run(Unknown Source)
Caused by: jetbrains.buildServer.serverSide.db.UnexpectedDBException: Unexpected exception SQLException: SQL error when doing: DML query
SQL query: insert into vcs_history (modification_id, user_name, description, change_date, register_date, vcs_root_id, changes_count, version, display_version) select modification_id, user_name, description, change_date, register_date, vcs_root_id, changes_count, substr(version, 1, 200), substr(display_version, 1, 200) from vcs_history_old
SQL exception: Incorrect string value: '\xE2\x80\xA8\x0A*i...' for column 'description' at row 40437
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2683)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2144)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2444)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2362)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2347)
    at jetbrains.buildServer.serverSide.db.DBFunctions.executeDmlInternal(DBFunctions.java:727)
    at jetbrains.buildServer.serverSide.db.DBFunctions.executeDml(DBFunctions.java:629)
    at jetbrains.buildServer.serverSide.versioning.converters.TruncateVcsVersionConverter.copyVcsHistoryData(TruncateVcsVersionConverter.java:82)
    at jetbrains.buildServer.serverSide.versioning.converters.TruncateVcsVersionConverter.convertVcsHistory(TruncateVcsVersionConverter.java:38)
    at jetbrains.buildServer.serverSide.versioning.converters.TruncateVcsVersionConverter.convertInternal(TruncateVcsVersionConverter.java:29)
    at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convertImpl(BaseSqlConverter.java:121)
    ... 15 more
Caused by: java.sql.SQLException: Incorrect string value: '\xE2\x80\xA8\x0A*i...' for column 'description' at row 40437
    ... 31 more

3 comments
Comment actions Permalink

Hi Ben,

The issue is filed as http://youtrack.jetbrains.com/issue/TW-20336 and has a workaround in  the comments.
Please convert the database fo UTF-8 before the upgrade.

0
Comment actions Permalink

Thanks! I will check it out.

0
Comment actions Permalink

Thanks, I was able to complete my upgrade!

0

Please sign in to leave a comment.