TeamCity Duplicates finder (Java) does not work on linux

I'm setting up a continuous integration server with TeamCity.

I configured a build with Duplicates Finder (java).

gave error:
Tests passed: 2; error message is logged; process exited with code 255

Build errors
[13:30:02] Step 2/3: Duplicate Code (Duplicates Finder (Java)) (1s)
[13:30:04] [Step 2/3] Upload duplicate fragments
[13:30:04] [Upload duplicate fragments] Fragments date not found in file / home/sysmo/TeamCity/buildAgent/temp/buildTmp/duplicates3350364825119326364/fragments.xml
[13:30:04] [Step 2/3] Upload duplicates
[13:30:04] [Upload duplicates] Duplicates date not found in file / home/sysmo/TeamCity/buildAgent/temp/buildTmp/duplicates3350364825119326364/duplicates.xml
[13:30:04] [Step 2/3] Step Duplicate Code (Duplicates Finder (Java)) failed

I came to realize that the build agent works correctly in Windows, but does not work in linux (Suse 12.2). (See image).

Any tips on how to solve this problem?

Comment actions Permalink

Can someone help me please?

Comment actions Permalink


If would be easier if you can attach full build log as there might be relevant messages.

It seems that the duplicates finder fails for some reason. One of possible reasons is JVM memory issues: either too small that is fails with OutOfMemory (so need to increase -Xmx), or large for the JVM to initiazlize on the machine.

Comment actions Permalink


Pleae check that the processes launched by the TeamCity agent can connect to the agent's port (http://localhost:9090 in the case from the logs). Seems like this is not the case for the build, while this is a necessary pre-requisite for the due functionaing of TeamCity agent logic.

Comment actions Permalink

I think so, the TeamCity can connect to http://localhost:9090 . If I simply disable the Duplicate Finder and Inspections (Java) the build works.

Attached the full log with duplicate finder and Inspections (Java) disabled.

Comment actions Permalink


Sone runners do work. But not the others.
Can you please try Ant build runner?

Comment actions Permalink

I never used Ant. I created the project using the command "mvn ant:ant". I hope this is the correct procedure.

Same problem. Follow the log.

I have attached the project.

Comment actions Permalink


Idea duplicates and inspectinos runned will not works until the process launched fromt he agent can connect to the agent's port (http://localhost:9090 in the case from the logs).
Maven runner does not need the ability.
I asked you to try Ant as it also requires the ability to connect to the port and would expose the same issue.

Comment actions Permalink

Ok, but I do not understand how this can be happening..

How can I test this?

The "TeamCity" and "Linux Agent" are on the same computer (Same OS, Same IP).
How could he not have access to port 9090?

Comment actions Permalink


> How could he not have access to port 9090?

I am not a Linux administratino guru, so won't help you much here.

I'd start by opening the address ( http://localhost:9090 , but may vary, can be seen in the command line in the build log) on the agent machine in the browser (message "Method GET not implemented" means the agent is accessible). You might need ot run theat on behalf of the same user running TeamCity agent.

If it works, I'd try to run the agent from the same user's console ( start).
Next, I'd try to connect to the port from a test script run as a build in TeamCity.

Comment actions Permalink

I open the browser with this adress:localhost:9090
Received: Method GET not implemented (try POST)

Then I execute the command:
sysmo@linux-to6j:~/buildAgent/bin> sh start

Starting TeamCity build agent...
Java executable is found in '/usr/java/default/jre'.
Starting TeamCity Build Agent Launcher...
Agent home directory is /home/sysmo/buildAgent
Current Java runtime version is 1.7
Lock file: /home/sysmo/buildAgent/logs/
Using no lock
Done [8169], see log at ../logs/teamcity-agent.log

I tried to run the build again (in TeamCity) and the same error occurred.

What do I do now?

Comment actions Permalink

I discovered that I have two agents installed in linux.
One is in / home / sysmo / buildAgent and another is in / home / sysmo / TeamCity / buildAgent.

When attempting to boot the agent default (/home/sysmo/TeamCity/buildAgent/bin # sh start) I get this message:
Build agent is already running with PID 31084

Anyway, the two agents, the same problem occurs.
Comment actions Permalink


Please check that you have only one agent running (one agent uses two nested java processes).

Could you please also try to install the agent on another machine to see if that is specific to environment?

Comment actions Permalink


I'll try to install an agent on another machine. But it will take some time. Once I have the result I post here.

Thank you.

Comment actions Permalink

I installed an agent on a virtual machine with Ubuntu 12.04. It worked!

But I still need to work on the machine with Suse 12.2

Comment actions Permalink


I have the same problem with Duplicate finder (Java) and Inspections (IntelliJ IDEA) as well. Did you found solution for SUSE?

TeamCity 9.1.1, build agent started on the same machine, CentOS 7.1.1503 x64 with latest updates, jdk1.8.0_60.

Tried to stop firewall to make sure that there is no any connectivity issue.

Tried to setup the same on my local computer - it works ok. The difference is in OS and KDE. (it works on Fedora 22 + KDE, but does not work on CentOS 7.1 without X server).

Build log output:

Step 1/1: Find duplicates (Duplicates finder (Java)) (2m:10s)
[01:02:47][Step 1/1] Initialization
[01:02:47][Step 1/1] Starting: /usr/java/jdk1.8.0_60/bin/java -Dagent.home.dir=/home/teamcity/TeamCity/buildAgent Agent -Dagent.ownPort=9090 -Dbuild.number=3 -Dbuild.vcs.number=90908dbd0e8441b4a458f41654d743287e86cd71 -Dbuild.vcs.number.1=90908dbd0e8441b4a458f41654d743287e86cd71 -Dbuild.vcs.number.Project_BitBucketProject=90908dbd0e8441b4a458f41654d743287e86cd71 -Didea.config.path=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/config -Didea.home.path=/home/teamcity/TeamCity/buildAgent/tools/idea -Didea.jars.nocopy=true -Didea.plugins.path=/home/teamcity/TeamCity/buildAgent/tools/idea/plugins -Didea.system.path=/home/teamcity/TeamCity/buildAgent/system/.intellij_idea/a3e3cb3e7cecbc65/system -Djava.awt.headless=true -Djava.library.path=/home/teamcity/TeamCity/buildAgent/tools/idea/bin -Dnewlocalvcs.disabled=true -Dteamcity.agent.cpuBenchmark=455 -Dteamcity.agent.dotnet.agent_url=http://localhost:9090/RPC2 -Dteamcity.agent.dotnet.build_id=6 -Dteamcity.auth.password=E9rJRxg395r5ixQ5j1WB6wXTNaklkih7 -Dteamcity.auth.userId=TeamCityBuildId=6 -Dteamcity.buildConfName=Build -Dteamcity.projectName=Project -Dteamcity.tests.recentlyFailedTests.file=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/testsToRunFirst1835031886529974972.txt -Dteamcity.version=9.1.1 (build 37059) -Xmx1G -XX:MaxPermSize=250m -Xbootclasspath/p:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/boot.jar -classpath /usr/java/latest/lib/tools.jar:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/bootstrap.jar:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/extensions.jar:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/openapi.jar:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/util.jar:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/jdom.jar:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/log4j.jar:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/trove4j.jar:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/jna.jar com.intellij.idea.Main duplocate /home/teamcity/TeamCity/buildAgent/work/a3e3cb3e7cecbc65 false /home/teamcity/TeamCity/buildAgent/temp/buildTmp/duplicates6121568952360914319 10 0 true false false true true true
[01:02:47][Step 1/1] in directory: /home/teamcity/TeamCity/buildAgent/work/a3e3cb3e7cecbc65
[01:02:47][Step 1/1] Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=250m; support was removed in 8.0
[01:04:57][Step 1/1] This IDEA distribution is only licensed to be used with JetBrains TeamCity.
[01:04:57][Step 1/1] Process exited with code 7

I found IDEA logs:
2015-09-09 01:44:40,541 [      0]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------

2015-09-09 01:44:40,764 [    223]   INFO -        #com.intellij.idea.Main - IDE: IntelliJ IDEA (build #IU-141.1532.4, 18 Jun 2015 00:00)
2015-09-09 01:44:40,764 [    223]   INFO -        #com.intellij.idea.Main - OS: Linux (3.10.0-229.11.1.el7.x86_64, amd64)
2015-09-09 01:44:40,764 [    223]   INFO -        #com.intellij.idea.Main - JRE: 1.8.0_60-b27 (Oracle Corporation)
2015-09-09 01:44:40,764 [    223]   INFO -        #com.intellij.idea.Main - JVM: 25.60-b23 (Java HotSpot(TM) 64-Bit Server VM)
2015-09-09 01:44:40,767 [    226]   INFO -        #com.intellij.idea.Main - JVM Args: -Dagent.home.dir=/home/teamcity/TeamCity/buildAgent Agent -Dagent.ownPort=9090 -Dagent.wor
k.dir=/home/teamcity/TeamCity/buildAgent/work -Dbuild.number=2 -Dbuild.vcs.number=90908dbd0e8441b4a458f41654d743287e86cd71 -Dbuild.vcs.number.1=90908dbd0e8441b4a458f41654d743287e86cd71 -Dbuild.vcs.
number.Project_BitBucketProject=90908dbd0e8441b4a458f41654d743287e86cd71 -Didea.config.path=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/config -Didea.home.path=/
home/teamcity/TeamCity/buildAgent/tools/idea -Didea.jars.nocopy=true -Didea.plugins.path=/home/teamcity/TeamCity/buildAgent/tools/idea/plugins -Didea.system.path=/home/team
city/TeamCity/buildAgent/system/.intellij_idea/a3e3cb3e7cecbc65/system -Djava.awt.headless=true -Djava.library.path=/home/teamcity/
TeamCity/buildAgent/tools/idea/bin -Dnewlocalvcs.disabled=true -Dteamcity.agent.cpuBenchmark=455 -Dteamcity.agent.dotnet.agent_url=http://localhost:9090/RPC2 -Dteamcity.agent.dotnet.build_id=4 -Dte
amcity.auth.password=mJxQ2Eqq0tYrJnfHPF9fYOc7OnMe7JiK -Dteamcity.auth.userId=TeamCityBuildId=4
/a3e3cb3e7cecbc65 -Dteamcity.buildConfName=Build -Dteamcity.projectName=Project -Dteamcit
y.tests.recentlyFailedTests.file=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/testsToRunFirst5034930692637421667.txt -Dteamcity.version=9.1.1 (build 37059) -Xmx1G -XX:MaxPermSize=250m -Xbootcla
2015-09-09 01:44:40,812 [    271]   INFO -        #com.intellij.idea.Main - JNA library loaded (64-bit) in 44 ms
2015-09-09 01:46:48,124 [ 127583]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE SHUTDOWN -----------------------------------------------------

I guess it would be good idea to configure integrated IDEA to make more detailed logs, but I have no idea how to do this.

Tried to install to Fedora 22 server configuration - the same issue.

Solution found
The problem is in server hostname and DNS. Your server FDN name should be correct. For example if you set it to - you have to setup appropriate DNS or add appropriate recrort to the /etc/hosts file (like localhost

Please sign in to leave a comment.