actions / upload-artifact

MIT License
3.26k stars 739 forks source link

[bug] Upload fails intermittently with 400 artifact name not valid error #410

Closed kishaningithub closed 11 months ago

kishaningithub commented 1 year ago

What happened?

The upload action fails intermittently with a 400 status with message The artifact name is not valid. The file definitely exists for this action to perform the upload

Logs

Run actions/upload-artifact@v3
With the provided path, there will be 1 file uploaded
Starting artifact upload
For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
Artifact name is valid!
Create Artifact Container - Error is not retryable
##### Begin Diagnostic HTTP information #####
Status Code: 400
Status Message: Bad Request
Header Information: {
  "cache-control": "no-store,no-cache",
  "pragma": "no-cache",
  "content-length": "209",
  "content-type": "application/json; charset=utf-8",
  "strict-transport-security": "max-age=2592000",
  "x-tfs-processid": "cff44373-8b80-4cce-acbe-643b6e3d5dfb",
  "activityid": "2f6017b6-e0db-42eb-97f8-d7dc96d2e488",
  "x-tfs-session": "2f6017b6-e0db-42eb-97f8-d7dc96d2e488",
  "x-vss-e2eid": "2f6017b6-e0db-42eb-97f8-d7dc96d2e488",
  "x-vss-senderdeploymentid": "f7faf8cf-7ae4-3f62-0792-ce64b15bce23",
  "x-frame-options": "SAMEORIGIN",
  "x-cache": "CONFIG_NOCACHE",
  "x-msedge-ref": "Ref A: 26FDABB677554CD8AFB8E8E4362FB3B0 Ref B: BY3EDGE0205 Ref C: 2023-06-26T20:17:26Z",
  "date": "Mon, 26 Jun 2023 20:17:26 GMT",
  "connection": "close"
}
###### End Diagnostic HTTP information ######
##### Begin Diagnostic HTTP information #####
Status Code: 400
Status Message: Bad Request
Header Information: {
  "cache-control": "no-store,no-cache",
  "pragma": "no-cache",
  "content-length": "209",
  "content-type": "application/json; charset=utf-8",
  "strict-transport-security": "max-age=2592000",
  "x-tfs-processid": "cff44373-8b80-4cce-acbe-643b6e3d5dfb",
  "activityid": "2f6017b6-e0db-42eb-97f8-d7dc96d2e488",
  "x-tfs-session": "2f6017b6-e0db-42eb-97f8-d7dc96d2e488",
  "x-vss-e2eid": "2f6017b6-e0db-42eb-97f8-d7dc96d2e488",
  "x-vss-senderdeploymentid": "f7faf8cf-7ae4-3f62-0792-ce64b15bce23",
  "x-frame-options": "SAMEORIGIN",
  "x-cache": "CONFIG_NOCACHE",
  "x-msedge-ref": "Ref A: 26FDABB677554CD8AFB8E8E4362FB3B0 Ref B: BY3EDGE0205 Ref C: 2023-06-26T20:17:26Z",
  "date": "Mon, 26 Jun 2023 20:17:26 GMT",
  "connection": "close"
}
###### End Diagnostic HTTP information ######
Error: Create Artifact Container failed: The artifact name tfplan is not valid. Request URL https://pipelines.actions.githubusercontent.com/fVfkSMTc7sZjVQkJsOk6FB59FieriHI0QZLhvYcifqX7U5B7vl/_apis/pipelines/workflows/5350316710/artifacts?api-version=6.0-preview

What did you expect to happen?

I expected no intermittent errors like above and upload to succeed

How can we reproduce it?

Its a bit tricky as this happens intermittenly but this was the step config

- name: Publish Terraform Plan
  uses: actions/upload-artifact@v3
  with:
    name: tfplan
    path: tfplan

Anything else we need to know?

Re-running the pipeline fixes this issue. But this keeps happening now and then.

What version of the action are you using?

v3

What are your runner environments?

linux

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

No response

hzerip commented 1 year ago

I'm having the same problem, @kishaningithub have you found a solution for this?

kishaningithub commented 1 year ago

@hzerip Well.. My solution was to ditch this and use s3 directly..

If the maintainers can give a direction i am willing to contribute to this repo

alesnovak-s1 commented 1 year ago

@hzerip In my case the error was caused by uploading two files with the same name at the same time from two different jobs.

konradpabjan commented 11 months ago

v4 has shipped today https://github.blog/changelog/2023-12-14-github-actions-artifacts-v4-is-now-generally-available/

I recommend switching over as these classes of issues should no longer happen with the release