From 94bafe03c84eb364fff90e5a33586770b744adfa Mon Sep 17 00:00:00 2001 From: Takuto Ikuta Date: Fri, 6 Mar 2020 16:37:24 +0000 Subject: [PATCH] add instruction for download failure due to 401 context: http://shortn/_nIAnsMynAk Change-Id: I578779b3a235bf32094cf0769e69dfae73727be1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2091174 Auto-Submit: Takuto Ikuta Commit-Queue: Edward Lesmes Reviewed-by: Edward Lesmes --- download_from_google_storage.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/download_from_google_storage.py b/download_from_google_storage.py index d426b5517..1154fa398 100755 --- a/download_from_google_storage.py +++ b/download_from_google_storage.py @@ -267,6 +267,14 @@ def _downloader_worker_thread(thread_num, q, force, base_url, thread_num, file_url, output_filename)) ret_codes.put((1, 'File %s for %s does not exist.' % ( file_url, output_filename))) + elif code == 401: + out_q.put( + """%d> Failed to fetch file %s for %s due to unauthorized access, + skipping. Try running `gsutil.py config` and pass 0 if you don't + know your project id.""" % (thread_num, file_url, output_filename)) + ret_codes.put( + (1, 'Failed to fetch file %s for %s due to unauthorized access.' % + (file_url, output_filename))) else: # Other error, probably auth related (bad ~/.boto, etc). out_q.put('%d> Failed to fetch file %s for %s, skipping. [Err: %s]' %