download-artifact icon indicating copy to clipboard operation
download-artifact copied to clipboard

[bug] download may silently fail download, but not fail action

Open vholer opened this issue 9 months ago • 15 comments

What happened?

When downloading multiple artifacts, one of the file could fail to download, but not failing the action as a whole. The workflow then continues and can lead in inconsitent result due to silent failure and missing files.

What did you expect to happen?

If artifact fails to download, whole action must fail.

How can we reproduce it?

IDK

Anything else we need to know?

Snippet from GitHub Workflow:

....
  push:
    name: Push
    runs-on: ubuntu-22.04
    needs: [setup, build_test]
    timeout-minutes: 20
    steps:
      - uses: actions/download-artifact@v4
        with:
          path: artifacts

      - name: Podman Login to GitHub Container Registry
        uses: redhat-actions/podman-login@v1
...

Snippet from logs attached, but same warning as in #381, maybe it's related.

2025-03-27T18:35:32.3300700Z (node:1475) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
2025-03-27T18:35:32.3305406Z (Use `node --trace-deprecation ...` to show where the warning was created)

log.txt

What version of the action are you using?

v4.2.1

What are your runner environments?

linux

Are you on GitHub Enterprise Server? If so, what version?

No response

vholer avatar Mar 28 '25 10:03 vholer

Hey, I'm currently experiencing the same issue with version 4. I haven't managed to find a concrete pattern in its behavior.

The artifacts that downloaded correctly seem to have the following lines at the end:

SHA256 digest of downloaded artifact is (sha here)
Artifact download completed successfully.
Total of 1 artifact(s) downloaded
Download artifact has finished successfully

While the artifacts that don't seem to have downloaded correctly lack these lines, ending with:

(node:25916) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

michal-kralovic avatar Apr 04 '25 07:04 michal-kralovic

We're running into this as well and it seems that this issue was previously reported in #363. Alas no solution (or recognition of the issue) was added there.

Kingdutch avatar Apr 04 '25 20:04 Kingdutch

Hey, we're running into this problem as well.

adrian-visnovsky-vissim avatar Apr 08 '25 12:04 adrian-visnovsky-vissim

We were affected by this issue as well. It appears to also be possible when only downloading a single artifact.

Successful download:

Downloading single artifact
Preparing to download the following artifacts:
- actions-cache (ID: [redacted], Size: 113180182, Expected Digest: sha256:[redacted])
Redirecting to blob download url: https://productionresultssa11.blob.core.windows.net/actions-results/[redacted]/artifacts/[redacted].zip
Starting download of artifact to: /home/runner/_work/[redacted]
(node:415) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
SHA256 digest of downloaded artifact is [redacted]
Artifact download completed successfully.
Total of 1 artifact(s) downloaded
Download artifact has finished successfully

Failed download (without workflow failure):

Downloading single artifact
Preparing to download the following artifacts:
- actions-cache (ID: [redacted], Size: 113180182, Expected Digest: sha256:[redacted])
Redirecting to blob download url: https://productionresultssa3.blob.core.windows.net/actions-results/[redacted]/artifacts/[redacted].zip
Starting download of artifact to: /home/runner/_work/[redacted]
(node:473) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

jrarmstro avatar Apr 08 '25 15:04 jrarmstro

Is there any known workaround for this issue?

patrick-rivos avatar Apr 10 '25 17:04 patrick-rivos

@patrick-rivos we just re-run our pipelines and it usually works fine the second time. Or you can download you artifact manually

adrian-visnovsky-vissim avatar Apr 11 '25 07:04 adrian-visnovsky-vissim

In our workflow I replaced the GitHub action with the gh CLI which uses a different implementation than the action. That's been working flawlessly from our testing thus far.

      - name: Download artifacts
        run: gh run download --repo "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID"
        env:
          GH_TOKEN: ${{ github.token }}

Kingdutch avatar Apr 11 '25 07:04 Kingdutch

We are hitting this problem as well

oenglund avatar Apr 29 '25 11:04 oenglund

We are also hitting this problem

MattiasPernhult avatar Apr 29 '25 11:04 MattiasPernhult

Same issue, says it's downloaded, nothing downloaded.

fuzzlebuck avatar May 03 '25 12:05 fuzzlebuck

Also affected, same issue

sebastianstupak avatar May 06 '25 11:05 sebastianstupak

I also face the same issue. The actions/download-artifact@v4 fails to provide all files from the artifact zip. It just silently fails with some files missing. The sha matches. The files can be downloaded manually. The gh run download workaround works.

oto-macenauer-absa avatar May 21 '25 07:05 oto-macenauer-absa

I am experiencing the same issue on specific self-hosted runners. Any workarounds (other than using gh)?

vfdb67 avatar May 29 '25 17:05 vfdb67

My suspicion is that the bug occurs when the self-hosted server has a slow or bad Internet connection. This happens more when the download takes longer than usual. One of the promises fails and then it stops all without returning an error status.

tiago-upbrasil avatar Jun 11 '25 15:06 tiago-upbrasil

Здравствуйте

MED-26790 avatar Jun 28 '25 05:06 MED-26790

We just had this as well, also in a self-hosted runner, and with a single artifact:

Download fails:

Downloading single artifact
Preparing to download the following artifacts:
- fmod-project-build-16795056208 [redacted]
Redirecting to blob download url: [redacted]
Starting download of artifact to: /Users/effortstarbuild/runner/_work/[redacted]
(node:19985) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

The final success messages are never posted (nor any errors) and the task succeeds:

Image

Thankfully after re-running failed jobs we see the expected result:

Downloading single artifact
Preparing to download the following artifacts:
- fmod-project-build-16795056208 [redacted]
Redirecting to blob download url: [redacted]
Starting download of artifact to: /Users/effortstarbuild/runner/_work/[redacted]
(node:23030) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
SHA256 digest of downloaded artifact is [redacted]
Artifact download completed successfully.
Total of 1 artifact(s) downloaded
Download artifact has finished successfully

This is also with v4.

      - name: Download FMOD build
        uses: actions/download-artifact@v4
        with:
          name: ${{ inputs.fmod_build_artifact_id }}
          path: FmodProject/

rhys-vdw avatar Aug 07 '25 05:08 rhys-vdw

Hi. We have faced the bug as well and have done some investigation. It seems like there is a problem with the retry logic - it does not retry the download if the stream of chunks ends after the defined timeout, and does not return any errors.

I've created a PR with a workaround in the actions/toolkit repo: the actions/download-artifact uses its download logic. You can check the PR's description for more information and logs.

akashchi avatar Sep 01 '25 15:09 akashchi

Fixed by https://github.com/actions/toolkit/pull/2124

danwkennedy avatar Sep 25 '25 13:09 danwkennedy

Am I correct that we need a new drop of @actions/artifact to be released to pick up the change in this project?

klutchell avatar Oct 02 '25 14:10 klutchell

That's correct.

danwkennedy avatar Oct 02 '25 17:10 danwkennedy

Is this fixed in v6? I wasn't able to find it in the changelog.