Re-running a build that failed because the agent went offline will fail again if the agent comes back online

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Low
    • 9.0.0
    • Affects Version/s: 8.0.0, 8.0.1, 8.0.2
    • Component/s: Builds
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      This bug occurs in the following scenario:

      • A job start running on a remote agent A;
      • The remote agent A goes offline;
      • This causes the build to fail;
      • Re-run the build, which will make the failed job run in another agent;
      • During the build, the remote agent A comes back online and reports the job it was building failed;
      • The job will be marked as failed.

      Steps to Reproduce

      The steps below describe how to reproduce this issue in a single machine:

      1. Create a job and configure a required artifact;
      2. Create a script task with the following commands:
        • echo "Testing job failure" > test.txt
          sleep 60
          
      3. Configure a remote agent to connect to Bamboo using a hosts entry;
      4. Start the build, during the "sleep" remove the Bamboo entry from the file;
      5. Shutdown the agent and put the hosts entry back;
      6. Re-run the build;
      7. While the sleep is running, start the remote agent.

      Expected Results

      The job keeps running on another agent and the server reports the result from this run.

      Actual Results

      The server will receive the failed message from the agent that came back online and it will mark the job as failed.

      Also, we can see in the build logs the post-build processes messages at the begging of the log:
      The below exception is thrown in the xxxxxxx.log file:

      simple	13-Oct-2021 17:50:21	Running on server: post build plugin 'NCover Results Collector'
      simple	13-Oct-2021 17:50:21	Running on server: post build plugin 'Build Hanging Detection Configuration'
      simple	13-Oct-2021 17:50:21	Running on server: post build plugin 'Clover Delta Calculator'
      simple	13-Oct-2021 17:50:21	Running on server: post build plugin 'Maven Dependencies Postprocessor'
      simple	13-Oct-2021 17:50:21	All post build plugins have finished
      simple	13-Oct-2021 17:50:21	Generating build results summary...
      simple	13-Oct-2021 17:50:21	Saving build results to disk...
      simple	13-Oct-2021 17:50:21	Store variable context...
      simple	13-Oct-2021 17:50:21	Indexing build results...
      simple	13-Oct-2021 17:50:21	Finished building TEST-AG-JOB1-17.
      simple	13-Oct-2021 17:50:21	Build TEST - AgentLoop - Default Job #17 (TEST-AG-JOB1-17) started building on agent 192.168.15.5 (2), bamboo version: 8.0.0
      simple	13-Oct-2021 17:50:21	Remote agent on host 192.168.15.5
      simple	13-Oct-2021 17:50:21	Build working directory is /Users/gluz2/support/agent-home-8.0.0/xml-data/build-dir/TEST-AG-JOB1
      simple	13-Oct-2021 17:50:21	Executing build TEST - AgentLoop - Default Job #17 (TEST-AG-JOB1-17)
      simple	13-Oct-2021 17:50:21	Running pre-build action: VCS Version Collector
      simple	13-Oct-2021 17:50:21	Starting task 'Script' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
      command	13-Oct-2021 17:50:21	Beginning to execute external process for build 'TEST - AgentLoop - Default Job #17 (TEST-AG-JOB1-17)'\n ... running command line: \n
      (...) Truncated
      simple	13-Oct-2021 17:50:21	Finished task 'Script' with result: Success
      simple	13-Oct-2021 17:50:21	Starting task 'Sleep' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
      command	13-Oct-2021 17:50:21	Beginning to execute external process for build 'TEST - AgentLoop - Default Job #17 (TEST-AG-JOB1-17)'\n ... running command line: 
      (...) Truncated
      simple	13-Oct-2021 17:51:21	Finished task 'Sleep' with result: Success
      simple	13-Oct-2021 17:51:21	Running post build plugin 'Docker Container Cleanup'
      simple	13-Oct-2021 17:51:21	Running post build plugin 'NCover Results Collector'
      simple	13-Oct-2021 17:51:21	Running post build plugin 'Clover Results Collector'
      simple	13-Oct-2021 17:51:21	Running post build plugin 'npm Cache Cleanup'
      simple	13-Oct-2021 17:51:21	Running post build plugin 'Artifact Copier'
      simple	13-Oct-2021 17:51:21	Publishing an artifact: Test
      simple	13-Oct-2021 17:51:21	Finished publishing of artifact Required shared artifact: [Test], pattern: [**/*.txt] in 173.8 ms
      simple	13-Oct-2021 17:51:21	Finalising the build...
      simple	13-Oct-2021 17:51:21	Stopping timer.
      simple	13-Oct-2021 17:51:21	Build TEST-AG-JOB1-17 completed.
      

      Workaround

      Currently, there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Unassigned
            Reporter:
            Guilherme Luz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: