ToolCannotBeFoundException: Cannot find IntelliJ IDEA installation
Hello.
We are using obsolete IPR runner for running tests.
For some reason, after upgrading to Teamcity 7 we got such exception
Failed to start build runner 'Ipr' jetbrains.buildServer.agent.ToolCannotBeFoundException: Cannot find IntelliJ IDEA installation at jetbrains.buildServer.agent.impl.IdeaToolProvider.getPath(IdeaToolProvider.java:55) at jetbrains.buildServer.agent.impl.BuildRunnerContextImpl.getToolPath(BuildRunnerContextImpl.java:151) at jetbrains.buildServer.agent.ideaRunner.IprService.generateIntegrationXmlFile(IprService.java:257) at jetbrains.buildServer.agent.ideaRunner.IprService.waitFor(IprService.java:146) at jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallRunnerStage.doBuildStage(CallRunnerStage.java:57) at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:25) at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:18) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:76) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:36) at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor.doStages(RunnerStagesExecutor.java:18) at jetbrains.buildServer.agent.impl.buildStages.startStages.RunnerContextExecutor.callRunnerStages(RunnerContextExecutor.java:40) at jetbrains.buildServer.agent.impl.buildStages.startStages.ForEachBuildRunnerStage.doBuildStage(ForEachBuildRunnerStage.java:68) at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:31) at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:24) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:76) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:36) at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor.doStages(BuildStagesExecutor.java:24) at jetbrains.buildServer.agent.impl.BuildRunAction.doStages(BuildRunAction.java:70) at jetbrains.buildServer.agent.impl.BuildRunAction.runBuild(BuildRunAction.java:50) at jetbrains.buildServer.agent.impl.BuildAgentImpl.doActualBuild(BuildAgentImpl.java:242) at jetbrains.buildServer.agent.impl.BuildAgentImpl.access$100(BuildAgentImpl.java:47) at jetbrains.buildServer.agent.impl.BuildAgentImpl$1.run(BuildAgentImpl.java:215) at java.lang.Thread.run(Thread.java:662)
Does anyone have a solution?
Please sign in to leave a comment.
Grigory, do you still have this problem?
Yes, I do.
A couple days ago we've upgraded from Teamcity version 6 to Teamcity 7. All our agents have successfully downloaded new plugins and upgraded. And I saw this error first time
After that I've reinstalled one of my agents and the problem gone.
Today we installed Teamcity 7.0.1 - all agents have upgraded again. And after that I saw this error again (is has appeared on the fixed agent too).
After reinstalling all agents problem gone.
I don't remember exactly (and I can't check it after reinstall), but I think that %agent.home.dir%/plugins/idea didn't exist after upgrade.
IntelliJ IDEA bundled with TeamCity has been moved under the <agent inst dir>/tools directory. So it is correct that idea directory did not appear under plugins. We made this movement because IDEA is not actually an agent plugin but rather a tool.
Okay, I got it.
Is this setting correct:
system.teamcity.idea.home=%system.agent.home.dir%/plugins/idea
I have this in my buildAgent.properties
No, it is not. It should be:
system.teamcity.idea.home=%system.agent.home.dir%/tools/idea
Actually I am not sure you need it, as TeamCity agent should be able to find IDEA wihtout problems. The only reason you can use it is to be able to reference it from your own builds.
Okay, thank you!
I will fix it.
I would like to mention, that this setting is still exist in buildAgent.dist.properties in latest build of Teamcity.
Thank you for pointing that. Most likely we'll remove this property as it is deprecated.
The problem rise again.
Now we are not able to run Java Inspections on all our agents.
Searching the log, I've found this:
Next, I've made a copy of my build agent's folder and reinstalled it.
Comparison of my old copy and reinstalled expose differences in folders: in my copy was folder plugins/idea.
Then I've found confirmation in log:
As you can see, I've got two idea folders. I don't know where from the other folder appears - I don't create it and I doubt anyone does.
Here is it's contents:
How can be this fixed?
Thanks in advance.
When agent is installed, it does not have any plugins, only core components. When agent starts it tries to register on the server and check whether it needs to download any plugins. Necessary plugins and tools are downloaded automatically, and installed in appropriate places. This is how tools/idea folder appears. There should not be any plugins/idea directories when upgrade finishes.
I would suggest to install fresh version of agent, wait till it upgrades and if you still see both tools/idea and plugins/idea, attach here logs from the agent.
Yep, everything works exactly this way: at first time agent runs it downloads and installs plugins and the plugins directory doesn't contain idea folder. But after some time it appears and I don't know when it hapens.
Fresh installation also helps but it easier to delete plugins/idea.
I've uploaded logs from one agent to your ftp with the name of this topic.
What files do you have under .BuildServer/plugins directory?
It is empty.
This problem started to reproduce after the server upgrade? If so, from which version did you upgrade your server?
I suppose yes - we didn't encounter this before.
We had some discussion by email and you gave us 6.0.4 (15989) build (we got some VCS hanging problems).
We used this version for about a year and then upgraded to TC7.
Since you are using Linux, is it possible that during upgrade you unpacked new distribution over the previous one? If so, you probably have some old files left from the older version of TeamCity. In TeamCity 7.0 there must be directory called idea-tool under <TeamCity inst dir>/WEB-INF/plugins, and there must not be <TeamCity inst dir>/WEB-INF/plugins/idea directory. If you have this directory, then this can be the cause of your problems.
If I understand you, I should check Teamcity server (not agent) folder /var/tainted/TeamCity/webapps/ROOT/WEB-INF/plugins, here is it's filtered contents:
As you can see, idea folder is not presented here.
Also, when we installs new version of Teamcity we never copy it contents into existing directory - firrst backuping old version and then unpacking new clean version.
Have you analyzed logs? Did they helped?
May be this is helpful:
Hello,
Please attach server logs. I need to see where had it found one more IDEA.
What files do you see under /var/tainted/build-agent/tools/idea and /var/tainted/build-agent/plugins/idea?
May /var/tainted/build-agent/plugins/idea folder be created by your build on agent?
Hello, Eugene.
I've uploaded server logs with the topic's name to your ftp. Earlier I've attached agent's logs too.
Here is contents of folders you wish to see:
agent_test - it's a backup copy of corrupted agent version.
I doubt that plugins/idea is created by our builds. Apparently it contents it's created by TC.
Hello.
Today I've checked again plugin's folder of one of my agents and here what I've found:
idea-tool folder is missing and only idea present.
Have you analyzed our logs?
I've found a problem - one of our build was generating this folder.
Apologise for this :(
Great, thanks for sharing the cause of the issue.