fpco/cache-s3

Permission denied error during save on Windows

Closed this issue · 4 comments

This problem was introduced in 0.1.8. (0.1.7 was fine) and only affects Windows. I could reproduce this on:

  • Windows 2016 (AMI provided by AWS)
  • Windows 10 Vagrant box.

It enough to invoke the save command to trigger this error:

> cache-s3 --prefix=cache-s3-test save --relative-path clcache
[cache-s3][Info ][Tue, 16 Apr 2019 12:58:20 UTC]: Caching: clcache
[cache-s3][Info ][Tue, 16 Apr 2019 12:58:44 UTC]: <master.cache> - No previously stored cache was found.
[cache-s3][Info ][Tue, 16 Apr 2019 12:58:44 UTC]: <master.cache> - Data change detected, caching 308.3 MiB with sha256: bNlkj0BqEBs8JBa8flvruMvhjpIgkE6LdD5q9F49quM=
cache-s3: C:\Users\vagrant\AppData\Local\Temp\cache-s3.tar7484-0.gzip: DeleteFile "\\\\?\\C:\\Users\\vagrant\\AppData\\Local\\Temp\\cache-s3.tar7484-0.gzip": permission denied (Access is denied.)

The error message displays \\?\ characters in the PATH, this suggests some Win32 path compatibility quirk.

Looks very similar to "Case 5" documented here: https://support.microsoft.com/en-us/help/320081/you-cannot-delete-a-file-or-a-folder-on-an-ntfs-file-system-volume

@wagdav I am pretty sure this issue is due to temporary-resourcet package (or improper usage thereof), but instead of digging into it I'd rather switch to the package that I know will work for sure.
Could you confirm this issue is fixed in `permission-denied' branch. If you need a prerelease (a downloadable binary) to confirm it, let me know I can create one fairly quickly

@lehins Thanks for the quick update, I'll test it tomorrow, first thing in the morning!

@wagdav I was able to reproduce the error on AppVeyor and confirm that it is fixed now. I'll make a new release in a little bit. Reopen the issue if you find that the issue is still there in the upcoming cache-s3-0.1.9

@lehins Thank you for the quick fix! I could also confirm that now it's working OK! 👍