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] v4: multiple artifacts with the same name #480

Open
Borda opened this issue Dec 18, 2023 · 9 comments
Open

[bug] v4: multiple artifacts with the same name #480

Borda opened this issue Dec 18, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@Borda
Copy link

Borda commented Dec 18, 2023

What happened?

It seems the action created multiple artifacts with the same name within one workflow.

The reason why we build such workflows is to be able to aggregate outputs from several jobs as GH does not offer any other way of communication among distanced jobs...

image

What did you expect to happen?

it will overwrite the past artifact or raise an error...

How can we reproduce it?

See the linked workflow - https://github.com/Lightning-AI/utilities/actions/runs/7253160143?pr=209

Anything else we need to know?

These actions are wrapped in composite action; I'm not sure if it may have any impact...

the main workflow
  |- shared workflow / job A (upload)
  |- shared workflow / job B
  |   |- composite action (download & upload)

What version of the action are you using?

4.0.0

What are your runner environments?

linux

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

No response

@robherley
Copy link
Contributor

👋 @Borda you have a mix of v3 and v4 Artifacts in your job (they are not compatible with each other per the breaking changes). I'd suggest checking any composite workflows that might be creating additional Artifacts.

@Borda
Copy link
Author

Borda commented Dec 19, 2023

you have a mix of v3 and v4 Artifacts in your job

I have fixed the download version before opening this issue but did not expect that dependabot does not bump all occurrences... :(

@Borda
Copy link
Author

Borda commented Dec 19, 2023

Ok, now I got the existence error, which is progress, but how can I overwrite it with a new version or delete it and create a new one?

Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run

@robherley
Copy link
Contributor

Please see this reply: #481 (comment)

As part of v4, you are not able to upload to the same Artifact multiple times.

If you must recreate the Artifact, I have an example here: #471 (comment)

@Borda
Copy link
Author

Borda commented Dec 19, 2023

If you must recreate the Artifact, I have an example here: #471 (comment)

Thank you. This is close, but I am afraid it will not work as you can't pass artifact-id from one job to another if they are running as strategy parametrization

@yaleman
Copy link

yaleman commented Dec 23, 2023

I'm having a similar issue with matrix'd jobs creating duplicate artifacts, or being unable to use the name because it's got invalid values (ie, the parent container name, etc) how are we supposed to name things given the really limited templating capabilities?

bwoodsend added a commit to bwoodsend/polycotylus that referenced this issue Feb 11, 2024
@bwoodsend
Copy link

how are we supposed to name things given the really limited templating capabilities?

There is an enumeration in ${{ strategy.job-index }}. e.g. If you have a matrix of 10 jobs then that variable will be an integer from 0 to 9. So it looks like the most foolproof way to collect artifacts from multiple jobs is to append that variable to the artifact name then, when downloading, use pattern: with merge-multiple: true instead of name::

      - uses: actions/upload-artifact@v4
        with:
          name: my-artifacts-${{ strategy.job-index }}
          path: ...
      ...
      - uses: actions/download-artifact@v4
        with:
          pattern: my-artifacts-*
          merge-multiple: true

Even with a workaround though, I still think this was a change for the worse. The only motivation I could find for it was that people pushing to the same file (but not the same artifact name) concurrently would end up with broken artifacts which is a totally self inflicted, self explanatory and easily workaround-able problem whereas collecting artifacts from multiple jobs is a pretty key reason for this action's existence. Unless perhaps it would allow you to remove the restriction that artifacts can't be downloaded via the UI or the REST API whilst the workflow is still running, it feels like you've just made an intuitive common thing much harder for everyone in favour of making an invalid thing marginally less confusing for a very small group of people.

bwoodsend added a commit to bwoodsend/polycotylus that referenced this issue Feb 11, 2024
kenorb added a commit to EA31337/EA31337-indicators-other that referenced this issue Feb 17, 2024
php-coder added a commit to php-coder/query2app that referenced this issue Mar 26, 2024
…me to an artifact

The error was:
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run

See also: actions/upload-artifact#480 (comment)

Part of #13
@phyzical
Copy link

phyzical commented Jul 16, 2024

@bwoodsend thanks for the tips, ill just add it also gets a little more complicated when you then use the action within composite actions and using those composite actions multiple times inaa workflow

So you end up needing to do something like the following

     - uses: actions/upload-artifact@v4
        with:
          name: my-artifacts-${{inputs.context}}-${{inputs.job-index}}
          path: ...
      ...
      - uses: actions/download-artifact@v4
        with:
          pattern: my-artifacts-${{inputs.context}}*
          merge-multiple: true

@Toerktumlare
Copy link

i had to remove my matrixed job since i got this error, i dont really understand why this even exists in the first place, why cant the api do atomic operations?

ribeirojose added a commit to cowdao-grants/cow-py that referenced this issue Sep 10, 2024
ribeirojose added a commit to cowdao-grants/cow-py that referenced this issue Sep 10, 2024
* refactor repo configs/readme

* add codegen module

* add common module

* remove stale subgraphs/core modules

* add contracts module

* add order_book module

* add order posting example

* add generated api model

* add python-dotenv package

* refactor importing sort

* refactor .env usage and variables requested

* codegen: update reference openapi file for orderbook api codegen

* add E2E_SEPOLIA_TESTING_EOA_PRIVATE_KEY to .env.example

* codegen: regenerate order book models

* api: refactor api base code to handle errors from orderbook api

* orderbook: fix issue with type in order cancellation

* tests(e2e): add e2e order posting test backed by vcr

* ignore .env* files

* api(orderbook): refactor data serialization/deserialization

* tests(e2e): use gnosis mainnet for e2e test

* ci: stop using deprecated version of actions/upload-artifact

* chore: ignore pyright error when instantiating model with string positional param

* chore: remove TODO/WIP comments from README

* ci: ensure E2E_GNOSIS_MAINNET_TESTING_EOA_PRIVATE_KEY is available when running pytest

* chore(ci): revert actions/upload-artifact to v3 to avoid bug when saving conflicting artifacts

actions/upload-artifact#480

---------

Co-authored-by: José Ribeiro <me@joseribeiro.dev>
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

6 participants