From 4094e59ab86284ee955bb91bfc4f59cb4ebd3e8b Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Thu, 22 Sep 2022 10:54:52 -0700 Subject: 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(-) (limited to 'lib') diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index ae23bacf14..5ed46c3278 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -338,6 +338,7 @@ class URLFetchStrategy(FetchStrategy): 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 202cb8a504..fa4119f917 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 -- cgit v1.2.3-70-g09d2