-
Notifications
You must be signed in to change notification settings - Fork 54
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
Cargo checksum verification fails #151
Comments
Hi, I've tried to replicate the situation you described using a fresh build of Alexandrie (built with the features But, while taking a closer look at how the crate checksums are computed within the crate publication routine, I think this is possibly due to the crate being larger than the currently-hardcoded size limit of 10 MB. I think you can verify whether this is what effectively happened by either:
This is not the first time there have been issues with the quite-low hardcoded size limit that I picked long ago arbitrarily. |
The maximum crate size is now configurable using a new Feel free to try adjusting this value and see if it indeed solves your issue. |
Hi, thanks for your response and for your quick fix. Unfortunately I belive this is not my issue. I just checked my crate file size and it's 2,9 KB. On really strange thing I noticed is that on one PC I don't run into this issue while on two others I do. My dev setup is in a docker contaiener so everything should be exectly the same. Do you have another idea what I could try to find that bug? Regards, |
It is quite worrying to have an error like this possibly buried in the code. |
I've looked into this some more, but I could not identify from where this issue is coming from. By doing some research, it seems that Cargo can sometimes emit this error when working with crate versions containing a If this is not the reason, one thing that could help in figuring out what happened would be to:
With these three values, I suspect it could be easier to determine what's going on, especially if only one of these three is different. |
Hi, thanks again for looking into it. I've tested on two PCs: My laptop and the server. In both I use the same docker container, so there should be no difference. When I ran The cecksum I collected from the create-index was also equal to the ones I got from curl. Also in the cargo.lock file the URLs were the same as the one I found before. So all checksums matched. For the curl command I concluded that alexandrie does not use the token to restrict read access. So I tried to remove the token on the CI job and then So I guess cargo is sending the token in the request when getting the crate and maybe this causes alexandire to send something else. Maybe a 404 page... Does this help you finding the bug? Should I test something else? |
Thank you for coming back and continuing to help to get at the bottom of this issue. I have done more testing and tried running But then, I managed to recreate the checksum verification error by forcing the registry to return an error for that endpoint. The crate download endpoint can indeed error if the crate can't be found in the registry's database: alexandrie/crates/alexandrie/src/api/crates/download.rs Lines 51 to 53 in 3e89db1
But this Cargo error would also be there if any of the You can try to find out which of these cases happened by looking at the logs from that day, the response errors are typically visible in there. |
Thank you for investigating further. I've checked the logs as you described.
I'm using the SQLite variant. I guess this could also explain why the problem only happens on my CI server. It's in the same cloud datacenter, so the connection between the CI server and the alexandrie server is a lot faster. |
I want to add another instance that might be related and duplicatable. My project builds fine with /backend/cargo.toml
/backend/Dockerfile.development
/docker-compose.yml
Error:
I hope this helps. |
I think I found the reason. Cargo downloads all missing dependencies concurrently when invoking Maybe it is a failure related to database concurrency as the download should update the number of downloads in the database for the two crates. I have checked that the checksums are correct in the index (same as running openssl sha256 on the uploaded |
Setting Should this be set to a default setting when using SQLite as backend? |
I've configured [database]
url = "appdata/sqlite/alexandrie.db"
max_conn = 1 The error from the log file is:
I'm using the latest version as of today. |
I solved the issue for me now by switching to postgres db-backend. |
Just experienced the same issue when building in a container. I also came right following the advice above. |
Hi,
I've a Problem with a private Alexandrie repository and Cargo:
I've three projects: A, B and C.
B depends on A.
C depends on A and B.
A and B are deployed to Alexandrie.
Then I try to build project C I get the following error:
If I replace the dependency to project B by a direct git dependency it woks without any problems.
So I guess it's something with having a dependency in the registry that again has a dependency in the private registry.
Could you give me a hint how to debug this problem?
The text was updated successfully, but these errors were encountered: