actions / upload-artifact

MIT License
3k stars 683 forks source link

[bug] Artifact overwrite doesn't always work #571

Open dvd42 opened 1 month ago

dvd42 commented 1 month ago

What happened?

I run the following:

Run actions/upload-artifact@v4
  with:
    name: coverage-132-python_services_AI_PE
    path: coverage.xml
    overwrite: true
    retention-days: 15
    if-no-files-found: warn  
    compression-level: 6  

I get:

    With the provided path, there will be 1 file uploaded
Artifact 'coverage-132-python_services_AI_PE' (ID: 1554547722) deleted
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 2459
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is ade371acd3b3694e3719d4f7e6a5e87d3d9f03ee3a9c4a7170c6f22ea588a488
Finalizing artifact upload
Artifact coverage-132-python_services_AI_PE.zip successfully finalized. Artifact ID 1554567367
Artifact coverage-132-python_services_AI_PE has been successfully uploaded! Final size is 2459 bytes. Artifact ID is 1554567367

I rerun it:

   Run actions/upload-artifact@v4
  with:
    name: coverage-132-python_services_AI_PE
    path: coverage.xml
    overwrite: true
    retention-days: 15
    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!
Beginning upload of artifact content to blob storage
Uploaded bytes 2459
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is 66e88e2c255466f590048ad87d1ad78adc4547825a47df05bbab9a95dc10b56e
Finalizing artifact upload
Artifact coverage-132-python_services_AI_PE.zip successfully finalized. Artifact ID 155586
Artifact coverage-132-python_services_AI_PE has been successfully uploaded! Final size is 2459 bytes. Artifact ID is 1555861812

Why on earth doesn't the file get overwritten in both cases? What am I doing wrong?

What did you expect to happen?

I expected the file to be overwritten in both cases

How can we reproduce it?

Yesterday it worked but I cannot get it to work again, so I cannot go back to a state where it works as expected

Anything else we need to know?

No response

What version of the action are you using?

Tried both 4 and 4.3.1

What are your runner environments?

linux

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

No response

pauldraper commented 1 month ago

Same. overwrite: true doesn't prevent conflict from happening.

Screenshot 2024-06-01 at 3 29 50 PM

It seems to be non-deterministic; a re-run fixes it.


My money is on read-modify-write.

Will we ever improve?

pauldraper commented 1 month ago

My money is on read-modify-write

Will we ever improve?

https://github.com/actions/upload-artifact/blob/552bf3722c16e81001aea7db72d8cedf64eb5f68/src/upload/upload-artifact.ts#L11

Though FWIW, I don't think this is sole source of the problem. I suspect@actions/artifact.