Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DownloadArtifact via octokit (js) returns 500 if the artifact is uploaded using v4 #593

Open
Ari-Kishon opened this issue Aug 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Ari-Kishon
Copy link

Ari-Kishon commented Aug 6, 2024

What happened?

We have a github bot (build with probot) that downloads artifacts from completed workflows in order to post their content elsewhere.

after a "workflow_run.completed" webhook is received by this bot, it checks for any existing artifacts with a specific name for the given workflow_run
and tries to download them using:

  const {
    data: { archive_download_url },
  } = await octokit.rest.actions.getArtifact({
    owner: repoOwner,
    repo: repoName,
    artifact_id: artifactId,
    archive_format: "zip",
  });
  const { data: fileContent } = await octokit.request(archive_download_url);

or

 const download = await octokit.rest.actions.downloadArtifact({
    owner: repoOwner,
    repo: repoName,
    artifact_id: artifactId,
    archive_format: "zip",
  });

both these methods work well when the artifact is uploaded via V3.

If the artifacts are uploaded by V4 we get the following error:

{
  "name": "HttpError",
  "status": 500,
  "request": {
    "method": "GET",
    "url": "https://api.github.com/repos/wixplosives/core3-bot-testbed/actions/artifacts/1779838056/zip",
    "headers": {
      "accept": "application/vnd.github.v3+json",
      "user-agent": "probot/13.3.6 octokit-core.js/5.2.0 Node.js/20.16.0 (linux; x64)",
      "x-github-delivery": "811263e0-53ca-11ef-8b73-201b4eef40fa",
      "authorization": "token [REDACTED]"
    },
    "request": {
      "retryCount": 3,
      "retries": 3,
      "retryAfter": 16
    }
  }
}

What did you expect to happen?

Would expect that the rest api would download my artifact regardless of how it was uploaded

How can we reproduce it?

Errors only occur in specific environments once our bot is deployed to our organization's cluster, no current knowledge on what exactly causes this issue.

Does not seem to happen when bot server is run locally or on github or self-hosted runners

Anything else we need to know?

The aforementioned bot is private and i can not share it here publicly.

What version of the action are you using?

v4

What are your runner environments?

self-hosted

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

No response

@Ari-Kishon Ari-Kishon added the bug Something isn't working label Aug 6, 2024
@Ari-Kishon Ari-Kishon changed the title DownloadArtifact via octokit returns 500 if the artifact is uploaded using v4 DownloadArtifact via octokit (js) returns 500 if the artifact is uploaded using v4 Aug 6, 2024
@rwader-swi
Copy link

i was getting the same issue, the last working versions of v4 are v4.1.4 of download artifact and v4.3.3 of upload artifact. After that someone did something really bad. Ironically v3 is faster than v4 and they're going to deprecate v3 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants