Build agent broken after upgrade

After upgrading my TeamCity installation from 5.1.2 to 6.0.1, the build agent service no longer starts.  Errors from the log file are listed below.  Anyone have an idea what might be causing this?

[2010-12-30 15:21:35,325]   INFO -   jetbrains.buildServer.SERVER - Starting TeamCity agent
[2010-12-30 15:21:35,325]   INFO - s.buildServer.agent.AgentMain2 - Agent home is C:\TeamCity\buildAgent
[2010-12-30 15:21:35,372]   INFO - buildServer.agent.AgentMain2$1 - Refreshing jetbrains.buildServer.agent.AgentMain2$1@1de256f: display name [jetbrains.buildServer.agent.AgentMain2$1@1de256f]; startup date [Thu Dec 30 15:21:35 CST 2010]; root of context hierarchy
[2010-12-30 15:21:36,060]   INFO - buildServer.agent.AgentMain2$1 - Bean factory for application context [jetbrains.buildServer.agent.AgentMain2$1@1de256f]: org.springframework.beans.factory.support.DefaultListableBeanFactory@d56b37
[2010-12-30 15:21:37,919]  ERROR - s.buildServer.agent.AgentMain2 - Failed to create Spring context.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jetbrains.buildServer.agent.impl.config.ServerSideBuildAgentParametersUpdater#0' defined in URL [jar:file:/C:/TeamCity/buildAgent/lib/agent.jar!/META-INF/buildAgentSpring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [jetbrains.buildServer.agent.impl.BuildAgentEx]: : Error creating bean with name 'buildAgent' defined in URL [jar:file:/C:/TeamCity/buildAgent/lib/agent.jar!/META-INF/buildAgentSpring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [jetbrains.buildServer.agent.impl.BuildAgentImpl]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: jetbrains.buildServer.parameters.impl.ParametersInOut.<init>(Ljava/lang/String;Ljetbrains/buildServer/parameters/ParametersProvider;Ljetbrains/buildServer/parameters/impl/ParametersProviderFactory;)V; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'buildAgent' defined in URL [jar:file:/C:/TeamCity/buildAgent/lib/agent.jar!/META-INF/buildAgentSpring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [jetbrains.buildServer.agent.impl.BuildAgentImpl]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: jetbrains.buildServer.parameters.impl.ParametersInOut.<init>(Ljava/lang/String;Ljetbrains/buildServer/parameters/ParametersProvider;Ljetbrains/buildServer/parameters/impl/ParametersProviderFactory;)V
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:591)
    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.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at jetbrains.buildServer.agent.AgentMain2$1.<init>(AgentMain2.java:63)
    at jetbrains.buildServer.agent.AgentMain2.createRootApplicationContext(AgentMain2.java:50)
    at jetbrains.buildServer.agent.AgentMain2.main(AgentMain2.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at jetbrains.buildServer.agent.AgentMain.main(AgentMain.java:41)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'buildAgent' defined in URL [jar:file:/C:/TeamCity/buildAgent/lib/agent.jar!/META-INF/buildAgentSpring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [jetbrains.buildServer.agent.impl.BuildAgentImpl]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: jetbrains.buildServer.parameters.impl.ParametersInOut.<init>(Ljava/lang/String;Ljetbrains/buildServer/parameters/ParametersProvider;Ljetbrains/buildServer/parameters/impl/ParametersProviderFactory;)V
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254)
    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.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)
    ... 25 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [jetbrains.buildServer.agent.impl.BuildAgentImpl]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: jetbrains.buildServer.parameters.impl.ParametersInOut.<init>(Ljava/lang/String;Ljetbrains/buildServer/parameters/ParametersProvider;Ljetbrains/buildServer/parameters/impl/ParametersProviderFactory;)V
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248)
    ... 40 more
Caused by: java.lang.NoSuchMethodError: jetbrains.buildServer.parameters.impl.ParametersInOut.<init>(Ljava/lang/String;Ljetbrains/buildServer/parameters/ParametersProvider;Ljetbrains/buildServer/parameters/impl/ParametersProviderFactory;)V
    at jetbrains.buildServer.agent.impl.parameters.resolve.ParametersResolverStrategy$1.createFrom(ParametersResolverStrategy.java:43)
    at jetbrains.buildServer.agent.impl.parameters.resolve.ParametersResolverStrategy$1.createFrom(ParametersResolverStrategy.java:42)
    at jetbrains.buildServer.util.CollectionsUtil.filterAndConvertCollection(CollectionsUtil.java:77)
    at jetbrains.buildServer.util.CollectionsUtil.filterAndConvertCollection(CollectionsUtil.java:61)
    at jetbrains.buildServer.util.CollectionsUtil.convertCollection(CollectionsUtil.java:127)
    at jetbrains.buildServer.agent.impl.parameters.resolve.ParametersResolverStrategy.doResolve(ParametersResolverStrategy.java:38)
    at jetbrains.buildServer.agent.impl.parameters.factory.ParametersBuilder$2.<init>(ParametersBuilder.java:108)
    at jetbrains.buildServer.agent.impl.parameters.factory.ParametersBuilder.resolveAgentParameters(ParametersBuilder.java:103)
    at jetbrains.buildServer.agent.impl.parameters.factory.AgentUnresolvedParametersFactory$1.resolve(AgentUnresolvedParametersFactory.java:41)
    at jetbrains.buildServer.agent.impl.parameters.factory.AgentUnresolvedParametersFactory$1.resolve(AgentUnresolvedParametersFactory.java:39)
    at jetbrains.buildServer.agent.impl.parameters.impl.CachedResolvable.resolve(CachedResolvable.java:52)
    at jetbrains.buildServer.agent.impl.config.AgentContextImpl.getConfigurationParameters(AgentContextImpl.java:48)
    at jetbrains.buildServer.agent.impl.config.BuildAgentConfigurationImpl.getCustomProperties(BuildAgentConfigurationImpl.java:76)
    at jetbrains.buildServer.agent.impl.config.BuildAgentConfigurationImpl.getInternalProperty(BuildAgentConfigurationImpl.java:108)
    at jetbrains.buildServer.agent.impl.config.BuildAgentConfigurationImpl.getServerConnectionTimeout(BuildAgentConfigurationImpl.java:118)
    at jetbrains.buildServer.agent.impl.BuildAgentImpl.<init>(BuildAgentImpl.java:104)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
    ... 42 more

8 comments
Comment actions Permalink

Please describe your upgrade procedure. Did you do anything with the agents after the new server started?

0
Comment actions Permalink

No, I didn't do anything with the agent during the update.  After the installer ran I tried to log into the web interface and it prompted me to do a data upgrade.  When that finished I was able to log in and noticed the build agent had a disconnected status.  The agent service was stopped so I tried to start it several times but I have not been able to get it to start successfully.

0
Comment actions Permalink

Chances are the agent tried to perform upgrade when you restarted the service. Usually agent is able to upgrade itself. At this time agent service can be shown as stopped. I would say that in the worst case agent upgrade can take about 5 minutes, if upgrade did not finish within that time then probably there is some process which locks agent files and agent can't kill it. The reason of the failed upgrade should be in the agent logs.

Anyway, now you have to reinstall agent. You can chose the same directory where it was installed to preserve configuration.

0
Comment actions Permalink

I reinstalled the build agent but the service still won't start.  The logs don't show anything about a failed upgrade, only the exceptions I posted earlier about not being able to create the Spring context.

0
Comment actions Permalink

Please stop the agent service, then kill all of the running java processes, then try to start agent service again. If it does not help attach agent logs.

0
Comment actions Permalink

Ok, it seems the agent installation is still broken, try to reinstall it again.


0
Comment actions Permalink

It's finally working.  This time I completely uninstalled the existing agent and removed all files from the TeamCity\buildAgent directory before reinstalling.  Thanks for your help.

0

Please sign in to leave a comment.