-
Notifications
You must be signed in to change notification settings - Fork 989
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
Fix corrupted packages with missing conanmanifest.txt files #4662
Conversation
Included some test to check also the search and install commands |
I don't think changing the order helps here. upload has to be transnational operation - conan either uploads everything or nothing. if it's interrupted during the upload (e.g. Ctrl-C pressed, conan crashed, network error occurred or whatever else happened), it should never finalize the transaction and files that were already uploaded or partially uploaded by that time should be discarded. |
That is the best solution but the upload is not done in one transaction but file by file and it seems that cannot be changed in the server side. I know this fix does not fix the issue but it tries to minimize it as much as we can |
still better than nothing. if it reduces the rate of problem occurrence, I fully support applying it. |
So finally I think I have a bunch of interesting tests here bringing some additional information to the original situation like the one described in #4672 To me, this is something that it is worth to have consistent behavior and probably a naive solution would be to check in install/download and upload of packages that the 3 files that define a package are correctly in place, although that would mean that if in the future we decide to remove one of those files the old clients will be broken (although this is something that would require a 2.0 or equivalent). Having all this into account I would like to know your opinion or at least bring this discussion to one of our whiteboard sessions @conan-io/barbarians PS: Don't worry about the prints in tests, those are just a proof of concept to get the idea. I will rework them when we agree on a solution 😜 |
@@ -234,7 +234,7 @@ def reuse_test(self): | |||
self.client.run("install Hello0/1.0@lasote/stable --build") | |||
self.client.run("upload Hello0/1.0@lasote/stable --all") | |||
|
|||
client2 = TestClient(servers=self.servers, users={"default": [("lasote", "mypass")]}) | |||
client2 = TestClient(servers=self.servers, users={"myremote": [("lasote", "mypass")]}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was failing before at this point https://github.com/conan-io/conan/pull/4662/files#diff-9e273c58f528ec321db5954d73096c3aR133 due to bad credentials for the remote. I am not sure if this PR is changing any behavior or the test was wrong 😕
Added the changes to improve the integrity of packages in the complete loop of upload-search-install-upload. The search couldn't be improved as the values returned by the server are the conaninfo content directly, so not much we can do. Please take note that this makes an extra API call to check the snapshot in the package installation (download) from the server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this will help the user to cope with some errors
PR is ready. Please take a look so it can be merged |
Changelog: Fix: Fix corrupted packages with missing conanmanifest.txt files
Docs: omit
Close #4698
@revisions: 1
We found an issue on Bintray about missing files in a package, in that case only the conaninfo.txt file was uploaded out of the conan_package.tgz and conanmanifest.txt.
In that case the problematic comes when you want to upload a new package as ir fais becaouse of the following:
To mitigate this I propose a behavior that is already being done in the recipe upload: Check that the manifest is in the snapshot (actually in the recipe upload it checks the availability of the digest and if not there -404- it assusmes there is no package uploaded).
I the digest is for some reason not available it assumes there is no existing package uploaded and it uploads everything.
Another useful change to mitigate this (not proposed at the time of opening this PR) is changing the order of the files upload. Now the files are uploaded in this order: conanmanifest.txt --> conaninfo.txt --> conan_package.tgz and it is done intetionally this way for some reason
conan/conans/client/rest/rest_client_v1.py
Line 40 in a52dcdc
From my point of view, the most problematic file during the upload is the conan_package.tgz and it should be uploaded in first place, then the conaninfo.txt and finally the conanmanifest.txt to wrap up the complete upload.