Closed
Description
What happened?
When .gitkeep
is included in the list of files to be uploaded, actions/upload-artifact
will fail with error.
This may only happen on windows-latest
runners. ubuntu-latest
seems to be fine.
This has been occurring since today (2021/12/08).
Yesterday (2021/12/07) was fine.
Error: Unexpected response. Unable to upload chunk to https://pipelines.actions.githubusercontent.com/R72NorkoW9ZqUdNNnkQJ7wZXzUBqqBP6BKGnI5jkEJDBXVD3cp/_apis/resources/Containers/17385241?itemPath=artifact1%5C.gitkeep
##### Begin Diagnostic HTTP information #####
Status Code: 400
Status Message: Bad Request
Header Information: {
"cache-control": "no-store,no-cache",
"pragma": "no-cache",
"transfer-encoding": "chunked",
"content-type": "application/json; charset=utf-8",
"strict-transport-security": "max-age=2592000",
"x-tfs-processid": "5868939c-6677-454c-8ba5-a6a3f6dd88ad",
"activityid": "5b5c5588-a9ef-412d-891c-e6f9e9a34a57",
"x-tfs-session": "5b5c5588-a9ef-412d-891c-e6f9e9a34a57",
"x-vss-e2eid": "5b5c5588-a9ef-412d-891c-e6f9e9a34a57",
"x-vss-senderdeploymentid": "13a19993-c6bc-326c-afb4-32c5519f46f0",
"x-frame-options": "SAMEORIGIN",
"x-cache": "CONFIG_NOCACHE",
"x-msedge-ref": "Ref A: EBFE4D5B86A44CE792391F4FD8D6E1E7 Ref B: BN3EDGE0913 Ref C: 2021-12-08T10:20:16Z",
"date": "Wed, 08 Dec 2021 10:20:15 GMT"
}
###### End Diagnostic HTTP information ######
Warning: Aborting upload for D:\a\testartifact\testartifact\Folder1\.gitkeep due to failure
##[debug]deleting temporary gzip file C:\Users\RUNNER~1\AppData\Local\Temp\tmp-5132-tBLrtZS66WVd
##[debug]File: 1/2. D:\a\testartifact\testartifact\Folder1\.gitkeep took 45.090 milliseconds to finish upload
Error: aborting artifact upload
What did you expect to happen?
The artifact upload should be successful.
How can we reproduce it?
I have created a simple repository to reproduce this issue, please see the workflow log.
Uploading Folder1
which contains .gitkeep
fails and uploading Folder2
which does not contain it succeeds.
https://github.com/mkht/testartifact/runs/4455738308
workflow yaml
name: test
on:
workflow_dispatch:
branches:
- main
jobs:
Build:
runs-on: windows-latest
timeout-minutes: 10
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v2
- name: create test dir & file (with .gitkeep)
run: |
New-Item -Path ./Folder1 -ItemType Directory -Force
New-Item -Path ./Folder1/.gitkeep -ItemType File -Force
'test1' | Out-File -FilePath ./Folder1/test1.txt -Force
- name: create test dir & file (without .gitkeep)
run: |
New-Item -Path ./Folder2 -ItemType Directory -Force
'test2' | Out-File -FilePath ./Folder2/test2.txt -Force
- name: upload with .gitkeep
uses: actions/upload-artifact@v2
if: always()
with:
name: artifact1
path: Folder1
- name: upload without .gitkeep
uses: actions/upload-artifact@v2
if: always()
with:
name: artifact2
path: Folder2
Anything else we need to know?
No response
What version of the action are you using?
v2
What are your runner environments?
window
Are you on GitHub Enterprise Server? If so, what version?
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
ferpasri commentedon Dec 9, 2021
Is
.gitkeep
an empty file? 0kbI have same error with a specific test of my tool that creates an empty log file 0kb
mkht commentedon Dec 9, 2021
Yes.
.gitkeep
is an empty.Nonzero .gitkeep to avoid issue with actions/upload-artifact
t1m0thyj commentedon Dec 10, 2021
Seeing this same issue when uploading a folder that includes an empty file. Only started failing on Windows builds this week, and still uploads fine on the Ubuntu and macOS GHA runners.
astafan8 commentedon Dec 10, 2021
seeing similar issue with
.nojakyll
file on our repo, https://github.com/QCoDeS/Qcodes/runs/4485121681?check_suite_focus=true. only on Windows build, only recently.lilyinstarlight commentedon Dec 10, 2021
We are experiencing the same issue with uploads involving empty files on Windows. It looks like actions/toolkit#748 (which was included in the recent 0.6.0 release of
@actions/artifact
and 2.3.0 of this action) includes edge case handling for Windows + empty files, since apparently named pipes can't be detected via astat
in msys2. It could possibly be related, but I don't see an immediately obvious reason that change would cause an issue (pinging @zregvart and @konradpabjan just in case though)ForNeVeR commentedon Dec 10, 2021
The workaround is to switch to v2.2.4:
konradpabjan commentedon Dec 10, 2021
Yup, this bug unfortunately is related the changes in actions/toolkit and named pipes. We'll work on a fix. For the time being though you can pin to an older version of the action as a workaround.
[-][bug] Upload of artifacts fails if .gitkeep is included[/-][+][bug] Upload of artifacts fail on Windows if empty files included[/+]fix: drop support for named pipes on Windows
28 remaining items