download-artifact cannot find the artifact you uploaded
Error: Unable to download artifact(s): Artifact not found for name: java-appShort 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.
Fix it fast
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_ID2Match what you see, then jump to its fix
- 1
The Artifacts list is empty or shows another nameThe name differs from the one used at upload, or the upload did not run firstFix - 2
The 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
The upload happened in a different workflow, for example one that triggers this oneThe artifact belongs to another workflow run or repositoryFix - 4
Artifacts from v4 uploads are immutable, and a second upload with the same name failsTwo uploads use the same nameFix
- 1
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/*.yml2Fix
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-app3Verify
The deploy job's download step lists the files it extracted.
gh run view RUN_ID --log | grep -i artifactConfirmed by github.com
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/upload2Fix
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: true3Verify
The artifact appears in the run summary after the upload job.
gh run view RUN_IDConfirmed by github.com
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/*.yml2Fix
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: 12345678903Verify
The step finishes and the files appear in the workspace.
ls -RConfirmed by github.com
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/*.yml2Fix
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_IDConfirmed by github.com
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
upload-artifact fails because the artifact storage quota is full
Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts
Uploads fail when your account's shared artifact storage is used up.
3 causes, each with a fixServers
Docker push to Artifact Registry fails from GitHub Actions with a permission error
Permission 'artifactregistry.repositories.uploadArtifacts' denied on resource
The identity your workflow authenticates as lacks the permission artifactregistry.repositories.uploadArtifacts on the target repository.
4 causes, each with a fixServers
The Java SDK finds no AWS credentials on an EC2 instance or in a container on it
InstanceProfileCredentialsProvider()
The SDK walks a fixed list of credential sources and the EC2 instance role is the last one.
3 causes, each with a fixServers
docker build stops at COPY because the file is not in the build context
ERROR: failed to solve: failed to compute cache key:
COPY can only read files that are inside the build context, the folder you pass to docker build.
3 causes, each with a fixServers
Docker build fails to resolve the openjdk slim-buster base image
failed to resolve source metadata for docker.io/library/openjdk:21-slim-buster
The tag you named does not exist any more.
2 causes, each with a fixServers
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