com.atlassian.bamboo.task.TaskException: Failed to execute task

Atlassian JIRA | Deric Lee | 7 months ago
  1. 0

    h3. Summary Non-detached Docker containers started from Bamboo are not stopped if build was cancelled manually. These containers will continue running and consume CPU on the host. h3. Steps to Reproduce # Configure build plan to start a Docker container # Start the build # When build is running, manually cancel the build using {{Actions >> Stop build}} h3. Expected Results The task should end gracefully by cleaning up the non detached docker containers it has spun up h3. Actual Results Docker containers started by the build will continue running in the background consuming CPU. The below exception is thrown in the atlassian-bamboo.log file: {noformat} 2016-05-11 13:27:34,864 INFO [13-BAM::Default Agent::Agent:pool-29-thread-1] [TaskResultBuilder] DOCK-TEST-JOB1-15: Failing task since return code of [/usr/local/bin/docker run --volume /Users/brosa/Documents/Atlassian/bamboo/bamboo-5.9.7/home/xml-data/build-dir/DOCK-TEST-JOB1:/data --workdir /data --rm brosadocker/customized-bamboo-java-agent:1.0.0] was 141 while expected 0 2016-05-11 13:27:34,865 INFO [13-BAM::Default Agent::Agent:pool-29-thread-1] [DefaultErrorHandler] Recording an error: Error occurred while running Task '(2)' of type com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli. : DOCK-TEST-JOB1 : Failed to execute task 2016-05-11 13:27:34,865 ERROR [13-BAM::Default Agent::Agent:pool-29-thread-1] [TaskExecutorImpl] Error occurred while running Task '(2)' of type com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli. com.atlassian.bamboo.task.TaskException: Failed to execute task at com.atlassian.bamboo.plugins.docker.service.RunService.execute(RunService.java:70) at com.atlassian.bamboo.plugins.docker.tasks.cli.DockerCliTask.execute(DockerCliTask.java:60) at com.atlassian.bamboo.task.TaskExecutorImpl$3.call(TaskExecutorImpl.java:288) at com.atlassian.bamboo.task.TaskExecutorImpl$3.call(TaskExecutorImpl.java:284) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:200) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:284) at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:106) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:124) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:115) at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:114) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.bamboo.plugins.docker.client.DockerException: Error running Docker run command at com.atlassian.bamboo.plugins.docker.client.DockerCmd.run(DockerCmd.java:103) at com.atlassian.bamboo.plugins.docker.service.RunService.execute(RunService.java:59) ... 18 more Caused by: com.atlassian.utils.process.ProcessException: Error executing /usr/local/bin/docker run --volume /Users/brosa/Documents/Atlassian/bamboo/bamboo-5.9.7/home/xml-data/build-dir/DOCK-TEST-JOB1:/data --workdir /data --rm brosadocker/customized-bamboo-java-agent:1.0.0 at com.atlassian.bamboo.plugins.docker.process.DockerTaskProcessService.execute(DockerTaskProcessService.java:60) at com.atlassian.bamboo.plugins.docker.client.DockerCmd.run(DockerCmd.java:99) ... 19 more {noformat} h3.Workaround If a build was stopped manually, the docker containers will need to be stopped manually.

    Atlassian JIRA | 7 months ago | Deric Lee [Atlassian]
    com.atlassian.bamboo.task.TaskException: Failed to execute task
  2. 0

    h3. Summary Non-detached Docker containers started from Bamboo are not stopped if build was cancelled manually. These containers will continue running and consume CPU on the host. h3. Steps to Reproduce # Configure build plan to start a Docker container # Start the build # When build is running, manually cancel the build using {{Actions >> Stop build}} h3. Expected Results The task should end gracefully by cleaning up the non detached docker containers it has spun up h3. Actual Results Docker containers started by the build will continue running in the background consuming CPU. The below exception is thrown in the atlassian-bamboo.log file: {noformat} 2016-05-11 13:27:34,864 INFO [13-BAM::Default Agent::Agent:pool-29-thread-1] [TaskResultBuilder] DOCK-TEST-JOB1-15: Failing task since return code of [/usr/local/bin/docker run --volume /Users/brosa/Documents/Atlassian/bamboo/bamboo-5.9.7/home/xml-data/build-dir/DOCK-TEST-JOB1:/data --workdir /data --rm brosadocker/customized-bamboo-java-agent:1.0.0] was 141 while expected 0 2016-05-11 13:27:34,865 INFO [13-BAM::Default Agent::Agent:pool-29-thread-1] [DefaultErrorHandler] Recording an error: Error occurred while running Task '(2)' of type com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli. : DOCK-TEST-JOB1 : Failed to execute task 2016-05-11 13:27:34,865 ERROR [13-BAM::Default Agent::Agent:pool-29-thread-1] [TaskExecutorImpl] Error occurred while running Task '(2)' of type com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli. com.atlassian.bamboo.task.TaskException: Failed to execute task at com.atlassian.bamboo.plugins.docker.service.RunService.execute(RunService.java:70) at com.atlassian.bamboo.plugins.docker.tasks.cli.DockerCliTask.execute(DockerCliTask.java:60) at com.atlassian.bamboo.task.TaskExecutorImpl$3.call(TaskExecutorImpl.java:288) at com.atlassian.bamboo.task.TaskExecutorImpl$3.call(TaskExecutorImpl.java:284) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:200) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:284) at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:106) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:124) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:115) at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:114) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.bamboo.plugins.docker.client.DockerException: Error running Docker run command at com.atlassian.bamboo.plugins.docker.client.DockerCmd.run(DockerCmd.java:103) at com.atlassian.bamboo.plugins.docker.service.RunService.execute(RunService.java:59) ... 18 more Caused by: com.atlassian.utils.process.ProcessException: Error executing /usr/local/bin/docker run --volume /Users/brosa/Documents/Atlassian/bamboo/bamboo-5.9.7/home/xml-data/build-dir/DOCK-TEST-JOB1:/data --workdir /data --rm brosadocker/customized-bamboo-java-agent:1.0.0 at com.atlassian.bamboo.plugins.docker.process.DockerTaskProcessService.execute(DockerTaskProcessService.java:60) at com.atlassian.bamboo.plugins.docker.client.DockerCmd.run(DockerCmd.java:99) ... 19 more {noformat} h3.Workaround If a build was stopped manually, the docker containers will need to be stopped manually.

    Atlassian JIRA | 7 months ago | Deric Lee
    com.atlassian.bamboo.task.TaskException: Failed to execute task
  3. 0

    Configuring the Docker task in Bamboo - Atlassian Documentation

    atlassian.com | 1 year ago
    com.atlassian.bamboo.task.TaskException: Failed to execute task
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [PROTOCOL_ERROR] Received CHANNEL_SUCCESS on unknown channel - Atlassian Documentation

    atlassian.com | 4 months ago
    com.atlassian.bamboo.task.TaskException: SSH command failed
  6. 0

    h3. Summary Unable to "Build Docker image" from Docker task h3. Resolution Problem is fixed in Bamboo 5.13.0.1. In case you can't upgrade please download bamboo-docker-plugin 5.10.3 from https://bitbucket.org/atlassian/bamboo-docker-plugin/downloads and install it in Bamboo via Administration / Manage addons h3. Steps to Reproduce # Install Docker # Set the docker capability on Bamboo # Create a plan and add the docker task to it # Set the docker task configuration as the following: !bamboo.docker.task-dockerForMac.png|thumbnail! # Run the build h3. Expected Results The new image is built and added to the image repository. h3. Actual Results When running Bamboo's Docker task, the following error gets thrown. {noformat:title=build log} error 04-Jul-2016 19:35:54 invalid argument "\"ubuntu:latest\"" for --tag="ubuntu:latest": Error parsing reference: "\"ubuntu:latest\"" is not a valid repository/tag error 04-Jul-2016 19:35:54 See 'docker build --help'. simple 04-Jul-2016 19:35:54 Failing task since return code of [/usr/local/bin/docker build --force-rm=true --tag="ubuntu:latest" /opt/atlassian/home/atlassian-bamboo-5.12.2.1/xml-data/build-dir/PROJ-DOC-JOB1] was 1 while expected 0 error 04-Jul-2016 19:35:54 Error occurred while running Task '(1)' of type com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli. error 04-Jul-2016 19:35:54 com.atlassian.bamboo.task.TaskException: Failed to execute task error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.plugins.docker.service.BuildService.execute(BuildService.java:53) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.plugins.docker.tasks.cli.DockerCliTask.execute(DockerCliTask.java:60) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$272(TaskExecutorImpl.java:317) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:246) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:317) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:118) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:74) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:215) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:139) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:130) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:221) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:129) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:137) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:51) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) error 04-Jul-2016 19:35:54 at java.lang.Thread.run(Thread.java:745) error 04-Jul-2016 19:35:54 Caused by: com.atlassian.bamboo.plugins.docker.client.DockerException: Error running Docker build command error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.plugins.docker.client.DockerCmd.build(DockerCmd.java:189) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.plugins.docker.service.BuildService.execute(BuildService.java:40) error 04-Jul-2016 19:35:54 ... 17 more error 04-Jul-2016 19:35:54 Caused by: com.atlassian.utils.process.ProcessException: Error executing /usr/local/bin/docker build --force-rm=true --tag="ubuntu:latest" /opt/atlassian/home/atlassian-bamboo-5.12.2.1/xml-data/build-dir/PROJ-DOC-JOB1 error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.plugins.docker.process.DockerTaskProcessService.execute(DockerTaskProcessService.java:60) error 04-Jul-2016 19:35:54 at com.atlassian.bamboo.plugins.docker.client.DockerCmd.build(DockerCmd.java:185) error 04-Jul-2016 19:35:54 ... 18 more {noformat} (i) Running the same command from Terminal works successfully: {code} /usr/local/bin/docker build --force-rm=true --tag="ubuntu:latest" /opt/atlassian/home/atlassian-bamboo-5.12.2.1/xml-data/build-dir/PROJ-DOC-JOB1 {code} *Notes* {code} $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu latest 0f192147631d 5 days ago 132.8 MB {code} h3.Workaround 1. Some customers have reported that downgrading Docker to 1.11 corrected the issue for them. 2. Avoid using the Docker task and use the script task instead.

    Atlassian JIRA | 5 months ago | Daniel Santos
    com.atlassian.bamboo.task.TaskException: Failed to execute task

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.atlassian.utils.process.ProcessException

      Error executing /usr/local/bin/docker run --volume /Users/brosa/Documents/Atlassian/bamboo/bamboo-5.9.7/home/xml-data/build-dir/DOCK-TEST-JOB1:/data --workdir /data --rm brosadocker/customized-bamboo-java-agent:1.0.0

      at com.atlassian.bamboo.plugins.docker.process.DockerTaskProcessService.execute()
    2. com.atlassian.bamboo
      ImpersonationHelper$1.run
      1. com.atlassian.bamboo.plugins.docker.process.DockerTaskProcessService.execute(DockerTaskProcessService.java:60)
      2. com.atlassian.bamboo.plugins.docker.client.DockerCmd.run(DockerCmd.java:99)
      3. com.atlassian.bamboo.plugins.docker.service.RunService.execute(RunService.java:59)
      4. com.atlassian.bamboo.plugins.docker.tasks.cli.DockerCliTask.execute(DockerCliTask.java:60)
      5. com.atlassian.bamboo.task.TaskExecutorImpl$3.call(TaskExecutorImpl.java:288)
      6. com.atlassian.bamboo.task.TaskExecutorImpl$3.call(TaskExecutorImpl.java:284)
      7. com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:200)
      8. com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:284)
      9. com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:106)
      10. com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75)
      11. com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196)
      12. com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:124)
      13. com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:115)
      14. com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215)
      15. com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:114)
      16. com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118)
      17. com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
      18. com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
      19. com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
      20. com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
      20 frames
    3. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame