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) Unable to upload to same artifact name from multiple jobs #478

Open
DanTup opened this issue Dec 18, 2023 · 38 comments
Open

[bug] (v4) Unable to upload to same artifact name from multiple jobs #478

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

Comments

@DanTup
Copy link

DanTup commented Dec 18, 2023

What happened?

The PR from dependabot to upgrade to v4 is failing on my project with this error:

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

It seems like this is a breaking change that wasn't mentioned in the changelog and I'm not sure if it was deliberate.

There's some discussion about this behaviour in #279 and it suggests that it was fine to do this and there wouldn't be issues as long as the filenames within the artifact are unique. This was convenient to bundle the logs from several shards together into a single artifact rather than having lots of individual zip files to download.

What did you expect to happen?

I expected everything to work the same as in v3 unless it was noted as a deliberate breaking change.

How can we reproduce it?

Create multiple jobs that upload artifacts with the same name (but the files from each job are uniquely named).

Anything else we need to know?

No response

What version of the action are you using?

v4.0.0

What are your runner environments?

linux, window, macos

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

No response

@DanTup DanTup added the bug Something isn't working label Dec 18, 2023
@DanTup
Copy link
Author

DanTup commented Dec 18, 2023

Actually, it seems this is called out here:

https://github.com/actions/upload-artifact?tab=readme-ov-file#v4---whats-new:~:text=The%20contents%20of%20an%20Artifact%20are%20uploaded%20together%20into%20an%20immutable%20archive.%20They%20cannot%20be%20altered%20by%20subsequent%20jobs.%20Both%20of%20these%20factors%20help%20reduce%20the%20possibility%20of%20accidentally%20corrupting%20Artifact%20files.

The contents of an Artifact are uploaded together into an immutable archive. They cannot be altered by subsequent jobs. Both of these factors help reduce the possibility of accidentally corrupting Artifact files.

It just wasn't included in the "What's changed" section of the Dependabot release notes because it just has a summary saying "Lots has changed". I should've followed the link through.

Seems like this is certainly intended though.

@RobertoPrevato
Copy link

RobertoPrevato commented Dec 31, 2023

Well, this is a bad news for me. I find convenient to use the upload-artifact to write different files to the same folder in a build matrix. For example to compile custom C extensions for several combinations of Python versions and operating systems, and publishing to a single folder.

like in https://github.com/Neoteroi/BlackSheep/actions/runs/7370452109/job/20056867940

Now if I want to upgrade my workflow, I need to publish to different folders and download artifacts from multiple sources - making the workflow look like a mess compared to how clean it used to look like. For now I stay with v3 and I hope this will be reconsidered in a future version of these actions.

@DanTup
Copy link
Author

DanTup commented Dec 31, 2023

Yeah, I rolled back to v3 too. Until I'm forced to upgrade, the old way is much more convenient for me.

Kontinuation referenced this issue in apache/sedona Jan 2, 2024
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
syoyo added a commit to lighttransport/jagger-python that referenced this issue Jan 2, 2024
semenko added a commit to mcwdsi/bam2tensor that referenced this issue Jan 3, 2024
Rixxan added a commit to EDCD/EDMarketConnector that referenced this issue Jan 4, 2024
github-merge-queue bot pushed a commit to onnx/onnx that referenced this issue Jan 5, 2024
@seanvaleo
Copy link

I had to roll back also

@ptr727
Copy link

ptr727 commented Jan 6, 2024

Same here, I also use a matrix to build multi platform releases in the same directory, and then zipping them all together, rolling back to v3 :(

@DanTup
Copy link
Author

DanTup commented Jan 6, 2024

Seems like a lot of people have been bitten by this, so although it appears to have been deliberate I'm re-opening for better visibility to see if the authors want to chime in (of course, it's very possible it may just be closed as WAI).

@DanTup DanTup reopened this Jan 6, 2024
flozz added a commit to wanadev/yoga that referenced this issue Jan 6, 2024
dvarrazzo added a commit to psycopg/psycopg that referenced this issue Jan 7, 2024
nvictus added a commit to nvictus/pybbi that referenced this issue Apr 14, 2024
nvictus added a commit to nvictus/pybbi that referenced this issue Apr 14, 2024
nvictus added a commit to nvictus/pybbi that referenced this issue Apr 14, 2024
nvictus added a commit to nvictus/pybbi that referenced this issue Apr 14, 2024
@jennydaman
Copy link

It was just announced that v3 will be disabled on 2024-11-30.

https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/

It is disappointing that the disabling of v3 was announced before v4 reaching feature-completeness.

janosh added a commit to CederGroupHub/chgnet that referenced this issue Apr 18, 2024
…quest: (409) Conflict: an artifact with this name already exists on the workflow run

reported in actions/upload-artifact#478
SkypLabs added a commit to SkypLabs/python4yahdlc that referenced this issue Apr 22, 2024
Version 4 of 'actions/download-artifact' introduced a breaking change
which broke the 'build-wheels' job.

See actions/upload-artifact#478.
BowenD-UCB pushed a commit to CederGroupHub/chgnet that referenced this issue Apr 22, 2024
…quest: (409) Conflict: an artifact with this name already exists on the workflow run (#152)

reported in actions/upload-artifact#478
Oldes added a commit to Oldes/Rebol-C-Extension-Template that referenced this issue Apr 23, 2024
ChristopherRabotin added a commit to nyx-space/hifitime that referenced this issue Apr 23, 2024
@sameeraksc
Copy link

We are having the same issue

@stweil
Copy link

stweil commented Apr 24, 2024

Then update your code. The description how to do that can be found above.

@liyishuai
Copy link

Take a look at main/docs/MIGRATION.md#overwriting-an-artifact

      - name: New override option
        uses: actions/upload-artifact@v4
        with:
          name: build-artifact
          path: ./example
          overwrite: true

Thanks for the notice! Seems like #501 has fixed the issue here.

@stweil
Copy link

stweil commented Apr 24, 2024

If your old configuration merged the artifacts, then overwrite: true would be the wrong choice. Use merge-multiple: true.

git-developer added a commit to git-developer/sc-controller that referenced this issue Apr 25, 2024
MrFired referenced this issue in MrFired/python-bandit-scan Apr 25, 2024
Also bind it to concrete v4 release
pmayd pushed a commit to CorrelAid/pystatis that referenced this issue Apr 30, 2024
* Add badges, update workflows & names #24

* Add coverage report upload and update readme badge link #24

* Downgrade artifact for easier compatibility #24

See actions/upload-artifact#478

* Move and test dev PR coverage and upload to GH pages, update badge link #24

* Add html report, fix directory structure, fix content overwriting #24

* Remove previous coverage_badge.json from GH pages, add recursive directory creation #24

* Catch mistakes for uploading the coverage_report directory #24

* Move step in which the html reports are generated #24

* Update python code quality version (Version 3.11.6 was not found in the local cache) and mkdir coverage_report #24

* Fix attempt: Explicitly create all directories #24

* Fix attempt: Explicitly state publish branch #24

* Remove broken link to html coverage report #24
trag1c added a commit to trag1c/crossandra that referenced this issue May 1, 2024
@charlieforward9
Copy link

I worked around this problem by appending ${{ github.run_number }}-${{ github.run_attempt }} to the artifact name. This guarantees a clean, traceable, unique name on every (re)run.

@dreinhardt89
Copy link

I'm setting overwrite: true and still getting this am I missing something?

Run actions/upload-artifact@v4
  with:
    name: tf-module-cache-key-file
    retention-days: 3
    path: .terraform/modules/modules.json
    overwrite: true
    if-no-files-found: warn
    compression-level: 6
  
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run

@jsoref
Copy link

jsoref commented May 6, 2024

@dreinhardt89: you shouldn't use overwrite: true, you should give each of your artifacts a distinct name and then use the merge subaction: https://github.com/actions/upload-artifact/blob/main/merge/README.md

@josephleung5
Copy link

this migration guide should help?
https://github.com/actions/download-artifact/blob/main/docs/MIGRATION.md

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