You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello !
I found error as shown in #133
I tried to fix this by using windows as system.
Cache was made but the new error occured.
Run actions/cache@v1
Cache Size: ~102 MB (107455822 B)
C:\windows\System32\tar.exe -xz -f d:\a_temp\5bff5da6-b2e7-439a-9f1e-b8eb52fb391e\cache.tgz -C C:\Users\runneradmin.cargo\registry
./index/github.com-1ecc6299db9ec823/.git/objects/pack/pack-a1b8e2d02676504008fea86ca360367fcee5bd43.idx: Can't unlink already-existing object
./index/github.com-1ecc6299db9ec823/.git/objects/pack/pack-a1b8e2d02676504008fea86ca360367fcee5bd43.pack: Can't unlink already-existing object
tar.exe: Error exit delayed from previous errors.
[warning]Tar failed with error: The process 'C:\windows\System32\tar.exe' failed with exit code 1. Ensure BSD tar is installed and on the PATH.
I am trying to cache cargo. I am using code from Action examples
Hi @mikart143, could you please provide your full workflow file? The error Can't unlink already-existing object seems to indicate those files in the cargo registry already exist and the action does not have permission to delete them. Is cargo creating / populating the registry before the cache restore step is performed?
This workflow run demonstrates the problem. Compared to the tar of the same repository index on Linux and Mac, the archive created on Windows is more than 1.5 times larger and unpacking fails with the "Can't unlink already-existing object" messages.
My guess is that tar on Windows does not handle hardlinks or symlinks properly?
To clarify, this explains the particular failure as it was reported. This does not explain why tar.exe in Windows fails to overwrite files that were baked into the virtual environment image, when unpacking from an archive that it itself packaged these files into, while having no problems unpacking an archive that was created by GNU tar on Linux.
This does not explain why tar.exe in Windows fails to overwrite files that were baked into the virtual environment image, when unpacking from an archive that it itself packaged these files into, while having no problems unpacking an archive that was created by GNU tar on Linux.
This may be a red herring since there is no intersection in the git pack files between the two checkouts, as tested here:
A solution suggested in actions/runner-images#936 (comment) is to use the tar executable bundled with Git, and use the --force-local option to interpret Windows path names as local file paths rather than remote tape drive servers 🗝️.
Hi @mzabaluev we are tracking this issue in #984. Please check the current proposal there and provide comments/feedback if any. Closing this as duplicate.
👋🏼 @mzabaluev We have released a new beta release which should fix this issue. Try tag: actions/[email protected]. Head over to discussion for feedback: #1019
Activity
dhadka commentedon Feb 26, 2020
Hi @mikart143, could you please provide your full workflow file? The error
Can't unlink already-existing objectseems to indicate those files in the cargoregistryalready exist and the action does not have permission to delete them. Is cargo creating / populating theregistrybefore the cache restore step is performed?mikart143 commentedon Feb 26, 2020
It occure on security_audit job
mzabaluev commentedon May 22, 2020
This workflow run demonstrates the problem. Compared to the tar of the same repository index on Linux and Mac, the archive created on Windows is more than 1.5 times larger and unpacking fails with the "Can't unlink already-existing object" messages.
My guess is that tar on Windows does not handle hardlinks or symlinks properly?
mzabaluev commentedon May 22, 2020
One thing that may help debugging this is if you dump the tar file contents with
tar -tzvprior to unpacking.mzabaluev commentedon May 25, 2020
It's caused by actions/runner-images#895 and here's proof.
On Linux the same pre-populated repository checkout exists too, but tar manages to overwrite it without an issue.
mzabaluev commentedon May 25, 2020
To clarify, this explains the particular failure as it was reported. This does not explain why tar.exe in Windows fails to overwrite files that were baked into the virtual environment image, when unpacking from an archive that it itself packaged these files into, while having no problems unpacking an archive that was created by GNU tar on Linux.
mzabaluev commentedon May 25, 2020
This may be a red herring since there is no intersection in the git pack files between the two checkouts, as tested here:
mzabaluev commentedon May 25, 2020
Sure enough, repro'd with the Windows content repacked on Linux.
As long as files that come from the virtual environment image are being replaced, tar fails.
mzabaluev commentedon May 25, 2020
I see no difference in ACLs between the pre-populated files:
and files created by a script in a runner job:
mzabaluev commentedon May 25, 2020
This has nothing to do with ACLs or symlinks (AKA junctions), and everything to do with read-only files: actions/runner-images#936
mzabaluev commentedon May 26, 2020
A solution suggested in actions/runner-images#936 (comment) is to use the
tarexecutable bundled with Git, and use the--force-localoption to interpret Windows path names as local file paths rather than remote tape drive servers 🗝️.lukka commentedon Dec 13, 2020
Any updates on this long standing issue?
Look like @mzabaluev has done the needed investigation and found a potential solution.
This affects any consumer of the GitHub action actions/cache and of the @actions/cache NPM package.
It affects for example run-vpkg.
github-actions commentedon Dec 23, 2021
This issue is stale because it has been open for 365 days with no activity. Leave a comment to avoid closing this issue in 5 days.
mzabaluev commentedon Dec 23, 2021
Yes, we still need tar in the cache action to be fixed.
lvpx commentedon Nov 16, 2022
Hi @mzabaluev we are tracking this issue in #984. Please check the current proposal there and provide comments/feedback if any. Closing this as duplicate.
Phantsure commentedon Dec 7, 2022
👋🏼 @mzabaluev We have released a new beta release which should fix this issue. Try tag:
actions/[email protected]. Head over to discussion for feedback: #1019