quetz icon indicating copy to clipboard operation
quetz copied to clipboard

Upload with `--force` doesn't regenerate `repodata.json`

Open wolfv opened this issue 2 years ago • 8 comments

When uploading the same package version again (using --force) the repodata is not generated, which can lead to SHA256 and file size mismatches.

We should properly store the new checksum & file size and regenerate the repodata.json.

wolfv avatar May 19 '22 07:05 wolfv

@wolfv I can't reproduce it. Using the quetz-client command line the repodata.json file is modified, including SHA256 and MD5 values. Can you give some more context to reproduce it ?

brichet avatar Jul 22 '22 15:07 brichet

Did you upload two different files with the exact same name?

wolfv avatar Jul 23 '22 09:07 wolfv

Yes, the exact same name, returning an error without the --force flag. I tested with the xtensor package, by adding a file in the package archive to change the resulting hash.

brichet avatar Jul 25 '22 07:07 brichet

There are 2 different API requests that can upload a package : https://github.com/mamba-org/quetz/blob/d272e615323c7110bfb7356746e66bdaf7658eae/quetz/main.py#L1284-L1288 and https://github.com/mamba-org/quetz/blob/d272e615323c7110bfb7356746e66bdaf7658eae/quetz/main.py#L1375

The first one doesn't build the repodata.json file at all.

This may be the error you have encountered.

brichet avatar Jul 28 '22 12:07 brichet

we could check which one is used by the quetz-cli that uploads packages.

wolfv avatar Jul 28 '22 13:07 wolfv

The quetz-client use by default the one which build the repodata, if only a channel name is provided. But the full URL to the API can be provided, like the example in the README : https://github.com/mamba-org/quetz/blob/d272e615323c7110bfb7356746e66bdaf7658eae/README.md?plain=1#L80

We should fix the first API function anyway.

brichet avatar Jul 28 '22 13:07 brichet

For sure! Thanks for working on this!

wolfv avatar Jul 28 '22 14:07 wolfv

Should be fixed in https://github.com/mamba-org/quetz/pull/555 @wolfv do you still have the error ?

brichet avatar Aug 16 '22 07:08 brichet