Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-21716

Builds are not failing when a required artifact cannot be created and the location doesn't exist

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 8.0.7, 8.2.1, 8.1.6
    • 8.1.2, 8.1.5
    • Artifacts
    • None

    Description

      Issue Summary

      Builds are no longer failing when a required artifact cannot be created and the location doesn't exist. The build should fail regardless of the location since the artifact couldn't be published.

      This is reproducible on Data Center: yes.

      Steps to Reproduce

      1. Create a plan with a simple inline Script task
        echo hello world
        
      2. Create an artifact definition in your job with the following settings:
        • Name: Test
        • Location: target – it could be any location, just make sure it doesn't exist
        • Copy pattern: hello-world.txt – it could be any pattern, just make sure it doesn't pick up anything
        • The Shared option is not needed to reproduced this issue.
        • Check the Required box.

      Expected Results

      Build will fail since the artifact couldn't be published:

      simple	19-Apr-2022 12:56:14	Publishing an artifact: Test
      error	19-Apr-2022 12:56:14	Unable to publish artifact [Test]: the source directory /var/atlassian/application-data/bamboo/xml-data/build-dir/PROJ-PLAN-JOB1/test does not exist.
      error	19-Apr-2022 12:56:14	The artifact is required, build will now fail.
      simple	19-Apr-2022 12:56:14	The artifact hasn't been successfully published after 322.9 μs
      

      Actual Results

      The build succeeds even though the required artifact wasn't published successfully. Here's an example from the build log:

      simple	19-Apr-2022 15:10:03	Publishing an artifact: Test
      error	19-Apr-2022 15:10:03	Unable to publish artifact [Test]: the source directory /var/atlassian/application-data/bamboo/local-working-dir/PROJ-PLAN-JOB1/target does not exist.
      simple	19-Apr-2022 15:10:03	The artifact hasn't been successfully published after 1.072 ms
      

      If you remove the location (leave the Location field empty in your artifact definition) then the build fails as expected. It only succeeds if the location doesn't exist.

      Workaround

      Upgrade to version 8.2.1, which is not affected, or:

      Specify the location of the artifact in the Copy pattern field rather then the Location field (leave this field empty). For example, instead of using the following artifact definition:

      • Name: myArtifact
      • Location: target
      • Copy pattern: hello-world.txt
      • Required box checked.

      You can use the following and put the location in the Copy pattern field:

      • Name: myArtifact
      • Location:
      • Copy pattern: target/hello-world.txt
      • Required box checked.

      You don't have to put the full path to the file in the filesystem – it will be relative to the build working directory as long as you don't put a / in front of it. This will be enough to make the build fail if the artifact is not published.

      Attachments

        Activity

          People

            mgardias Marcin Gardias
            brosa Bruno Rosa
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: