TC 2.1.1 -> Benares (5433) error

I get the following error when trying to start Benares #5433:

INFO - jetbrains.buildServer.SERVER - Starting TeamCity server
INFO - er.serverSide.impl.ServerPaths - TeamCity data path:/u01/home/ci/.BuildServer
INFO - rverSide.impl.DatabaseSettings - Cannot find /u01/home/ci/.BuildServer/config/database.properties
INFO - erver.serverSide.impl.DBFacade - Connection pool configured (org.hsqldb.jdbcDriver, maximum number of connections: 50)
INFO - Side.versioning.VersionManager - -


> Start applying converters
INFO - Side.versioning.VersionManager - Start applying converter TestInfoNormalizingConverter
INFO - s.TestInfoNormalizingConverter - Normalizing test_info - this will take some time!
INFO - s.TestInfoNormalizingConverter - Data size: 291580 rows
INFO - s.TestInfoNormalizingConverter - 1/3: Reading & hashing test_info
INFO - Side.versioning.VersionManager - -


> Done applying converters
ERROR - jetbrains.buildServer.SERVER - jetbrains.buildServer.serverSide.versioning.ConvertException: java.sql.SQLException: Table already exists: TEST_NAMES in statement

java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at jetbrains.buildServer.serverSide.impl.BuildServerImpl.]]>(BuildServerImpl.java:512)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:171)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:703)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:358)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:283)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:252)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:511)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1191)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:481)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:434)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:120)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:210)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929)
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.mortbay.start.Main.invokeMain(Main.java:183)
at org.mortbay.start.Main.start(Main.java:497)
at org.mortbay.start.Main.main(Main.java:115)

Message was edited by:
Jeff Glatz

8 comments

You trying to upgrade second time after 1st attempt failed.
Please clean logs, restore backup try again and report all exceptions
occurred.
(Do not just restart server to retry upgrade - it will not work.)

Jeff Glatz wrote:

I get the following error when trying to start Benares #5433:

INFO - jetbrains.buildServer.SERVER - Starting TeamCity server
INFO - er.serverSide.impl.ServerPaths - TeamCity data path:/u01/home/ci/.BuildServer
INFO - rverSide.impl.DatabaseSettings - Cannot find /u01/home/ci/.BuildServer/config/database.properties
INFO - erver.serverSide.impl.DBFacade - Connection pool configured (org.hsqldb.jdbcDriver, maximum number of connections: 50)
INFO - Side.versioning.VersionManager - ---------------> Start applying converters
INFO - Side.versioning.VersionManager - Start applying converter TestInfoNormalizingConverter
INFO - s.TestInfoNormalizingConverter - Normalizing test_info - this will take some time!
INFO - s.TestInfoNormalizingConverter - Data size: 291580 rows
INFO - s.TestInfoNormalizingConverter - 1/3: Reading & hashing test_info
INFO - Side.versioning.VersionManager - ---------------> Done applying converters
ERROR - jetbrains.buildServer.SERVER - jetbrains.buildServer.serverSide.versioning.ConvertException: java.sql.SQLException: Table already exists: TEST_NAMES in statement



--
Alexey Gopachenko
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

can you elaborate on the 'restore backup' step? i've used the EAP builds in the past, but the only thing i've done is:

1. expand the war file in a new directory
2. point the application context to the new directory
3. restart the server (jetty in my case)

0

Hello Jeff,

If you have created TeamCity data backup before the upgrade attempt as noted in the release notes ( http://www.jetbrains.net/confluence/display/TW/BenaresEAP%28build5433%29Release+Notes#BenaresEAP%28build5433%29ReleaseNotes-TeamCityBackupissues ), you can restore it and retry the upgrade to the EAP version.

If backup is not available, we can try to help you recover the database.

For a start, can you please provide us the logs of the server for the first upgrade attempt? Please include teamcity*.log file(s).
What is the current content of /u01/home/ci/.BuildServer/system/version.dat file?
What TeamCity version did you run before the upgrade?

--
Best regards,

Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

perhaps i've been lucky, but i was able to simply point the web application context back to the directory where the 2.1.1 (4261) version is expanded and restart jetty with no problems.

i tried the upgrade yesterday morning and after the initial failure pointed it back to the 2.1.1 (4261). unfortunately we did some house cleaning yesterday after the disk filled up and the log files were wiped.

FWIW, here is the contents of the version.dat file:

0

FWIW, here is the contents of the version.dat file:

 version.org.hsqldb.jdbcDriver=127]]>


I had lots of problems with the default database (HSQLDB), including
constant, mysterious TeamCity crashes until I changed to MySQL.

If at all possible I'd strongly suggest that you use MySQL with TeamCity.
http://www.jetbrains.net/confluence/display/TCD/MigratingtoMySQL+database

-Dave

0

Jeff,

1. Dave is right, MySQL is strongly recommended for running TeamCity in production.

2. It's good you managed to run the previous version after the failed upgrade, but you may experience problems with following upgrades, because your database is left in somewhat half-upgraded state. You might need to drop some tables in order upgrade process to complete. Please let us know when you need help with this.

--
Best regards,

Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

I followed dave's advice as you suggested and was able to get TC 2.1.1 upgraded to TC 3.
BTW the web interface is much more responsive after the switch.

I followed the back up and upgrade procedures and everything went well this time, but there were two tables that somehow did not get created: run_configuration_policy and agent_build_type_access

through a combination of error messages and examining existing tables, i was able to infer their structure and everything seems to be running fine. can you verify that these scripts are correct?


thanks!
jeff

0

Hello,

The correct definition of run_configuration_policy and
agent_build_type_access tables is:

CREATE TABLE run_configuration_policy (
AGENT_ID INTEGER NOT NULL,
POLICY INTEGER NOT NULL,
PRIMARY KEY (AGENT_ID)
);

CREATE TABLE agent_build_type_access (
AGENT_ID INTEGER NOT NULL,
BUILD_TYPE_ID VARCHAR(20) NOT NULL,
UNIQUE(AGENT_ID, BUILD_TYPE_ID)
);

CREATE INDEX agent_build_type_access_agent_id ON agent_build_type_access
(AGENT_ID);
CREATE INDEX agent_build_type_access_build_type_id ON
agent_build_type_access (BUILD_TYPE_ID);


--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



"Jeff Glatz" <no_reply@jetbrains.com> wrote in message
news:21573677.1187278696341.JavaMail.itn@is.intellij.net...
>I followed dave's advice as you suggested and was able to get TC 2.1.1
>upgraded to TC 3.

BTW the web interface is much more responsive after the switch.

>

I followed the back up and upgrade procedures and everything went well
this time, but there were two tables that somehow did not get created:
run_configuration_policy and agent_build_type_access

>

through a combination of error messages and examining existing tables, i
was able to infer their structure and everything seems to be running fine.
can you verify that these scripts are correct?

>

 CREATE TABLE `run_configuration_policy` (
>  `POLICY` varchar(255) NOT NULL,
>  `AGENT_ID` int(11) NOT NULL,
>  PRIMARY KEY  (`POLICY`,`AGENT_ID`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
>
> CREATE TABLE `agent_build_type_access` (
>  `BUILD_TYPE_ID` varchar(20) NOT NULL,
>  `AGENT_ID` int(11) NOT NULL,
>  PRIMARY KEY  (`BUILD_TYPE_ID`,`AGENT_ID`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
> ]]>

>

thanks!
jeff



0

Please sign in to leave a comment.