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

[Bug] Action runs but fails with an error? #155

Open
msarm-1debit opened this issue Oct 31, 2024 · 3 comments
Open

[Bug] Action runs but fails with an error? #155

msarm-1debit opened this issue Oct 31, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@msarm-1debit
Copy link

msarm-1debit commented Oct 31, 2024

What happened?

The workflow ran successfully but came with this error.

Relevant log output

Run austenstone/[email protected]
Fetching Copilot usage for organization <redacted>
Fetched Copilot usage data for 28 days (2024-10-03 to 2024-10-30)
Fetching Copilot details for organization <redacted>
Fetching Copilot seat assignments for organization <redacted>
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 16517
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is 33664e617e68c54f41b9a862e62d4e2e48314f4b17a5ec20d81f897e712db461
Finalizing artifact upload
Artifact copilot-usage.zip successfully finalized. Artifact ID 2126591388
Artifact name is valid!
Root directory input is valid!

/home/runner/work/_actions/austenstone/copilot-usage/v4.2/node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js:54
                throw new Error(`Failed to ${method}: ${error.message}`);
^
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
    at ArtifactHttpClient.<anonymous> (/home/runner/work/_actions/austenstone/copilot-usage/v4.2/node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js:54:1)
    at Generator.throw (<anonymous>)
    at rejected (/home/runner/work/_actions/austenstone/copilot-usage/v4.2/node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js:6:1)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Contact Details

No response

@msarm-1debit msarm-1debit added the bug Something isn't working label Oct 31, 2024
@austenstone
Copy link
Owner

Can you provide your workflow yml? I believe you're trying to create 2 artifacts with the same name.

@msarm-1debit
Copy link
Author

# https://github.com/marketplace/actions/copilot-usage-action

name: Copilot Usage Metrics Collector
on:
  schedule:
    - cron: '0 5 * * 1'
  workflow_dispatch:
  push:

jobs:
  run:
    name: Run Action
    runs-on: ubuntu-latest
    steps:
      - uses: austenstone/[email protected]
        with:
          github-token: ${{ secrets.COPILOT_USAGE_METRICS }}
          organization: '<org>'
          csv: true
          time-zone: 'EST'

@oppermax
Copy link

oppermax commented Nov 14, 2024

Experiencing the same error with this configuration:

name: Copilot Usage Report
on:
  schedule:
    - cron: '0 0 * * *' # the job will run at midnight every day.
  workflow_dispatch:

jobs:
  run:
    name: Run Action
    runs-on: ubuntu-latest
    steps:
      - uses: austenstone/[email protected]
        with:
          github-token: ${{ secrets.TOKEN }}
          time-zone: 'CET' # IANA time zone identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
          csv: true # Optional flag to output a CSV report

In fact, this configuration also doesn't create a csv file but a json.
Downgrading to v4.0 seems to work as intended.

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

3 participants