From 4094e59ab86284ee955bb91bfc4f59cb4ebd3e8b Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Thu, 22 Sep 2022 10:54:52 -0700 Subject: [PATCH] Fetching: log more exceptions (#32736) Include exception info related to url retrieval in debug messages which otherwise would be swallowed. This is intended to be useful for detecting if CA configuration interferes with downloads from HTTPS links. --- lib/spack/spack/fetch_strategy.py | 1 + lib/spack/spack/util/web.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index ae23bacf142..5ed46c3278d 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -338,6 +338,7 @@ def fetch(self): errors = [] for url in self.candidate_urls: if not web_util.url_exists(url, self.curl): + tty.debug("URL does not exist: " + url) continue try: diff --git a/lib/spack/spack/util/web.py b/lib/spack/spack/util/web.py index 202cb8a5044..fa4119f9173 100644 --- a/lib/spack/spack/util/web.py +++ b/lib/spack/spack/util/web.py @@ -444,7 +444,8 @@ def url_exists(url, curl=None): try: read_from_url(url) return True - except (SpackWebError, URLError): + except (SpackWebError, URLError) as e: + tty.debug("Failure reading URL: " + str(e)) return False