Open kwazzi-jack opened 3 years ago
Thanks for the in-depth investigation @brianwelman2. Would you consider submitting a PR to fix?
I think that the corrupted download should be removed if the hash check fails
I'm not certain how the cache python api works though, but I can have a go.
On Wed, 17 Feb 2021, 09:29 Simon Perkins, notifications@github.com wrote:
I think that the corrupted download should be removed if the hash check fails
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ratt-ru/packratt/issues/18#issuecomment-780363921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE5OS5BSDG66TKPHM43RKCDS7NV5BANCNFSM4XWPJCAQ .
To reproduce the problem, I have a private google drive folder setup with a single MS called
KAT7_200_7_1.tar.gz
. The yaml entry inregistry.yaml
is as follows:Where the
file_id
is from the url of the MS share link, and the hash is calculated in my terminal using as suggested:If I run the command-line packratt for this measurement set, the following
ValueError
is raised:where it seems restricted access folders/files produce a different sha256 hash:
but can be fixed by setting the folder and its contents to public. The issue comes with trying to run the same packratt command after fixing the drive permissions.
The only way around this is to remove the cached file:
Then packratt get command is back to normal. Looking at the
get
function ininterface.py
, my assumption is that the problem occurs in lines 63 to 67:The file is downloaded and stored in
.cache
with the incorrect hash since the drive permissions changed the resulting hash value. Now even if I change permissions on google drive, packratt always checks for the file in.cache
and will always throw theValueError
until the cached version is removed to correct the hash-key.Side note: Is it intended functionality to still keep the downloaded files in
.cache
even if the hash check fails?