Problem upgrading from 4.5 to 5

After upgrade, I'm getting the following error:

Exception occured while applying converters

[2010-03-03 11:42:36,674]   INFO -   jetbrains.buildServer.SERVER - Starting TeamCity server
[2010-03-03 11:42:36,986]   INFO - dServer.serverSide.ServerPaths - TeamCity data path was read from teamcity.data.path
[2010-03-03 11:42:36,986]   INFO - dServer.serverSide.ServerPaths - TeamCity data directory: E:/Program Files/TeamCity/data
[2010-03-03 11:42:37,236]   INFO - rverSide.db.TeamCityDataSource - Using the following database settings:
 database type: MSSQL2005
 database driver: net.sourceforge.jtds.jdbc.Driver
 connection: jdbc:jtds:sqlserver://2kgbalsql1:1433/TeamCity
 login as: TeamCity
[2010-03-03 11:42:37,549]   INFO -   jetbrains.buildServer.SERVER - TeamCity configuration version is 346
[2010-03-03 11:42:37,752]   INFO -   jetbrains.buildServer.SERVER - Configuration version: 280, Database version: 0
[2010-03-03 11:42:39,721]   INFO - Side.versioning.VersionManager - ---------------> Start applying converters
[2010-03-03 11:42:39,721]   INFO - Side.versioning.VersionManager - Start applying converter CoverageParamsConverter (281)
[2010-03-03 11:42:40,018]   INFO - Side.versioning.VersionManager - Done applying converter CoverageParamsConverter
[2010-03-03 11:42:40,018]   INFO - Side.versioning.VersionManager - Start applying converter Versions (282)
[2010-03-03 11:42:40,080]   INFO - Side.versioning.VersionManager - Done applying converter Versions
[2010-03-03 11:42:40,080]   INFO - Side.versioning.VersionManager - Start applying converter Create archive projects table (283)
[2010-03-03 11:42:40,080]   INFO - Side.versioning.VersionManager - Done applying converter Create archive projects table
[2010-03-03 11:42:40,080]   INFO - Side.versioning.VersionManager - Start applying converter Create a table for storing build identifiers to backup (284)
[2010-03-03 11:42:40,096]   INFO - Side.versioning.VersionManager - Done applying converter Create a table for storing build identifiers to backup
[2010-03-03 11:42:40,096]   INFO - Side.versioning.VersionManager - Start applying converter Create the stats_publisher_state if it is not created yet. (285)
[2010-03-03 11:42:40,096]   INFO - Side.versioning.VersionManager - Done applying converter Create the stats_publisher_state if it is not created yet.
[2010-03-03 11:42:40,096]   INFO - Side.versioning.VersionManager - Start applying converter  (286)
[2010-03-03 11:42:40,127]   INFO - Side.versioning.VersionManager - Done applying converter  
[2010-03-03 11:42:40,127]   INFO - Side.versioning.VersionManager - Start applying converter AddArchivePermissionConverter (287)
[2010-03-03 11:42:40,127]   INFO - Side.versioning.VersionManager - Done applying converter AddArchivePermissionConverter
[2010-03-03 11:42:40,127]   INFO - Side.versioning.VersionManager - Start applying converter IssueTrackerXmlConverter (288)
[2010-03-03 11:42:40,127]   INFO - rters.IssueTrackerXmlConverter - File issue-tracker.xml not found
[2010-03-03 11:42:40,143]   INFO - Side.versioning.VersionManager - Done applying converter IssueTrackerXmlConverter
[2010-03-03 11:42:40,143]   INFO - Side.versioning.VersionManager - Start applying converter BuildTypeSettingsConverter (289)
[2010-03-03 11:42:40,299]   INFO - Side.versioning.VersionManager - Done applying converter BuildTypeSettingsConverter
[2010-03-03 11:42:40,299]   INFO - Side.versioning.VersionManager - Start applying converter AddSettingsElementConverter (290)
[2010-03-03 11:42:40,455]   INFO - Side.versioning.VersionManager - Done applying converter AddSettingsElementConverter
[2010-03-03 11:42:40,455]   INFO - Side.versioning.VersionManager - Start applying converter Create artifacts dependency table (for build state) (291)
[2010-03-03 11:42:40,471]   INFO - Side.versioning.VersionManager - Done applying converter Create artifacts dependency table (for build state)
[2010-03-03 11:42:40,471]   INFO - Side.versioning.VersionManager - Start applying converter Remove comment identifiers from agent table (292)
[2010-03-03 11:42:40,486]  ERROR -   jetbrains.buildServer.SERVER - Exception occured while applying converters

jetbrains.buildServer.serverSide.versioning.ConvertException: Converter jetbrains.buildServer.serverSide.versioning.converters.RemoveCommentIdentifiersFromAgentTableConverter failed with error: Cannot drop the index 'agent.agent_status_comment_id', because it does not exist or you do not have permission.
 at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convert(BaseSqlConverter.java:16)
 at jetbrains.buildServer.serverSide.versioning.VersionManager.doConversion(VersionManager.java:94)
 at jetbrains.buildServer.serverSide.versioning.VersionManager.convert(VersionManager.java:143)
 at jetbrains.buildServer.serverSide.impl.DatabaseConverter.performConversionWhenNeccessary(DatabaseConverter.java:8)
 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:585)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
 at java.security.AccessController.doPrivileged(Native Method)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:671)
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610)
 at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:622)
 at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:584)
 at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:193)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
 at java.security.AccessController.doPrivileged(Native Method)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
 at jetbrains.buildServer.rootDispatcher.spring.WebDispatcherServlet.createWebApplicationContext(WebDispatcherServlet.java:4)
 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
 at javax.servlet.GenericServlet.init(GenericServlet.java:212)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.createServerServlet(TeamCityDispatcherServlet.java:74)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerInternal(TeamCityDispatcherServlet.java:78)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processServerStartup(TeamCityDispatcherServlet.java:84)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$000(TeamCityDispatcherServlet.java:96)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$1.run(TeamCityDispatcherServlet.java:1)
 at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Cannot drop the index 'agent.agent_status_comment_id', because it does not exist or you do not have permission.
 at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
 at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
 at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
 at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
 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:1157)
 at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
 at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
 at jetbrains.buildServer.serverSide.impl.DatabaseUtil.dropIndex(DatabaseUtil.java:204)
 at jetbrains.buildServer.serverSide.versioning.converters.RemoveCommentIdentifiersFromAgentTableConverter.convertInternal(RemoveCommentIdentifiersFromAgentTableConverter.java:8)
 at jetbrains.buildServer.serverSide.versioning.converters.BaseSqlConverter.convert(BaseSqlConverter.java:30)
 ... 53 more

8 comments

Hello,

Which version of TeamCity do you use?

0

Trying to upgrade from 4.5.5 to 5.0.2.

0

Thank you for the quick replay.

I've got one more question:
which charset and collation are set on your database? are they case sensitive or case insensitive?

Thanks,
Leo

0

Hi,

I could not resolve this problem just now. I posted an issue: http://youtrack.jetbrains.net/issue/TW-11258, please watch/vote for it. I will try to resolve it in a couple of days.

Thanks,
Leonid

0

Collation is Latin1_General_CI_AI

0

Hello,

could you please provide us with the schema of your database? That will help us to get know why this exception has occurred and how to solve it.

In order to obtain the schema as a SQL scenario, please use MS SQL Server Management Studio, connect to the database, right click on the database name (in the object tree that is at the left side of the window), select item “Tasks >” then “Generate scripts...”, check the “Script all objects in the selected database” and then click on the “Finish” button.

Please, send me the generated SQL scenario or attach it to the http://youtrack.jetbrains.net/issue/TW-11258

Thank you!

0

Hi,

It seems all non-clustered indices are lost from your database. Have you any idea how did it happen?

Now, I can recommend to:

  1. Restore the database from backup.
  2. If the restored database has no non-clustered indices, migrate it using the migrateDB tool to another MS SQL database (see http://confluence.jetbrains.net/display/TCD4/Migrating+to+an+External+Database how to do it) – it will restore all indices.
  3. Then start upgrading to 5.0.2.



Best regards,
Leonid
0

Please sign in to leave a comment.