From c68aba6db30fc7e47b7364165d5ee4f7887a4861 Mon Sep 17 00:00:00 2001 From: Jeffrey Farrar Painter Date: Fri, 22 May 2020 12:21:45 -0700 Subject: [PATCH 1/2] Log each call of sdget.sh (or sdgetg.sh etc.) so that file transfer failures can be debugged. --- sdt/bin/sdget.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdt/bin/sdget.py b/sdt/bin/sdget.py index 757ea111..38927f59 100755 --- a/sdt/bin/sdget.py +++ b/sdt/bin/sdget.py @@ -30,6 +30,7 @@ import sdconst import sdget_urllib from sdtools import print_stderr +import sdlog def download(url,full_local_path,debug=False,http_client=sdconfig.http_client,timeout=sdconst.ASYNC_DOWNLOAD_HTTP_TIMEOUT,verbosity=0,buffered=True,hpss=False): killed=False @@ -201,6 +202,7 @@ def prepare_args(url,full_local_path,script,debug,timeout,verbosity,hpss): li.insert(1,'-p') li.insert(2,'0') + sdlog.debug('SDGET000-010',"sdget command %s"%li) return li # init. From 99a67cf59b928e45128e426139bfcee7212bc2df Mon Sep 17 00:00:00 2001 From: Jeffrey Farrar Painter Date: Fri, 22 May 2020 13:45:54 -0700 Subject: [PATCH 2/2] Print out the wget command so that it will be available if the transfer has to be debugged. If wget was unsuccesful, log its error message. --- sdt/bin/sdget.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdt/bin/sdget.sh b/sdt/bin/sdget.sh index a5c4aae2..517d7b6e 100755 --- a/sdt/bin/sdget.sh +++ b/sdt/bin/sdget.sh @@ -354,6 +354,7 @@ else $NO_CHECK_SERVER_CERTIFICATE \ $url" fi +echo WGET_CMD $WGET_CMD wget_stderr2stdout () { @@ -455,6 +456,8 @@ fi if [ $parse_output -eq 1 ]; then source "$wgetoutputparser" # we parse wget output to keep only HTTP response code from wget messages +elif [ $wget_status -ne 0 ]; then + log "DEB015" "$wget_errmsg" fi