Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload with --force doesn't regenerate repodata.json #535

Open
wolfv opened this issue May 19, 2022 · 8 comments
Open

Upload with --force doesn't regenerate repodata.json #535

wolfv opened this issue May 19, 2022 · 8 comments

Comments

@wolfv
Copy link
Member

wolfv commented May 19, 2022

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.

@brichet
Copy link
Collaborator

brichet commented Jul 22, 2022

@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 ?

@wolfv
Copy link
Member Author

wolfv commented Jul 23, 2022

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

@brichet
Copy link
Collaborator

brichet commented Jul 25, 2022

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
Copy link
Collaborator

brichet commented Jul 28, 2022

There are 2 different API requests that can upload a package :

quetz/quetz/main.py

Lines 1284 to 1288 in d272e61

@api_router.post(
"/channels/{channel_name}/packages/{package_name}/files/",
status_code=201,
tags=["files"],
)

and
@api_router.post("/channels/{channel_name}/files/", status_code=201, tags=["files"])

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

This may be the error you have encountered.

@wolfv
Copy link
Member Author

wolfv commented Jul 28, 2022

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

@brichet
Copy link
Collaborator

brichet commented Jul 28, 2022

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 :

quetz-client http://localhost:8000/api/channels/channel0 xtensor/linux-64/xtensor-0.16.1-0.tar.bz2 xtensor/osx-64/xtensor-0.16.1-0.tar.bz2

We should fix the first API function anyway.

@wolfv
Copy link
Member Author

wolfv commented Jul 28, 2022

For sure! Thanks for working on this!

@brichet
Copy link
Collaborator

brichet commented Aug 16, 2022

Should be fixed in #555
@wolfv do you still have the error ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants