我的所有gsutil命令都超时 [英] All of my gsutil commands timeout

本文介绍了我的所有gsutil命令都超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的Mac上成功安装了最新的Google-Cloud-SDK,所以我的所有gCloud和gsutil命令行工具都是最新的。

但是,每当我尝试gsutil命令时,它都会超时。例如,当我运行:

gsutil mb gs://cloud-storage-analysis

开始运行,打印:

Creating gs://cloud-storage-analysis/...

但之后它永远不会停止。我使用Control-C停止它,它会打印出这个。

Caught signal 2 - exiting
Traceback (most recent call last):
  File "/Users/jazz/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 71, in <module>
    main()
  File "/Users/jazz/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 54, in main
    'platform/gsutil', 'gsutil', *args)
  File "/Users/jazz/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 45, in ExecutePythonTool
    execution_utils.ArgsForPythonTool(_FullPath(tool_dir, exec_name), *args))
  File "/Users/jazz/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 86, in _ExecuteTool
    execution_utils.Exec(args + sys.argv[1:], env=_GetToolEnv())
  File "/Users/jazz/google-cloud-sdk/bin/bootstrapping/../../lib/googlecloudsdk/core/util/execution_utils.py", line 146, in Exec
    ret_val = p.wait()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1357, in wait
    pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 478, in _eintr_retry_call
    return func(*args)
KeyboardInterrupt
有一次我让它运行了很长时间,它实际上超时并停止了。我尝试的每个gsutil命令都会发生这种情况。 我的bq命令有效(但它们非常慢)。

我不知道出了什么问题。

谢谢您的帮助。

编辑:

所以我的问题并没有完全消失,但gsutil有时确实有效。它是非常断断续续的,在它工作和不工作的时候看起来是随机的。看起来刷新外壳和/或退出并重新打开终端很有帮助,但不是每次都是。我还是想查个水落石出。

因此,按照Misha的建议,我运行了gsutil -D ls作为测试。 它到了这里,然后停止了一段时间(可能2-3分钟):(一些信息已被[删除])

gsutil version: 4.13
checksum: [key] (OK)
boto version: 2.38.0
python version: 2.7.5 (default, Mar  9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
OS: Darwin 13.4.0
multiprocessing available: True
using cloud sdk: True
config path: [path-to-home/.boto
gsutil path: [path-to-home]/google-cloud-sdk/platform/gsutil/gsutil
compiled crcmod: True
installed via package manager: False
editable install: False
Command being run: [path-to-home]/google-cloud-sdk/platform/gsutil/gsutil -o GSUtil:default_project_id=storagelogstest -D ls
config_file_list: ['[path-to-home]/.config/gcloud/legacy_credentials/[email]@gmail.com/.boto', '/.boto']
config: [('debug', '0'), ('working_dir', '/mnt/pyami'), ('https_validate_certificates', 'True'), ('debug', '0'), ('working_dir', '/mnt/pyami'), ('content_language', 'en'), ('default_api_version', '2'), ('default_project_id', 'storagelogstest')]
DEBUG 0626 10:43:29.972406 oauth2_client.py] GetAccessToken: checking cache for key 9886bbc6e7e67cf6d2b8b3a707046f2a326dcceb
DEBUG 0626 10:43:29.972712 oauth2_client.py] FileSystemTokenCache.GetToken: key=9886bbc6e7e67cf6d2b8b3a707046f2a326dcceb not present (cache_file=/var/folders/25/zs7lm5jd7dg5jljd4qdxjpnc0000gq/T/oauth2_client-tokencache.503.9886bbc6e7e67cf6d2b8b3a707046f2a326dcceb)
DEBUG 0626 10:43:29.972882 oauth2_client.py] GetAccessToken: token from cache: None
DEBUG 0626 10:43:29.973030 oauth2_client.py] GetAccessToken: fetching fresh access token...
INFO 0626 10:43:29.973551 client.py] Refreshing access_token

然后,它输出以下内容:

connect fail: (accounts.google.com, 443)
connect: (accounts.google.com, 443)
send: 'POST /o/oauth2/token HTTP/1.1
Host: accounts.google.com
Content-Length: 195
content-type: application/x-www-form-urlencoded
accept-encoding: gzip, deflate
user-agent: Python-httplib2/0.7.7 (gzip)

client_secret=ZmssLNjJy2998hD4CTg2ejr2&grant_type=refresh_token&refresh_token=1%2FUl4EXn6N5jPCjFVy6-U5HwIKNApkGmYEEQPZO654NxHBactUREZofsF9C7PrpE-j&client_id=32555940559.apps.googleusercontent.com'
reply: 'HTTP/1.1 200 OK
'
header: Content-Type: application/json; charset=utf-8
header: Cache-Control: no-cache, no-store, max-age=0, must-revalidate
header: Pragma: no-cache
header: Expires: Fri, 01 Jan 1990 00:00:00 GMT
header: Date: Fri, 26 Jun 2015 17:44:45 GMT
header: Content-Disposition: attachment; filename="json.txt"; filename*=UTF-8''json.txt
header: Content-Encoding: gzip
header: P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
header: X-Content-Type-Options: nosniff
header: X-Frame-Options: SAMEORIGIN
header: X-XSS-Protection: 1; mode=block
header: Server: GSE
header: Set-Cookie: NID=68=PfDga1cpnMr8ho-0tlBrWNhgLzQsThRzV31vn8QD1cV45H8C4-ydGoMI0ITI0lPJHvKhN_uPSisTQwIzM2LEFKqjXZlgsJ-9l0HiflLdl1UGMevAQ2GFxFqa369vQxZG;Domain=.google.com;Path=/;Expires=Sat, 26-Dec-2015 17:44:45 GMT;HttpOnly
header: Alternate-Protocol: 443:quic,p=1
header: Transfer-Encoding: chunked
DEBUG 0626 10:44:45.808030 oauth2_client.py] GetAccessToken: fresh access token: AccessToken(token=ya29.ngEY7SR5AbdDZ2pWMtBJzAnJGYGUgXB6hKcAwE8I274ieyLmEpuD1WypFJ8jAZN9LS5zCZ3ldGL4MA, expiry=2015-06-26 18:44:45.806928Z)
DEBUG 0626 10:44:45.808321 oauth2_client.py] FileSystemTokenCache.PutToken: key=9886bbc6e7e67cf6d2b8b3a707046f2a326dcceb, cache_file=/var/folders/25/zs7lm5jd7dg5jljd4qdxjpnc0000gq/T/oauth2_client-tokencache.503.9886bbc6e7e67cf6d2b8b3a707046f2a326dcceb
INFO 0626 10:44:45.813867 base_api.py] Calling method storage.buckets.list with StorageBucketsListRequest: <StorageBucketsListRequest
 maxResults: 1000
 project: 'storagelogstest'
 projection: ProjectionValueValuesEnum(full, 0)>
INFO 0626 10:44:45.814872 base_api.py] Making http GET to https://www.googleapis.com/storage/v1/b?project=storagelogstest&fields=nextPageToken%2Citems%2Fid&alt=json&projection=full&maxResults=1000
INFO 0626 10:44:45.815298 base_api.py] Headers: {'accept': 'application/json',
 'accept-encoding': 'gzip, deflate',
 'content-length': '0',
 'user-agent': 'apitools gsutil/4.13 (darwin) Cloud SDK Command Line Tool 0.9.66'}
INFO 0626 10:44:45.815390 base_api.py] Body: (none)
DEBUG 0626 10:45:45.846443 http_wrapper.py] Caught socket error, retrying: timed out

它曾多次尝试重新连接,但每次都超时,然后我停止了它。

我没有在另一台计算机上尝试过此功能,但我与一位有相同问题的同事交谈过(它经常不起作用,但有时确实起作用)。

推荐答案

所以,如果您有这个问题,如果您基本上只是多次尝试,很可能能够让Gsutil工作。尝试重新启动外壳程序(exec -l $SHELL),然后退出/重新打开命令行并继续尝试,最终对我起作用了。这不是一个永久性的解决办法,对我来说,它仍然会超时大约三分之二的时间。但您至少可以运行您的命令。

希望谷歌能解决这个问题

这篇关于我的所有gsutil命令都超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆