Bitbucket Pipeline issues due to Artifacts related issues
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
You're using artifacts in your Bitbucket Pipelines build, and an artifact you have defined in one step is not available to subsequent steps.
Cause
There are different possible causes for a missing artifact:
The size of the artifact (after it is compressed) is more than 1 GB. We do not support artifacts larger than 1 GB after compression.
The path in the artifacts definition in your
bitbucket-pipelines.yml
is not relative to the clone directory.The option download: false has been used for artifacts in this step.
The artifact file is not generated in the directory you have defined as an artifact.
The artifact is generated by a parallel step (and you expect it to be available in the parallel set's other steps).
Solution
Check for large artifact in build teardown
Open the Pipelines build on Bitbucket's website and select the step that generates the artifact to open its build log. Then, expand the Build teardown section in the build log. If the artifact is larger than 1 GB, you will see a message like below, stating that the compressed artifact size is over the 1 GB limit, so the artifact will not be uploaded:

If your artifact is a directory, you could potentially split it into multiple directories and define each subdirectory as an artifact. If your artifact is a file, check if you can reduce the size of the file.
Confirm artifacts filepath definition
While viewing the same step's build log, select the cog icon right above the list of steps. This will open the bitbucket-pipelines.yml
file used for this build. Check the definition for this step and confirm that the path defined in the artifacts:
section is relative (to the clone directory), and not absolute.
For example, this definition will work:
artifacts:
- dist/**
And this definition will not work:
artifacts:
- /tmp/**
If your artifacts are generated outside the clone directory ($BITBUCKET_CLONE_DIR), you will need to generate them inside the clone directory and adjust the artifacts definition so that the artifact path is relative to the clone directory.
Verify download is enabled
In the same bitbucket-pipelines.yml
, check if the option download: false is present in the step that you want to use the artifact. If so, you will need to change it to download: true so that the step downloads the artifacts
Confirm artifact is generated in the correct location
You need to ensure that the artifact file is generated in the directory you specified in the artifact's definition. For example, if your artifact definition looks like:
artifacts:
- dist/**
Then, add the command ls -lR dist in the step that generates the artifact in your bitbucket-pipelines.yml
(after the command that should generate the artifact) and run another build. The output of ls -lR <directory name> in the new build will help you figure out if the artifact is generated in the directory you expect it to be.
If you cannot find the artifact in the directory where you expect it to be, look into either the command that generates the artifact or the configuration of your source code. The command or your source code may be configured to generate the artifact in a different directory. If that is the case, you will need to adjust it.
Check if artifact generation is a parallel step
In the same bitbucket-pipelines.yml
file, check if the step that generates the artifact is a parallel step.
If the artifact is generated by a parallel step, please keep in mind that it won't be available to other steps of the same parallel set. For example, if you need Step 3 of a parallel set to use an artifact that Step 1 of the same parallel set generates, you will need to move Step 3 out of the parallel set.
If you've worked through the above checks and still encounter errors, please raise a Support Ticket and share the Pipeline build URL from bitbucket.org.
Was this helpful?