upload-artifact icon indicating copy to clipboard operation
upload-artifact copied to clipboard

[bug] tar: File removed before we read it

Open milahu opened this issue 3 years ago • 2 comments

What happened?

i removed files from git in this commit https://github.com/milahu/iceagefarmer/commit/b49eeeebebc37b24dd0e75578afeb527cbf4f2a6

and now the upload to github-pages (actions/upload-pages-artifact@v0) fails with the errors

tar: ./index.atom: File removed before we read it
tar: ./index.xml: File removed before we read it

build log https://github.com/milahu/iceagefarmer/runs/6790511915?check_suite_focus=true#step:3:1486

What did you expect to happen?

dont upload missing files

How can we reproduce it?

echo hello > test.txt
git add test.txt
git commit -m "add test.txt"
git push
# wait for upload

git rm test.txt
git commit -m "rm test.txt"
git push
# upload should fail

Anything else we need to know?

(the upload is really slow, 6 minutes for 500MByte, i hope there is a solution with rsync)

What version of the action are you using?

v0

What are your runner environments?

self-hosted

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

No response

milahu avatar Jun 08 '22 09:06 milahu

in my case Tar was failing on a broken symlink

coderofsalvation avatar May 17 '24 16:05 coderofsalvation

yes, broken symlinks make tar --dereference fail

  echo ::group::Archive artifact
  tar \
    --dereference --hard-dereference \
    --directory "$INPUT_PATH" \
    -cvf "$RUNNER_TEMP/artifact.tar" \
    --exclude=.git \
    --exclude=.github \
    .

to find broken symlinks in a git repo:

find . -xtype l | xargs git ls-files --

another problem here is that the error message tar: ./path/to/some/file: File removed before we read it is buried in the middle of the logfile because apparently, stdout and stderr are not correctly interleaved a quickfix would be tar ... 2>&1

milahu avatar Oct 16 '24 16:10 milahu