Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

download-artifact cannot find the artifact you uploaded

ErrorError: Unable to download artifact(s): Artifact not found for name: java-app

Short answer

The download step looked in the run for an artifact with that exact name and found none. Check that the name matches the upload, that the upload job finished first, that hidden files were included, and that a download from another run sets run-id, repository and a token.

  • Applies to actions/upload-artifact v4, actions/download-artifact v4, GitHub-hosted runners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open the finished run in the browser and look at the Artifacts list at the bottom of the summary. Compare the names there, letter for letter, with the name in your download step.

    gh run view RUN_ID
  2. 2Match what you see, then jump to its fix

    1. 1The Artifacts list is empty or shows another nameThe name differs from the one used at upload, or the upload did not run firstFix
    2. 2The artifact name starts with a dot, or the upload step warned that no files were foundThe artifact was never created because the files were hiddenFix
    3. 3The upload happened in a different workflow, for example one that triggers this oneThe artifact belongs to another workflow run or repositoryFix
    4. 4Artifacts from v4 uploads are immutable, and a second upload with the same name failsTwo uploads use the same nameFix

What does the error look like?

  • Error: Unable to download artifact(s): Artifact not found for name: java-app

Cause 1 of 4

The name differs from the one used at upload, or the upload did not run first

1Check

name in download-artifact has to be the name given to upload-artifact (the upload default is just artifact). If the download is in a different job, that job must wait for the upload job.

grep -n -A3 "upload-artifact\|download-artifact" .github/workflows/*.yml
grep -n "needs:" .github/workflows/*.yml

2Fix

Use one identical name on both sides and add needs: to the downloading job.

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/upload-artifact@v4
        with:
          name: java-app
          path: target/*.jar
  deploy:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: java-app

3Verify

The deploy job's download step lists the files it extracted.

gh run view RUN_ID --log | grep -i artifact

Confirmed by github.com

Did this fix it?

Cause 2 of 4

The artifact was never created because the files were hidden

1Check

Since upload-artifact v4.4 hidden files (names starting with a dot) are excluded by default, so a path made only of such files uploads nothing.

ls -la path/to/upload

2Fix

Turn on include-hidden-files in the upload step, or stop using a hidden file or folder as the only content.

- uses: actions/upload-artifact@v4
  with:
    name: job-env
    path: .job-env
    include-hidden-files: true

3Verify

The artifact appears in the run summary after the upload job.

gh run view RUN_ID

Confirmed by github.com

Did this fix it?

Cause 3 of 4

The artifact belongs to another workflow run or repository

1Check

By default the download step only reads the current run. For another run or repository you must give a run id, the repository and a token with actions read permission.

grep -n "run-id\|github-token\|repository" .github/workflows/*.yml

2Fix

Set run-id, repository and github-token on the download step.

- uses: actions/download-artifact@v4
  with:
    name: java-app
    github-token: ${{ secrets.GH_PAT }}  # needs actions:read on the source repository
    repository: my-org/other-repo
    run-id: 1234567890

3Verify

The step finishes and the files appear in the workspace.

ls -R

Confirmed by github.com

Did this fix it?

Cause 4 of 4

Two uploads use the same name

1Check

v4 artifacts are immutable and get a unique id; names must be unique, so matrix jobs need the matrix value in the name.

grep -n "upload-artifact@\|download-artifact@" .github/workflows/*.yml

2Fix

Give every upload its own name. The upload action also has an overwrite option that replaces an existing artifact with a new one.

- uses: actions/upload-artifact@v4
  with:
    name: build-${{ matrix.os }}
    path: dist/

3Verify

Each matrix job lists its own artifact in the run summary.

gh run view RUN_ID

Confirmed by github.com

Did this fix it?

How do I stop it coming back?

  • Put the artifact name in one workflow-level env variable and use it in both steps.
  • Give the downloading job needs: on the uploading job.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Servers

docker pull or push to ghcr.io fails with 'denied'

Error response from daemon: denied

ghcr.io refuses a pull or push when Docker is not logged in, when the token lacks the package scope, or when the workflow's GITHUB_TOKEN has no packages permission or no access to that package.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.