JetBrains / teamcity-deployer-plugin

Deployer plugin for TeamCity CI server
http://confluence.jetbrains.net/display/TW/Deployer+plugin
Apache License 2.0
39 stars 29 forks source link

Container deployment fails. Zero failure information provided #86

Closed jonahadmin closed 8 years ago

jonahadmin commented 8 years ago

When attempting to deploy a war file to tomcat 8, the deployment fails, and the plugin gives absolutely no information at all as to what caused the failure. Below is the full text of a typical build (war file and hostname renamed from actual). This is while using Teamcity 9.1.6. We have now abandoned use of the plugin.

[10:44:17]Skip checking for changes - there are no VCS roots defined
[10:44:17]Clearing temporary directory: /opt/TeamCity/buildAgent/temp/buildTmp
[10:44:17]Publishing internal artifacts (1s)
[10:44:17]Checkout directory: /opt/TeamCity/buildAgent/work/57e017c5f7c7861b
[10:44:17]Resolving artifact dependencies
[10:44:17]Step 1/1: Deploy to Tomcat (Container Deployer) (2m:07s)
[10:44:17][Step 1/1] Deploying [test.war] to [testserver:8080], container type [tomcat8x]
[10:46:25][Step 1/1] org.codehaus.cargo.container.ContainerException: Failed to redeploy [/opt/TeamCity/buildAgent/work/57e017c5f7c7861b/test.war]
[10:46:25][Step 1/1] Step Deploy to Tomcat (Container Deployer) failed
[10:46:25]Publishing internal artifacts
[10:46:25][Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[10:46:25][Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[10:46:25]Build finished
nskvortsov commented 8 years ago

@jonahadmin thank you for the report. What build of the plugin was used? (this information can be found at "Plugins List" page of Administration area) Please take a look a teamcity-agent.log file, it may contain relevant information.

jonahadmin commented 8 years ago

snapshot-20151228175849, which is what was linked from https://confluence.jetbrains.com/display/TW/Deployer+plugin

nskvortsov commented 8 years ago

I see. Sorry for the bad link. I have updated it to latest build. Please, give it a try.

jonahadmin commented 8 years ago

Same issue with the current built. It produces zero logging information.

nskvortsov commented 8 years ago

Thanks for trying. Are there any errors or warnings in teamcity-agent.log? 17 июня 2016 г. 20:18 пользователь "jonahadmin" notifications@github.com написал:

Same issue with the current built. It produces zero logging information.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JetBrains/teamcity-deployer-plugin/issues/86#issuecomment-226828507, or mute the thread https://github.com/notifications/unsubscribe/AAg5k4n0Ew--3CQQt7JIMSkzezuF_mqNks5qMtb3gaJpZM4I4g_A .

jonahadmin commented 8 years ago

O_o Well that's just odd...

jetbrains.buildServer.RunBuildException: org.codehaus.cargo.container.ContainerException: Failed to deploy [/opt/TeamCity/buildAgent/work/57e017c5f7c7861b/mywar.war] at jetbrains.buildServer.deployer.agent.cargo.CargoBuildProcessAdapter.runProcess(CargoBuildProcessAdapter.java:116) at jetbrains.buildServer.deployer.agent.SyncBuildProcessAdapter.start(SyncBuildProcessAdapter.java:58) at jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallRunnerStage.doBuildStage(CallRunnerStage.java:58) 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:78) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:37) at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor.doStages(RunnerStagesExecutor.java:18) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.RunnerContextExecutor.callRunnerStages(RunnerContextExecutor.java:43) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.StepExecutor.processNextStep(StepExecutor.java:25) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeRunnerStep(ForEachBuildRunnerStage.java:138) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.runStep(ForEachBuildRunnerStage.java:123) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeBuildRunners(ForEachBuildRunnerStage.java:83) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.doBuildStage(ForEachBuildRunnerStage.java:44) 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:78) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:37) at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor.doStages(BuildStagesExecutor.java:24) at jetbrains.buildServer.agent.impl.BuildRunActionImpl.doStages(BuildRunActionImpl.java:70) at jetbrains.buildServer.agent.impl.BuildRunActionImpl.runBuild(BuildRunActionImpl.java:50) at jetbrains.buildServer.agent.impl.BuildAgentImpl.doActualBuild(BuildAgentImpl.java:288) at jetbrains.buildServer.agent.impl.BuildAgentImpl.access$100(BuildAgentImpl.java:53) at jetbrains.buildServer.agent.impl.BuildAgentImpl$1.run(BuildAgentImpl.java:252) at java.lang.Thread.run(Thread.java:745) Caused by: org.codehaus.cargo.container.ContainerException: Failed to deploy [/opt/TeamCity/buildAgent/work/57e017c5f7c7861b/mywar.war] at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:111) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:185) at jetbrains.buildServer.deployer.agent.cargo.CargoBuildProcessAdapter.runProcess(CargoBuildProcessAdapter.java:114) ... 24 more Caused by: java.io.FileNotFoundException: /opt/TeamCity/buildAgent/work/57e017c5f7c7861b/mywar.war (Is a directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at java.io.FileInputStream.(FileInputStream.java:93) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:102) ... 26 more

I can't even guess as to how the artifact managed to get copied to the build agent in such a strange way. I'll have to fix that... Either way, the error should have been displayed in the build log. Really... any exception should be shown in the build log.

jonahadmin commented 8 years ago

Ok, apparently the teamcity-agent.log and the output.log are telling me why the deployment is failing, so at least it's now possible to proceed. However, it goes without saying that this info really should be displayed in the teamcity build log.

nskvortsov commented 8 years ago

Thank you for the followup. I will definetly add some information to logs. As to how artifact became a directory - TeamCity does not support renaming artifacts when resolving a dependency. So dependency target path (after the "=>") is always processed as directory E.g. artifact dependency

my-artifact-1.0.war => mywar.war

will no rename the artifact to mywar.war, but instead will create directory "mywar.war" and download my-artifact-1.0.war to this dir.

jonahadmin commented 8 years ago

Yes, I quickly figured out what my problem with with the build once I had logging information. I was mostly frustrated that nothing was being displayed in the build log, and assumed that no logging information was being generated at all.

nskvortsov commented 8 years ago

Fixed by this commit