GoogleCloudPlatform / GoogleCloudPlatform/gsutil

Crash when running any gsutil command

Open
#1,613 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

calling `gsutil` (or anything really `gsutil ...`) results in the following, tried to remove the `~/.config/gcloud` folder with no success

```
Traceback (most recent call last):
File "/home/me/gcloud/lib/googlecloudsdk/core/feature_flags/config.py", line 55, in ReturnCachedOrCallFunc
return cached_results[args]
KeyError: ('MY@EMAIL.COM', 'MYPROJECTID')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/me/gcloud/bin/bootstrapping/gsutil.py", line 167, in
exceptions.HandleError(e, 'gsutil')
File "/home/me/gcloud/lib/googlecloudsdk/calliope/exceptions.py", line 547, in HandleError
core_exceptions.reraise(exc)
File "/home/me/gcloud/lib/googlecloudsdk/core/exceptions.py", line 146, in reraise
six.reraise(type(exc_value), exc_value, tb)
File "/home/me/gcloud/lib/third_party/six/__init__.py", line 693, in reraise
raise value
File "/home/me/gcloud/bin/bootstrapping/gsutil.py", line 165, in
main()
File "/home/me/gcloud/bin/bootstrapping/gsutil.py", line 146, in main
bootstrapping.ExecutePythonTool('platform/gsutil', 'gsutil', *args)
File "/home/me/gcloud/bin/bootstrapping/bootstrapping.py", line 126, in ExecutePythonTool
**extra_popen_kwargs)
File "/home/me/gcloud/bin/bootstrapping/bootstrapping.py", line 218, in _ExecuteTool
args + sys.argv[1:], env=_GetToolEnv(), **extra_popen_kwargs)
File "/home/me/gcloud/lib/googlecloudsdk/core/execution_utils.py", line 384, in Exec
**extra_popen_kwargs)
File "/home/me/gcloud/lib/googlecloudsdk/core/execution_utils.py", line 306, in _Exec
p = subprocess.Popen(args, env=_GetToolEnv(env=env), **extra_popen_kwargs)
File "/home/me/gcloud/lib/googlecloudsdk/core/execution_utils.py", line 159, in _GetToolEnv
env, p.EnvironmentName(), p.Get(required=False, validate=False))
File "/home/me/gcloud/lib/googlecloudsdk/core/properties.py", line 3360, in Get
property_value = self.GetPropertyValue(required, validate)
File "/home/me/gcloud/lib/googlecloudsdk/core/properties.py", line 3381, in GetPropertyValue
required)
File "/home/me/gcloud/lib/googlecloudsdk/core/properties.py", line 3701, in _GetProperty
property_value = _GetPropertyWithoutDefault(prop, properties_file)
File "/home/me/gcloud/lib/googlecloudsdk/core/properties.py", line 3765, in _GetPropertyWithoutDefault
GetValueFromFeatureFlag(prop),
File "/home/me/gcloud/lib/googlecloudsdk/core/properties.py", line 3727, in GetValueFromFeatureFlag
VALUES.core.account.Get(), VALUES.core.project.Get())
File "/home/me/gcloud/lib/googlecloudsdk/core/feature_flags/config.py", line 57, in ReturnCachedOrCallFunc
result = func(*args)
File "/home/me/gcloud/lib/googlecloudsdk/core/feature_flags/config.py", line 113, in GetFeatureFlagsConfig
yaml_data = FetchFeatureFlagsConfig()
File "/home/me/gcloud/lib/googlecloudsdk/core/feature_flags/config.py", line 83, in FetchFeatureFlagsConfig
response = yaml_request.get(_FEATURE_FLAG_YAML_URL)
File "/home/me/gcloud/lib/third_party/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/home/me/gcloud/lib/googlecloudsdk/core/transport.py", line 251, in WrappedRequest
response = orig_request(*modified_args, **modified_kwargs)
File "/home/me/gcloud/lib/googlecloudsdk/core/requests.py", line 216, in WrappedRequest
return orig_request_method(*args, **kwargs)
File "/home/me/gcloud/lib/third_party/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/me/gcloud/lib/third_party/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/me/gcloud/lib/third_party/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/me/gcloud/lib/third_party/urllib3/connectionpool.py", line 677, in urlopen
chunked=chunked,
File "/home/me/gcloud/lib/third_party/urllib3/connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.6/http/client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1046, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 1006, in send
self.sock.sendall(data)
File "/home/me/gcloud/lib/third_party/urllib3/contrib/pyopenssl.py", line 352, in sendall
data[total_sent : total_sent + SSL_WRITE_BLOCKSIZE]
File "/home/me/gcloud/lib/third_party/urllib3/contrib/pyopenssl.py", line 340, in _send_until_done
return self.connection.send(data)
File "/home/me/.local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1644, in send
with _from_buffer(buf) as data:
AttributeError: __enter__

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the crash with a gsutil command, then trace the reported path from bin/bootstrapping/gsutil.py through core/feature_flags/config.py and core/requests.py to third_party/urllib3/contrib/pyopenssl.py. Compare the failing OpenSSL call and verify that gsutil commands complete without this traceback.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.