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

Artifact download fails with ambiguous "Error: Not Found" #188

Open
stevehillsTB opened this issue Aug 23, 2022 · 8 comments
Open

Artifact download fails with ambiguous "Error: Not Found" #188

stevehillsTB opened this issue Aug 23, 2022 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@stevehillsTB
Copy link

stevehillsTB commented Aug 23, 2022

I created Build and Deploy workflows where the Deploy workflow retrieves artifacts from the Build workflow. This excellent action is working successfully in several repos, but in one instance there is an issue downloading artifacts from the upstream workflow. This Build workflow is comprised of 6 separate jobs where the first 5 run on macos-latest, and the 5th runs on a Windows 10 self-hosted action runner. The Build jobs are all successful and each collects an artifact.

The Deploy workflow runs on the same Windows 10 self-hosted action runner. When this workflow runs, it fails to download the artifacts, giving an ambiguous error message, "Error: Not Found". It does not indicate the workflow or artifacts cannot be found, and I've verified they exist.

The action is defined in the Deploy workflow as follows.

- name: Download Build Artifacts
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.MY_TOKEN }}
workflow: Build.yml
commit: ${{ env.ARTIFACTS_SHA }}
path: ${{ env.ARTIFACTS_DIR }}

The output from the workflow is reported as follows.

Run dawidd6/action-download-artifact@v2
with:
github_token: ***
workflow: Build.yml
commit: e945cf6d4eb18ac65e4de8767ac85fc1ffffffff
path: artifacts/e945cf6d4eb18ac65e4de8767ac85fc1ffffffff
workflow_conclusion: success
repo: MyOrganization/MyProject
env:
GITHUB_TOKEN: ***
ARTIFACTS_SHA: e945cf6d4eb18ac65e4de8767ac85fc1ffffffff
ARTIFACTS_DIR: artifacts/e945cf6d4eb18ac65e4de8767ac85fc1ffffffff
`==> Repository: MyOrganization/MyProject` `==> Artifact name: ` `==> Local path: artifacts/e945cf6d4eb18ac65e4de8767ac85fc1ffffffff` `==> Workflow name: Build.yml` `==> Workflow conclusion: success` `==> Commit: e945cf6d4eb18ac65e4de8767ac85fc1ffffffff`
Error: Not Found

Looking through the code, I don't see any condition that my workflow might be encountering.

node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if gist is not starred */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found when the account has not purchased the listing */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found when the account has not purchased the listing */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if requester is an organization member and user is not a member */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if user is not a public member */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if project is not managed by this team */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if team does not have permission for the repository */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if the authenticated user does not have access to the project */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if the sarif id does not match any upload */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if user is not a collaborator */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found when the base or head does not exist */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if pull request has not been merged */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if the discussion category name is invalid */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if the discussion category name is invalid */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if you don't subscribe to the repository */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if repository is not enabled with vulnerability alerts */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if team synchronization is set up */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if team synchronization is setup */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if project is not managed by this team */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if repository is not managed by this team */
node_modules/@octokit/openapi-types/types.d.ts: /** Not Found if this repository is not starred by you */

Lastly, thank you for an excellent GitHub action!

@dawidd6 dawidd6 added the help wanted Extra attention is needed label Aug 30, 2022
@desaih
Copy link

desaih commented Sep 26, 2022

I was receiving same error and turned out that github token didnt had access to other repo. Check your token.

@stevehillsTB
Copy link
Author

I was receiving same error and turned out that github token didnt had access to other repo. Check your token.

Thank you for your response.

I have recreated the token in the repository "secrets", but the error is still occurring. The token successfully allowed downloading artifacts through the GitHub artifacts API, and the token is also used successfully with action-download-artifact in several other repositories and workflows in my organization. FYI, I'm actually calling the action in a different workflow within the same repository.

This repository may have previously belonged to a different owner, I'm wondering if that is a clue. I might spend some time looking through the code here to see if that could be related.

@Jtango18
Copy link

I'm having this same issue and damned if I can figure out what's causing it.

@erno
Copy link

erno commented Oct 27, 2022

Another way to download artifacts is using the Gitub CLI tool "gh" - we just switched to using this as a step instead in a cross workflow use case:

        id: download
        run: |
          gh run download --name myproj-build-main --dir ${{env.working-directory}}/build
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

(We had a "Error: no artifacts found" failure case so different from this issue probably, but might apply to the comment talking about "action in a different workflow within the same repository")

@stevehillsTB
Copy link
Author

I'm having this same issue and damned if I can figure out what's causing it.

@Jtango18 is it possible that the repository you are downloading artifacts from has been renamed, or moved from one organization to another?

I did some negative testing with a Python script I wrote using the GitHub Artifacts API, and found that when the organization name or repository name are invalid, the "Not Found" message is returned in the HTTP response. I had previously thought it was being reported by this action, but I don't think that's true.

In my case, I believe the repository once belonged to a user who migrated the repository from his private GH account to our organization's account, and possibly renamed it as well. If I have time over the weekend, I will analyzing this action to see if it may somehow be iterating over the old org/repo names, and not using the current org/repo names.

@stevehillsTB
Copy link
Author

Another way to download artifacts is using the Gitub CLI tool "gh" - we just switched to using this as a step instead in a cross workflow use case:

        id: download
        run: |
          gh run download --name myproj-build-main --dir ${{env.working-directory}}/build
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

(We had a "Error: no artifacts found" failure case so different from this issue probably, but might apply to the comment talking about "action in a different workflow within the same repository")

@erno thank you for the tip, that will probably help people in need of a workaround. I was able to do something similar using Python and the GitHub Artifacts API.

FYI, I think the error you are seeing "Error: no artifacts found" is a different symptom than the "Not Found" error, which as I indicated above is likely being returned by the HTTP response.

@Jtango18
Copy link

Jtango18 commented Jan 9, 2023

Sorry. I don't have anything helpful to report back. I haven't seen this issue pop up since I commented here. Additionally, I have no idea how/why it's gone away. Will keep an eye out and be more vigilant if I see not again to help diagnose.

@PentaPinguino
Copy link

PentaPinguino commented Nov 6, 2023

I am encountering the same issue.

I think it would be useful to have a more detailed error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants