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

More meaningfull error when remote failure #4888

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions conans/client/graph/graph_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ def _evaluate_node(self, node, build_mode, update, evaluated_nodes, remote_name)
remote_info, pref = self._remote_manager.get_package_info(pref, remote)
except NotFoundException:
pass
except Exception:
conanfile.output.error("Error downloading binary package: '{}'".format(pref))
raise

# If the "remote" came from the registry but the user didn't specified the -r, with
# revisions iterate all remotes
Expand Down
22 changes: 21 additions & 1 deletion conans/test/integration/install_update_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from conans.model.ref import ConanFileReference, PackageReference
from conans.paths import CONAN_MANIFEST
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, TestServer
from conans.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, TestServer, \
TurboTestClient, GenConanfile
from conans.util.files import load, save


Expand Down Expand Up @@ -292,3 +293,22 @@ def package(self):
pref = PackageReference(ref, NO_SETTINGS_PACKAGE_ID)
header = os.path.join(client.cache.package(pref), "header.h")
self.assertEqual(load(header), "mycontent2")

def fail_usefully_when_failing_retrieving_package_test(self):
ref = ConanFileReference.loads("lib/1.0@conan/stable")
ref2 = ConanFileReference.loads("lib2/1.0@conan/stable")
client = TurboTestClient(servers={"default": TestServer()})
pref1 = client.create(ref)
client.upload_all(ref)

client.create(ref2, conanfile=GenConanfile().with_requirement(ref))
client.upload_all(ref2)

# remove only the package from pref1
client.run("remove {} -p {} -f".format(pref1.ref, pref1.id))

# Now fake the remote url to force a network failure
client.run("remote update default http://this_not_exist8823.com")
# Try to install ref2, it will try to download the binary for ref1
client.run("install {}".format(ref2), assert_error=True)
self.assertIn("ERROR: Error downloading binary package: '{}'".format(pref1), client.out)