Teamcity 8.0 database upgrade issue

Hi,

I am upgrading teamcity from version 7.1.4 to 8.0. During the database upgrade process I got the following exception:

      <pre>jetbrains.buildServer.maintenance.exceptions.UnknownUpgradeError: Upgrading error: Converter jetbrains.buildServer.serverSide.versioning.converters.IncreaseAuditAdditionalDataLengthConverter failed with error: Unexpected exception SQLException: SQL error when doing: Executing a SQL statement
SQL query: alter table action_history alter column additional_data  varchar(80) null
SQL exception: Cannot find the object "action_history" because it does not exist or you do not have permissions.
 at jetbrains.buildServer.maintenance.StartupProcessor.doUpgrade(StartupProcessor.java:462)
 at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:54)
 at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:524)
 at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:49)
 at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:275)
 at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java)
 at java.lang.Thread.run(Thread.java:679)
caused by: jetbrains.buildServer.serverSide.versioning.ConvertException: Converter jetbrains.buildServer.serverSide.versioning.converters.IncreaseAuditAdditionalDataLengthConverter failed with error: Unexpected exception SQLException: SQL error when doing: Executing a SQL statement
SQL query: alter table action_history alter column additional_data  varchar(80) null
SQL exception: Cannot find the object "action_history" because it does not exist or you do not have permissions.
 at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convertImpl(BaseSqlConverter.java:132)
 at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convert(BaseSqlConverter.java:68)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterStepJavaClass(ConvertPerformer.java:173)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterSteps(ConvertPerformer.java:143)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverter(ConvertPerformer.java:94)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverters(ConvertPerformer.java:82)
 at jetbrains.buildServer.serverSide.versioning.VersionManager.upgradeIt(VersionManager.java:402)
 at jetbrains.buildServer.maintenance.StartupProcessor$6.run(StartupProcessor.java)
 at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.withMaintenanceDBF(TeamCityDatabaseManager.java:722)
 at jetbrains.buildServer.maintenance.StartupProcessor.doUpgrade(StartupProcessor.java:48)
 at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:54)
 at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:524)
 at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:49)
 at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:275)
 at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java)
 at java.lang.Thread.run(Thread.java:679)
caused by: jetbrains.buildServer.serverSide.db.UnexpectedDBException: Unexpected exception SQLException: SQL error when doing: Executing a SQL statement
SQL query: alter table action_history alter column additional_data  varchar(80) null
SQL exception: Cannot find the object "action_history" because it does not exist or you do not have permissions.
 at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
 at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
 at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
 at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
 at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
 at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
 at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
 at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1160)
 at jetbrains.buildServer.serverSide.db.DBFunctions.executeSimpleInternal(DBFunctions.java:736)
 at jetbrains.buildServer.serverSide.db.DBFunctions.executeSimpleInternal(DBFunctions.java:720)
 at jetbrains.buildServer.serverSide.db.DBFunctionsForMSSQL.executeSimpleInternal(DBFunctionsForMSSQL.java:115)
 at jetbrains.buildServer.serverSide.db.DBFunctions.executeParsedDdls(DBFunctions.java:685)
 at jetbrains.buildServer.serverSide.db.DBFunctions.executeDdls(DBFunctions.java:665)
 at jetbrains.buildServer.serverSide.db.DBFunctions.expandStringColumn(DBFunctions.java:1997)
 at jetbrains.buildServer.serverSide.versioning.converters.IncreaseAuditAdditionalDataLengthConverter.convertInternal(IncreaseAuditAdditionalDataLengthConverter.java:15)
 at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convertImpl(BaseSqlConverter.java:116)
 at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convert(BaseSqlConverter.java:68)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterStepJavaClass(ConvertPerformer.java:173)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterSteps(ConvertPerformer.java:143)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverter(ConvertPerformer.java:94)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverters(ConvertPerformer.java:82)
 at jetbrains.buildServer.serverSide.versioning.VersionManager.upgradeIt(VersionManager.java:402)
 at jetbrains.buildServer.maintenance.StartupProcessor$6.run(StartupProcessor.java)
 at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.withMaintenanceDBF(TeamCityDatabaseManager.java:722)
 at jetbrains.buildServer.maintenance.StartupProcessor.doUpgrade(StartupProcessor.java:48)
 at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:54)
 at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:524)
 at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:49)
 at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:275)
 at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java)
 at java.lang.Thread.run(Thread.java:679)
caused by: java.sql.SQLException: Cannot find the object "action_history" because it does not exist or you do not have permissions.
 at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
 at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
 at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
 at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
 at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
 at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
 at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
 at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1160)
 at jetbrains.buildServer.serverSide.db.DBFunctions.executeSimpleInternal(DBFunctions.java:736)
 at jetbrains.buildServer.serverSide.db.DBFunctions.executeSimpleInternal(DBFunctions.java:720)
 at jetbrains.buildServer.serverSide.db.DBFunctionsForMSSQL.executeSimpleInternal(DBFunctionsForMSSQL.java:115)
 at jetbrains.buildServer.serverSide.db.DBFunctions.executeParsedDdls(DBFunctions.java:685)
 at jetbrains.buildServer.serverSide.db.DBFunctions.executeDdls(DBFunctions.java:665)
 at jetbrains.buildServer.serverSide.db.DBFunctions.expandStringColumn(DBFunctions.java:1997)
 at jetbrains.buildServer.serverSide.versioning.converters.IncreaseAuditAdditionalDataLengthConverter.convertInternal(IncreaseAuditAdditionalDataLengthConverter.java:15)
 at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convertImpl(BaseSqlConverter.java:116)
 at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convert(BaseSqlConverter.java:68)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterStepJavaClass(ConvertPerformer.java:173)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterSteps(ConvertPerformer.java:143)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverter(ConvertPerformer.java:94)
 at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverters(ConvertPerformer.java:82)
 at jetbrains.buildServer.serverSide.versioning.VersionManager.upgradeIt(VersionManager.java:402)
 at jetbrains.buildServer.maintenance.StartupProcessor$6.run(StartupProcessor.java)
 at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.withMaintenanceDBF(TeamCityDatabaseManager.java:722)
 at jetbrains.buildServer.maintenance.StartupProcessor.doUpgrade(StartupProcessor.java:48)
 at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:54)
 at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:524)
 at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:49)
 at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:275)
 at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java)
 at java.lang.Thread.run(Thread.java:679)
</pre>

Do you have any idea what the problem is?

Best regards,
Sebastian

2 comments

Okay, sorry for questioning. Got the answer myself. The database user needed to be db-owner.

0

I'm getting similar error:


[2013-07-01 17:28:25,928]   INFO - de.versioning.ConvertPerformer - Converter 551[class:IncreaseAuditAdditionalDataLengthConverter] starting...
[2013-07-01 17:28:26,671]  ERROR -  jetbrains.buildServer.STARTUP - Exception UnknownUpgradeError in stage UPGRADE: Upgrading error: Converter jetbrains.buildServer.serverSide.versioning.converters.IncreaseAuditAdditionalDataLengthConverter failed with error: Duplicate keys in mappings action=10 and action=10
jetbrains.buildServer.maintenance.exceptions.UnknownUpgradeError: Upgrading error: Converter jetbrains.buildServer.serverSide.versioning.converters.IncreaseAuditAdditionalDataLengthConverter failed with error: Duplicate keys in mappings action=10 and action=10
    at jetbrains.buildServer.maintenance.StartupProcessor.doUpgrade(StartupProcessor.java:438)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:86)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:76)
    at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:322)
    at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:157)
    at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java)
    at java.lang.Thread.run(Thread.java:680)
Caused by: jetbrains.buildServer.serverSide.versioning.ConvertException: Converter jetbrains.buildServer.serverSide.versioning.converters.IncreaseAuditAdditionalDataLengthConverter failed with error: Duplicate keys in mappings action=10 and action=10
    at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convertImpl(BaseSqlConverter.java:132)
    at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convert(BaseSqlConverter.java:68)
    at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterStepJavaClass(ConvertPerformer.java:173)
    at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverterSteps(ConvertPerformer.java:143)
    at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverter(ConvertPerformer.java:94)
    at jetbrains.buildServer.serverSide.versioning.ConvertPerformer.runConverters(ConvertPerformer.java:82)
    at jetbrains.buildServer.serverSide.versioning.VersionManager.upgradeIt(VersionManager.java:402)
    at jetbrains.buildServer.maintenance.StartupProcessor$6.run(StartupProcessor.java)
    at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.withMaintenanceDBF(TeamCityDatabaseManager.java:722)
    at jetbrains.buildServer.maintenance.StartupProcessor.doUpgrade(StartupProcessor.java:343)
    ... 6 more
Caused by: java.lang.IllegalArgumentException: Duplicate keys in mappings action=10 and action=10
    at com.google.common.collect.ImmutableSortedMap.validateEntries(ImmutableSortedMap.java:304)
    at com.google.common.collect.ImmutableSortedMap.access$100(ImmutableSortedMap.java:61)
    at com.google.common.collect.ImmutableSortedMap$Builder.build(ImmutableSortedMap.java:426)
    at jetbrains.buildServer.serverSide.db.DBFunctions.getTableColumnWidths(DBFunctions.java:1961)
    at jetbrains.buildServer.serverSide.db.DBFunctions.getTableColumnWidth(DBFunctions.java:1898)
    at jetbrains.buildServer.serverSide.db.DBFunctions.expandStringColumn(DBFunctions.java:1988)
    at jetbrains.buildServer.serverSide.versioning.converters.IncreaseAuditAdditionalDataLengthConverter.convertInternal(IncreaseAuditAdditionalDataLengthConverter.java:15)
    at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convertImpl(BaseSqlConverter.java:116)
    ... 15 more
[2013-07-01 17:28:26,673]   INFO -  jetbrains.buildServer.STARTUP - Current stage: TeamCity server startup error

0

Please sign in to leave a comment.