[bitbake-devel] [PATCH 1/1] wget.py: Print warning when checkstatus() failed

Robert Yang liezhi.yang at windriver.com
Tue Apr 23 07:43:59 UTC 2019


This makes it easier to debug, for example, when I ran:

$ bitbake-selftest bb.tests.fetch.FetchCheckStatusTest

It said failed:
FAIL: test_wget_checkstatus_connection_cache (bb.tests.fetch.FetchCheckStatusTest) (url='ftp://sourceware.org/pub/libffi/libffi-1.20.tar.gz')

But didn't know the reason, this warning message can help me find that
something is wrong with my ftp settings (I set a wrong proxy for ftp).

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 bitbake/lib/bb/fetch2/wget.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 3bb3e3b..ffcd40a 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -216,7 +216,7 @@ class Wget(FetchMethod):
                         # Apparently urllib then uses the file descriptor, expecting it to be
                         # connected, when in reality the connection is already gone.
                         # We let the request fail and expect it to be
-                        # tried once more ("try_again" in check_status()),
+                        # tried once more ("try_again" in checkstatus()),
                         # with the dead connection removed from the cache.
                         # If it still fails, we give up, which can happend for bad
                         # HTTP proxy settings.
@@ -338,8 +338,7 @@ class Wget(FetchMethod):
                 logger.debug(2, "checkstatus: trying again")
                 return self.checkstatus(fetch, ud, d, False)
             else:
-                # debug for now to avoid spamming the logs in e.g. remote sstate searches
-                logger.debug(2, "checkstatus() urlopen failed: %s" % e)
+                logger.warning("checkstatus() urlopen failed: %s" % e)
                 return False
         return True
 
-- 
2.7.4



More information about the bitbake-devel mailing list