Cannot construct jetbrains.buildServer.agentServer.AgentBuild

I recently had a build agent machine bite the dust, and am in the process of setting up a new one.  Because of this, the Teamcity server is (quite) old, and the agent is new.  I followed the instructions for the zip installation, using the files downloaded from the Teamcity server.  I was able to set up a pair of user agents, authorize them, and start a build, but it immediately fails with the following error in the build log:

[16:12:18]Checking for changes
[16:12:19]Call http://[agentIP]:9091/RPC2 buildAgent.runBuild: org.apache.xmlrpc.XmlRpcException: java.lang.Exception: com.thoughtworks.xstream.converters.ConversionException: Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
---- Debugging information ----
message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
class : jetbrains.buildServer.agentServer.AgentBuild
required-type : jetbrains.buildServer.agentServer.AgentBuild
converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path : /AgentBuild
line number : 1
version : null
-------------------------------
[16:12:19]Build canceled

Here's all the information about the environments, if it's helpful:

Server:
- OS = OSX 10.6.8
- Java = Java SE 1.6.0_65

Old Build Agent:
- OS = OSX 10.??
- Java = Java SE 1.8.0_192

New Build Agent:
- OS = Ubuntu 18.04
- Java = OpenJDK 1.8.0_222

Looking through the documentation for the failing classes, it seems to suggest that the TeamCity server isn't sending a proper build ID, or that it's getting lost somewhere along the way.  I'm not able to find any clues from anything in [buildAgent]/logs/.

Has anyone run into this before, or know of where I can look for more information to debug with?

1
6 comments

This is exactly the issue we are facing. It just started couple days ago.

We also raised the issue with teamcity team (https://teamcity-support.jetbrains.com/hc/requests/2245315)

1

Thanks for adding your experience, Mantas.  Unfortunately, your link 404s for me, so if you make any progress on that front, do you mind cross-posting it here?

0

We are using Teamcity 9 (TeamCity 9.1.7 (build 37573), effective release date 2015-Jul-15) and suddenly all agents stopped working with the error below:

 

Sep 03 09:18:05 tc-build bash[1160]: [2019-09-03 09:18:05,810]   WARN -    jetbrains.buildServer.AGENT - Failed to start build on agent. com.thoughtworks.xstream.converters.ConversionException: Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:05 tc-build bash[1160]: ---- Debugging information ----
Sep 03 09:18:05 tc-build bash[1160]: message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:05 tc-build bash[1160]: cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
Sep 03 09:18:05 tc-build bash[1160]: cause-message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:05 tc-build bash[1160]: class : jetbrains.buildServer.agentServer.AgentBuild
Sep 03 09:18:05 tc-build bash[1160]: required-type : jetbrains.buildServer.agentServer.AgentBuild
Sep 03 09:18:05 tc-build bash[1160]: converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
Sep 03 09:18:05 tc-build bash[1160]: path : /AgentBuild
Sep 03 09:18:05 tc-build bash[1160]: line number : 1
Sep 03 09:18:05 tc-build bash[1160]: version : null
Sep 03 09:18:05 tc-build bash[1160]: -------------------------------
Sep 03 09:18:05 tc-build bash[1160]: com.thoughtworks.xstream.converters.ConversionException: Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:05 tc-build bash[1160]: ---- Debugging information ----
Sep 03 09:18:05 tc-build bash[1160]: message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:05 tc-build bash[1160]: cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
Sep 03 09:18:05 tc-build bash[1160]: cause-message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:05 tc-build bash[1160]: class : jetbrains.buildServer.agentServer.AgentBuild
Sep 03 09:18:05 tc-build bash[1160]: required-type : jetbrains.buildServer.agentServer.AgentBuild
Sep 03 09:18:05 tc-build bash[1160]: converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
Sep 03 09:18:05 tc-build bash[1160]: path : /AgentBuild
Sep 03 09:18:05 tc-build bash[1160]: line number : 1
Sep 03 09:18:05 tc-build bash[1160]: version : null
Sep 03 09:18:05 tc-build bash[1160]: -------------------------------
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1035)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1019)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.XStream.fromXML(XStream.java:895)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.XStream.fromXML(XStream.java:886)
Sep 03 09:18:05 tc-build bash[1160]: at jetbrains.buildServer.xstream.XStreamWrapper.fromXML(XStreamWrapper.java:113)
Sep 03 09:18:05 tc-build bash[1160]: at jetbrains.buildServer.xstream.XStreamWrapper.deserializeObjectInternal(XStreamWrapper.java:258)
Sep 03 09:18:05 tc-build bash[1160]: at jetbrains.buildServer.xstream.XStreamWrapper.deserializeObject(XStreamWrapper.java:234)
Sep 03 09:18:05 tc-build bash[1160]: at jetbrains.buildServer.agentServer.AgentBuild.deserialize(AgentBuild.java:379)
Sep 03 09:18:05 tc-build bash[1160]: at jetbrains.buildServer.agent.impl.BuildAgentImpl.runBuild(BuildAgentImpl.java:206)
Sep 03 09:18:05 tc-build bash[1160]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Sep 03 09:18:05 tc-build bash[1160]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Sep 03 09:18:05 tc-build bash[1160]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Sep 03 09:18:05 tc-build bash[1160]: at java.lang.reflect.Method.invoke(Method.java:498)
Sep 03 09:18:05 tc-build bash[1160]: at org.apache.xmlrpc.Invoker.execute(Invoker.java:130)
Sep 03 09:18:05 tc-build bash[1160]: at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:84)
Sep 03 09:18:05 tc-build bash[1160]: at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:146)
Sep 03 09:18:05 tc-build bash[1160]: at org.apache.xmlrpc.TCXmlRpcServer$TCXmlRpcWorker.execute(TCXmlRpcServer.java:48)
Sep 03 09:18:05 tc-build bash[1160]: at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139)
Sep 03 09:18:05 tc-build bash[1160]: at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:125)
Sep 03 09:18:05 tc-build bash[1160]: at org.apache.xmlrpc.WebServer2$Connection.run(WebServer2.java:774)
Sep 03 09:18:05 tc-build bash[1160]: at org.apache.xmlrpc.WebServer2$Runner.run(WebServer2.java:645)
Sep 03 09:18:05 tc-build bash[1160]: at java.lang.Thread.run(Thread.java:748)
Sep 03 09:18:05 tc-build bash[1160]: Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:71)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:424)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:229)
Sep 03 09:18:05 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
Sep 03 09:18:05 tc-build bash[1160]: ... 27 more
Sep 03 09:18:14 tc-build bash[1160]: [2019-09-03 09:18:14,841] WARN - jetbrains.buildServer.AGENT - Failed to start build on agent. com.thoughtworks.xstream.converters.ConversionException: Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:14 tc-build bash[1160]: ---- Debugging information ----
Sep 03 09:18:14 tc-build bash[1160]: message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:14 tc-build bash[1160]: cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
Sep 03 09:18:14 tc-build bash[1160]: cause-message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:14 tc-build bash[1160]: class : jetbrains.buildServer.agentServer.AgentBuild
Sep 03 09:18:14 tc-build bash[1160]: required-type : jetbrains.buildServer.agentServer.AgentBuild
Sep 03 09:18:14 tc-build bash[1160]: converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
Sep 03 09:18:14 tc-build bash[1160]: path : /AgentBuild
Sep 03 09:18:14 tc-build bash[1160]: line number : 1
Sep 03 09:18:14 tc-build bash[1160]: version : null
Sep 03 09:18:14 tc-build bash[1160]: -------------------------------
Sep 03 09:18:14 tc-build bash[1160]: com.thoughtworks.xstream.converters.ConversionException: Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:14 tc-build bash[1160]: ---- Debugging information ----
Sep 03 09:18:14 tc-build bash[1160]: message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:14 tc-build bash[1160]: cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
Sep 03 09:18:14 tc-build bash[1160]: cause-message : Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:14 tc-build bash[1160]: class : jetbrains.buildServer.agentServer.AgentBuild
Sep 03 09:18:14 tc-build bash[1160]: required-type : jetbrains.buildServer.agentServer.AgentBuild
Sep 03 09:18:14 tc-build bash[1160]: converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
Sep 03 09:18:14 tc-build bash[1160]: path : /AgentBuild
Sep 03 09:18:14 tc-build bash[1160]: line number : 1
Sep 03 09:18:14 tc-build bash[1160]: version : null
Sep 03 09:18:14 tc-build bash[1160]: -------------------------------
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1035)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1019)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.XStream.fromXML(XStream.java:895)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.XStream.fromXML(XStream.java:886)
Sep 03 09:18:14 tc-build bash[1160]: at jetbrains.buildServer.xstream.XStreamWrapper.fromXML(XStreamWrapper.java:113)
Sep 03 09:18:14 tc-build bash[1160]: at jetbrains.buildServer.xstream.XStreamWrapper.deserializeObjectInternal(XStreamWrapper.java:258)
Sep 03 09:18:14 tc-build bash[1160]: at jetbrains.buildServer.xstream.XStreamWrapper.deserializeObject(XStreamWrapper.java:234)
Sep 03 09:18:14 tc-build bash[1160]: at jetbrains.buildServer.agentServer.AgentBuild.deserialize(AgentBuild.java:379)
Sep 03 09:18:14 tc-build bash[1160]: at jetbrains.buildServer.agent.impl.BuildAgentImpl.runBuild(BuildAgentImpl.java:206)
Sep 03 09:18:14 tc-build bash[1160]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Sep 03 09:18:14 tc-build bash[1160]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Sep 03 09:18:14 tc-build bash[1160]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Sep 03 09:18:14 tc-build bash[1160]: at java.lang.reflect.Method.invoke(Method.java:498)
Sep 03 09:18:14 tc-build bash[1160]: at org.apache.xmlrpc.Invoker.execute(Invoker.java:130)
Sep 03 09:18:14 tc-build bash[1160]: at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:84)
Sep 03 09:18:14 tc-build bash[1160]: at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:146)
Sep 03 09:18:14 tc-build bash[1160]: at org.apache.xmlrpc.TCXmlRpcServer$TCXmlRpcWorker.execute(TCXmlRpcServer.java:48)
Sep 03 09:18:14 tc-build bash[1160]: at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139)
Sep 03 09:18:14 tc-build bash[1160]: at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:125)
Sep 03 09:18:14 tc-build bash[1160]: at org.apache.xmlrpc.WebServer2$Connection.run(WebServer2.java:774)
Sep 03 09:18:14 tc-build bash[1160]: at org.apache.xmlrpc.WebServer2$Runner.run(WebServer2.java:645)
Sep 03 09:18:14 tc-build bash[1160]: at java.lang.Thread.run(Thread.java:748)
Sep 03 09:18:14 tc-build bash[1160]: Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct jetbrains.buildServer.agentServer.AgentBuild as it does not have a no-args constructor
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:71)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:424)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:229)
Sep 03 09:18:14 tc-build bash[1160]: at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
Sep 03 09:18:14 tc-build bash[1160]: ... 27 more
Java version:
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

 

Teamcity and agents are on the same machine

Linux tc-build 4.15.0-1047-aws #49-Ubuntu SMP Fri Aug 23 09:02:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

 

2

I've had some degree of success exchanging OpenJDK 1.8.0_222 for Oracle Java-1.8.0_221.  The build agent now seems to initialize builds properly (though it fails Git authentication, which I haven't added keys for yet).  That doesn't explain why your setup has suddenly stopped working, but you might give that a try.

0

Thanks Magus. Switching to Oracle Java fixed the issue. Still puzzled though.

0

Hi Mantas, Magus,

 

thanks for your reports. While current versions of teamcity are thoroughly tested and distributed with the Open JDK, older releases weren't and the Oracle version was recommended. It's possible that you have hit one of those corner cases where the Open JDK wouldn't work. Upgrading to a newer teamcity version, besides being recommended due to all the fixes and new features, should also allow you to run it with the Open JDK without being presented with this issues.

 

Besides having it fixed for now, please consider upgrading going forward

0

Please sign in to leave a comment.