Error parsing project configurations on a cloned system

We're attempting to copy our existing 4.5.4 system to a sandbox machine, where we intend to test our upgrade process out before rolling out version 5.1.  We followed the instructions in the how to, yet we're experiencing a baffling problem.  For each project with one or more build configuration, an error message is displayed stating:

Critical error in configuration file <TeamCity Data Directory>\config\<ProjectName>\project-config.xml:
org.jdom.input.JDOMParseException: Error on line 8 of document file:/<TeamCity Data Directory>/config/<ProjectName>/project-config.xml: Element type "settings" must be declared.


However, all of our project-config.xml files are indeed present at the paths listed in the error messages, and contain <settings /> tags.  The entire TeamCity Data Directory was copied from our existing system and everything is working as expected there.
Also, each row in our external database's projects table gets deleted by TeamCity when this happens.
We took a look at the log file, and it's full of exceptions like this:

[2010-04-22 16:13:17,054]   WARN -   jetbrains.buildServer.SERVER - Failed to restore project from the configuration file: <TeamCity Data Directory>\config\<ProjectName> jetbrains.buildServer.serverSide.impl.RestoreProjectFailedException: org.jdom.input.JDOMParseException: Error on line 8 of document file:/<TeamCity Data Directory>/config/<ProjectName>/project-config.xml: Element type "settings" must be declared.
     at jetbrains.buildServer.serverSide.impl.ProjectManagerImpl$8.run(ProjectManagerImpl.java:22)      at jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl$2.run(SecurityContextImpl.java:1)      at jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl.runAs(SecurityContextImpl.java:4)      at jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl.runAs(SecurityContextImpl.java:27)      at jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl.runAsSystem(SecurityContextImpl.java:10)      at jetbrains.buildServer.serverSide.impl.ProjectManagerImpl.restoreProject(ProjectManagerImpl.java:367)      at jetbrains.buildServer.serverSide.impl.ProjectManagerImpl.loadProjects(ProjectManagerImpl.java:126)      at jetbrains.buildServer.serverSide.impl.auth.SecuredProjectManager.loadProjects(SecuredProjectManager.java:34)      at jetbrains.buildServer.serverSide.impl.XmlConfigurationExternalizer$1$1.run(XmlConfigurationExternalizer.java:6)      at jetbrains.buildServer.serverSide.impl.cleanup.ServerCleanupManagerImpl.executeWithInactiveCleanup(ServerCleanupManagerImpl.java:109)      at jetbrains.buildServer.serverSide.impl.cleanup.ServerCleanupManagerImpl$$FastClassByCGLIB$$ba2c8525.invoke(<generated>)      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)      at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)      at jetbrains.buildServer.serverSide.impl.auth.TeamCityMethodSecurityInterceptor.invoke(TeamCityMethodSecurityInterceptor.java:8)      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)      at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:582)      at jetbrains.buildServer.serverSide.impl.cleanup.ServerCleanupManagerImpl$$EnhancerByCGLIB$$1fee0260.executeWithInactiveCleanup(<generated>)      at jetbrains.buildServer.serverSide.impl.XmlConfigurationExternalizer$1.doInTransactionWithoutResult(XmlConfigurationExternalizer.java:2)      at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)      at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)      at jetbrains.buildServer.serverSide.impl.XmlConfigurationExternalizer.fillServer(XmlConfigurationExternalizer.java:106)      at jetbrains.buildServer.serverSide.impl.XmlConfigurationExternalizer.fillServer(XmlConfigurationExternalizer.java:213)      at jetbrains.buildServer.web.impl.BuildServerConfigurator.setupBuildServer(BuildServerConfigurator.java:64)      at jetbrains.buildServer.web.impl.BuildServerConfigurator.loadConfiguration(BuildServerConfigurator.java:28)      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:1412)      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1373)      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)      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:217)      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:729)      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:354)      at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:292)      at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:262)      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)      at javax.servlet.GenericServlet.init(GenericServlet.java:212)      at jetbrains.spring.web.TeamCityDispatcherServlet.init(TeamCityDispatcherServlet.java:4)      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)      at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)      at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)      at org.apache.catalina.core.StandardService.start(StandardService.java:516)      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)      at org.apache.catalina.startup.Catalina.start(Catalina.java:578)      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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: jetbrains.buildServer.serverSide.impl.BrokenConfigurationException: org.jdom.input.JDOMParseException: Error on line 8 of document file:/<TeamCity Data Directory>/config/<ProjectName>/project-config.xml: Element type "settings" must be declared.
     at jetbrains.buildServer.serverSide.impl.XmlConfigurationExternalizer.readProject(XmlConfigurationExternalizer.java:95)      at jetbrains.buildServer.serverSide.impl.ProjectManagerImpl$8.run(ProjectManagerImpl.java:20)      ... 75 more Caused by: org.jdom.input.JDOMParseException: Error on line 8 of document file:/<TeamCity Data Directory>/config/<Project>/project-config.xml: Element type "settings" must be declared.      at org.jdom.input.SAXBuilder.build(SAXBuilder.java:501)      at org.jdom.input.SAXBuilder.build(SAXBuilder.java:847)      at org.jdom.input.SAXBuilder.build(SAXBuilder.java:826)      at jetbrains.buildServer.util.FileUtil.parseDocument(FileUtil.java:122)      at jetbrains.buildServer.serverSide.impl.XmlConfigurationExternalizer.readProject(XmlConfigurationExternalizer.java:60)      ... 76 more Caused by: org.xml.sax.SAXParseException: Element type "settings" must be declared.      at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)      at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)      at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)      at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)      at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)      at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)      at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)      at org.jdom.input.SAXBuilder.build(SAXBuilder.java:489)      ... 80 more



We've searched the forums for a solution to this problem, but to no avail.  We've looked through the docs and our configuration and can't find anything that seems like a possible culprit.  Does anyone have any idea what could be causing this?  We've lost a lot of productivity trying to get this copy of our existing TeamCity to work.

2 comments

What were your upgrade steps? It seems TeamCity did not run its' converters, this can occur, if you forgot to copy files from .BuildServer/system directory before starting the new version.

0

We did not perform an upgrade; we were attempting to create a copy of our existing system using the same build of TeamCity (version 4.5.4, build 9071).  We followed the steps enumerated here:
http://confluence.jetbrains.net/display/TCD5/How+To...#HowTo...-MoveTeamCityinstallationtoanewmachine

In short, we copied the entire .BuildServer/, made a copy of our database, created an instance of TeamCity 4.5.4 using the installer, copied over the .BuildServer/ from our original system, changed the database properties file to use our database copy, switched from using the LDAP auth provider to the Default Auth provider, deleted our license key, set the root URL in the main config to be correct, and restarted the TeamCity windows service.  The .BuildSystem/system directory was indeed copied over.

0

Please sign in to leave a comment.