Lesstep
Bitbucket Cloud · Pipelines · Checked November 10, 2026

Bitbucket Pipelines: the artifact is missing in the next step

One step makes a file and lists it under artifacts. The next step fails with a line such as tar: can't open 'dist/package-4.tar.gz': No such file or directory (from a community question). Bitbucket uploads a step's artifacts after its last command and puts them back before the commands of the later steps. Look at both ends in the logs first, then go through the causes Atlassian lists (Bitbucket Pipeline issues due to Artifacts related issues and Pipeline artifacts).

Look at both ends of the copy

To find where the artifact went missing: Pipeline Inbox for Bitbucket Pipelines, a plugin for JetBrains IDEs, shows for a failed pipeline the command the step failed at and its last lines, and opens each step's log in the IDE, searchable for the artifact lines of Build setup and Build teardown.

The causes

  1. The file is not where the pattern looks. The command, or the project's configuration, wrote it to another folder, or not at all. In the question above, an exit 0 left in an if block ended the step successfully before the file was written.
  2. The path is outside the clone directory. Artifact paths are relative to $BITBUCKET_CLONE_DIR: dist/** works, /tmp/** does not. Write the file inside the clone directory. Paths with . or .. are not supported, and a pattern that starts with * needs quotes in the YAML.
  3. Both steps are in the same parallel set. A parallel step's artifacts reach the steps after the set. For another step of the same set, Atlassian says they may or may not exist when it asks for them, so don't count on it. That was the cause in the tar question above: the deploy step was in the same parallel block as the build.
  4. The next step doesn't download it. download: false skips all artifacts. A download: list takes only the named artifacts it lists. An artifact with type: scoped is never downloaded by other steps; it is for logs, reports and screenshots.
  5. It was over 1 GB after compression. The step's Build teardown then says the artifact won't be uploaded, and the build goes on to the next step. The request to fail the build instead, BCLOUD-17145, is still “Gathering Interest”. Split a folder into several artifacts, or make the file smaller.
  6. It expired. Artifacts are kept for 14 days after the step that made them. A manual deployment step started after that can't be run: its Deploy button is greyed out with “Artifacts have expired”, even when the step has download: false (BCLOUD-22653, unresolved). Its workaround is to run the whole pipeline again.
  7. The step is in a child pipeline. Artifacts cross between a parent pipeline and a child pipeline only when the type: pipeline step that starts the child lists them: upload shares the parent's artifacts into the child, where every step can download them, and download shares the child's artifacts out to the parent's steps after that step. They go by the names they were uploaded as, up to 20 each way (Child pipeline step options, and Pipeline artifacts, updated November 6, 2026).
- step:
    name: Build
    script:
      - npm run build
      - ls -lR dist
    artifacts:
      - dist/**
- step:
    name: Deploy
    script:
      - ./deploy.sh

For a child pipeline, the step that starts it names what goes in and what comes out:

- step:
    name: Build
    script:
      - make dist
    artifacts:
      upload:
        - name: app-dist
          paths:
            - dist/**
- step:
    name: Run the release pipeline
    type: pipeline
    custom: release
    artifacts:
      upload:
        - app-dist          # into the child pipeline
      download:
        - release-notes     # out to the steps after this one

"Permission denied" on a script from an artifact

Downloaded artifacts get the permissions 644 (-rw-r--r--), so a script that came as an artifact can't be run until you make it executable again (the Pipeline artifacts page):

script:
  - chmod +x deploy.sh
  - ./deploy.sh

Artifacts from a step that failed

By default a step uploads its artifacts only when it succeeds. For test reports or screenshots you want after a failure, use the structured form with capture-on: failed or capture-on: always:

artifacts:
  - name: Screenshots
    type: scoped
    paths:
      - screenshots/**
    capture-on: failed

See the failed command from IntelliJ IDEA

Pipeline Inbox for Bitbucket Pipelines, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pipelines of all your Bitbucket Cloud repositories in an IDE tool window, with their steps. For a failed pipeline it shows the command the step failed at and that command's last lines, so the No such file or directory line is on screen without opening the log. Each step's log opens in the IDE and can be searched, so you can find the artifact lines of Build teardown and Build setup there. When the artifacts have expired, the way out is a new run of the whole pipeline: with Pro, Run again builds the same commit once more from the IDE. The list, steps and logs are free; running, re-running and stopping pipelines are Pro (US$1.50 a month, with a 30-day trial).

Get it on JetBrains Marketplace

Atlassian, Bitbucket and Bitbucket Pipelines are trademarks of Atlassian; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by either of them.

More: The cache is not used · "Step exceeded processing limits" · "Exceeded build time limit of 120 minutes" · "No space left on device" · "No online runner available" · "We couldn't clone the repository" · Submodules not cloned · "command not found" · "unexpected system error" · Pipelines did not run after a push · "Container 'Build' exceeded memory limit." · "Container 'docker' exceeded memory limit." · The build passed before and fails now · Build setup takes too long · "You've run out of build minutes" · "Permission denied to update branch" · "You have reached your pull rate limit" (Docker Hub) · "There is an error in your bitbucket-pipelines.yml" · "This pipeline was paused" (deployments) · "authorization denied by plugin pipelines" (Docker) · "Cannot connect to the Docker daemon" · "Host key verification failed" (SSH) · A variable is empty · Test results not showing · "Not authorized to perform sts:AssumeRoleWithWebIdentity" (OIDC to AWS) · "Connection refused" to a service (MySQL, PostgreSQL, Redis) · "Container 'build' failed to pull image" · The scheduled pipeline did not run · Git commands that fail in a shallow clone (origin/main, git describe) · Git LFS files that arrive as pointers, and LFS pushes from a step · A step skipped by condition: changesets (includePaths) · Parallel steps that keep running after one fails (fail-fast) · Bitbucket Pipelines plugins for IntelliJ IDEA, compared · 日本語