wget.py: Print warning when checkstatus() failed
PATCH 1/1 wget.py: Print warning when checkstatus() failed
In reply to Robert YangThis 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).
--- bitbake/lib/bb/fetch2/wget.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
bitbake/lib/bb/fetch2/wget.py +2 -3
@@ -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
Signature · 1 line
2.7.4
cover wget.py: Print warning when checkstatus() failed
The following changes since commit c23c8ebc7f66a92110bfc9e3c4d633a432d1353b:
core-image-sato-sdk-ptest: Try and keep image below 4GB limit (2019-04-16 11:10:02 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib rbt/wget
http://git.pokylinux.org/cgit.cgi//log/?h=rbt/wget
Robert Yang (1):
wget.py: Print warning when checkstatus() failed
bitbake/lib/bb/fetch2/wget.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
Hi Ross,
Quoted 29 lines · Robert Yang
This makes it easier to debug, for example, when I ran:
$ bitbake-selftest bb.tests.fetch.FetchCheckStatusTestIt 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 <[email protected]>--- bitbake/lib/bb/fetch2/wget.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)bitbake/lib/bb/fetch2/wget.py +1
-1@@ -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.
bitbake/lib/bb/fetch2/wget.py class Wget(FetchMethod): · line 342
Quoted 5 lines
bitbake/lib/bb/fetch2/wget.py +0
-2@@ -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)
You added these comments in the past, is the "spamming" still an issue, please? Or how can I reproduce it?
// Robert
Quoted 5 lines
bitbake/lib/bb/fetch2/wget.py +1
-0+ logger.warning("checkstatus() urlopen failed: %s" % e) return False return True
Quoted 47 lines · Robert Yang
Hi Ross,
Quoted 44 lines · Robert Yang
This makes it easier to debug, for example, when I ran:
$ bitbake-selftest bb.tests.fetch.FetchCheckStatusTestIt 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 <[email protected]>--- bitbake/lib/bb/fetch2/wget.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)bitbake/lib/bb/fetch2/wget.py +0
-0@@ -216,7 +216,7 @@ class Wget(FetchMethod): # Apparently urllib then uses the filedescriptor, 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" incheck_status()),
+ # tried once more ("try_again" incheckstatus()),# with the dead connection removed from the cache. # If it still fails, we give up, which can happend for bad # HTTP proxy settings.bitbake/lib/bb/fetch2/wget.py +0
-0@@ -338,8 +338,7 @@ class Wget(FetchMethod): logger.debug(2, "checkstatus: trying again") return self.checkstatus(fetch, ud, d, False) else:
Quoted 8 lines
Quoted 4 lines
bitbake/lib/bb/fetch2/wget.py +0
-1- # debug for now to avoid spamming the logs in e.g.remote sstate searches
- logger.debug(2, "checkstatus()urlopen failed: %s"
% e)You added these comments in the past, is the "spamming" still an issue, please?
Or how can I reproduce it?
Set a remote (http) sstate mirror which doesn't exist and then try a core-image-sato-sdk with no local sstate?
Cheers,
Richard
Quoted 57 lines · Richard Purdie
Quoted 47 lines · Robert Yang
Hi Ross,
Quoted 44 lines · Robert Yang
This makes it easier to debug, for example, when I ran:
$ bitbake-selftest bb.tests.fetch.FetchCheckStatusTestIt 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 <[email protected]>--- bitbake/lib/bb/fetch2/wget.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)bitbake/lib/bb/fetch2/wget.py +0
-0@@ -216,7 +216,7 @@ class Wget(FetchMethod): # Apparently urllib then uses the filedescriptor, 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" incheck_status()),
+ # tried once more ("try_again" incheckstatus()),# with the dead connection removed from the cache. # If it still fails, we give up, which can happend for bad # HTTP proxy settings.bitbake/lib/bb/fetch2/wget.py +0
-0@@ -338,8 +338,7 @@ class Wget(FetchMethod): logger.debug(2, "checkstatus: trying again") return self.checkstatus(fetch, ud, d, False) else:Quoted 8 lines
Quoted 4 lines
bitbake/lib/bb/fetch2/wget.py +0
-1- # debug for now to avoid spamming the logs in e.g.remote sstate searches
- logger.debug(2, "checkstatus()urlopen failed: %s"
% e)You added these comments in the past, is the "spamming" still an issue, please?
Or how can I reproduce it?
Quoted 2 lines
Set a remote (http) sstate mirror which doesn't exist and then try a core-image-sato-sdk with no local sstate?
Thanks, yes, indeed, I got a lot of warnings with a invalid remote sstate mirror, so please ignore this patch.
// Robert
Quoted 6 lines
Cheers,
Richard