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?



Attachment(s):
configs.PNG
img.PNG
16 comments
Comment actions Permalink

Can someone help me please?

0
Comment actions Permalink

Roberto,

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.

0
Comment actions Permalink

Roberto,

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.

0
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.



Attachment(s):
Fenix_sample_Maven_Webapp_1.0.61.log.zip
0
Comment actions Permalink

Roberto,

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

0
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.

Attachment(s):
sample.rar.zip
Fenix_Ant_Build_Teste_1.log.zip
0
Comment actions Permalink

Roberto,

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.

0
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?

0
Comment actions Permalink

Robert,

> 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 (agnet.sh start).
Next, I'd try to connect to the port from a test script run as a build in TeamCity.

0
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 agent.sh start

result:
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/buildAgent.properties.lock
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?

0
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 agent.sh start) I get this message:
Build agent is already running with PID 31084



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

Roberto,

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?

0
Comment actions Permalink

Ok.

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.

0
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

0
Comment actions Permalink

Hello!

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 -Dagent.name=Default Agent -Dagent.ownPort=9090 -Dagent.work.dir=/home/teamcity/TeamCity/buildAgent/work -Dbuild.number=3 -Dbuild.vcs.number=90908dbd0e8441b4a458f41654d743287e86cd71 -Dbuild.vcs.number.1=90908dbd0e8441b4a458f41654d743287e86cd71 -Dbuild.vcs.number.Project_BitBucketProject=90908dbd0e8441b4a458f41654d743287e86cd71 -Didea.build.agent.port=9090 -Didea.config.path=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/config -Didea.home.path=/home/teamcity/TeamCity/buildAgent/tools/idea -Didea.jars.nocopy=true -Didea.no.jdk.check=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.io.tmpdir=/home/teamcity/TeamCity/buildAgent/temp/buildTmp -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.build.changedFiles.file=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/changedFiles1543570508164717041.txt -Dteamcity.build.checkoutDir=/home/teamcity/TeamCity/buildAgent/work/a3e3cb3e7cecbc65 -Dteamcity.build.id=6 -Dteamcity.build.properties.file=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/teamcity.build8175351823851318265.properties -Dteamcity.build.tempDir=/home/teamcity/TeamCity/buildAgent/temp/buildTmp -Dteamcity.build.workingDir=/home/teamcity/TeamCity/buildAgent/work/a3e3cb3e7cecbc65 -Dteamcity.buildConfName=Build -Dteamcity.buildType.id=Project_Build -Dteamcity.configuration.properties.file=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/teamcity.config3798270198648422350.properties -Dteamcity.projectName=Project -Dteamcity.runner.properties.file=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/teamcity.runner6019958276168666182.properties -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 -Dagent.name=Default 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.build.agent.port=9090 -Didea.config.path=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/config -Didea.home.path=/
home/teamcity/TeamCity/buildAgent/tools/idea -Didea.jars.nocopy=true -Didea.no.jdk.check=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.io.tmpdir=/home/teamcity/TeamCity/buildAgent/temp/buildTmp -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 -Dteamcity.build.changedFiles.file=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/changedFiles497831
0227417196337.txt -Dteamcity.build.checkoutDir=/home/teamcity/TeamCity/buildAgent/work/a3e3cb3e7cecbc65 -Dteamcity.build.id=4 -Dteamcity.build.properties.file=/home/teamcity/TeamCity/buildAgent/tem
p/buildTmp/teamcity.build2395523136064391875.properties -Dteamcity.build.tempDir=/home/teamcity/TeamCity/buildAgent/temp/buildTmp -Dteamcity.build.workingDir=/home/teamcity/TeamCity/buildAgent/work
/a3e3cb3e7cecbc65 -Dteamcity.buildConfName=Build -Dteamcity.buildType.id=Project_Build -Dteamcity.configuration.properties.file=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/teamcity.config6418
223806043569518.properties -Dteamcity.projectName=Project -Dteamcity.runner.properties.file=/home/teamcity/TeamCity/buildAgent/temp/buildTmp/teamcity.runner1912814122297235624.properties -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
sspath/p:/home/teamcity/TeamCity/buildAgent/tools/idea/lib/boot.jar
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.

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

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

Please sign in to leave a comment.