gana2188 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

gcloud auth login fails Mac OSX 10.10v5 with homebrewed python #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
installed gcloud sdk:
$ curl https://sdk.cloud.google.com | bash

(install python add-ons)

verified install and setup:
$which gcloud
/Users/santekotturi/google-cloud-sdk/bin/gcloud

checked for updates (just in case):
$ gcloud components update
All components are up to date.

then try to authenticate:
$ gcloud auth login
(also tried gcloud auth login --no-launch-browser ) 
error next: 

What is the expected output? What do you see instead?
EXPECTED: launch a web browser or provide me a url
RECEIVED: 
Traceback (most recent call last):
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 153, in <module>
    main()
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 149, in main
    _cli.Execute()
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 431, in Execute
    post_run_hooks=self.__post_run_hooks, kwargs=kwargs)
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py", line 274, in _Execute
    pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks)
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 882, in Run
    result = command_instance.Run(args)
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/calliope/exceptions.py", line 78, in TryFunc
    return func(*args, **kwargs)
  File "/Users/santekotturi/google-cloud-sdk/lib/googlecloudsdk/gcloud/sdktools/auth/login.py", line 54, in Run
    if c_gce.Metadata().connected:
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/core/credentials/gce.py", line 180, in Metadata
    _metadata_lock.unlock()
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/mutex.py", line 53, in unlock
    function(argument)
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/core/credentials/gce.py", line 178, in _CreateMetadata
    _metadata = _GCEMetadata()
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/core/credentials/gce.py", line 66, in __init__
    numeric_project_id = urllib2.urlopen(req, timeout=1).read()
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 442, in error
    result = self._call_chain(*args)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 629, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1214, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1187, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1067, in getresponse
    response.begin()
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 409, in begin
    version, status, reason = self._read_status()
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 373, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine: ''

What is the output of 'gcloud info'?
$gcloud info
Traceback (most recent call last):
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 153, in <module>
    main()
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 149, in main
    _cli.Execute()
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 431, in Execute
    post_run_hooks=self.__post_run_hooks, kwargs=kwargs)
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py", line 274, in _Execute
    pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks)
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 882, in Run
    result = command_instance.Run(args)
  File "/Users/santekotturi/google-cloud-sdk/lib/googlecloudsdk/gcloud/sdktools/root/info.py", line 29, in Run
    return InfoHolder()
  File "/Users/santekotturi/google-cloud-sdk/lib/googlecloudsdk/gcloud/sdktools/root/info.py", line 47, in __init__
    self.config = ConfigInfo()
  File "/Users/santekotturi/google-cloud-sdk/lib/googlecloudsdk/gcloud/sdktools/root/info.py", line 144, in __init__
    self.account = properties.VALUES.core.account.Get()
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/core/properties.py", line 384, in Get
    return _GetProperty(self, _PropertiesFile.Load(), required)
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/core/properties.py", line 609, in _GetProperty
    value = callback()
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/core/properties.py", line 277, in <lambda>
    'account', callbacks=[lambda: c_gce.Metadata().DefaultAccount()])
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/core/credentials/gce.py", line 180, in Metadata
    _metadata_lock.unlock()
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/mutex.py", line 53, in unlock
    function(argument)
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/core/credentials/gce.py", line 178, in _CreateMetadata
    _metadata = _GCEMetadata()
  File "/Users/santekotturi/google-cloud-sdk/./lib/googlecloudsdk/core/credentials/gce.py", line 66, in __init__
    numeric_project_id = urllib2.urlopen(req, timeout=1).read()
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 442, in error
    result = self._call_chain(*args)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 629, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1214, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1187, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1067, in getresponse
    response.begin()
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 409, in begin
    version, status, reason = self._read_status()
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 373, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine: ''

Please provide any additional information below.

homebrewed python
$which python
/usr/local/bin/python

 $python --version
Python 2.7.8

$gcloud --version
Google Cloud SDK 0.9.33

app-engine-python 1.9.12
app-engine-python-extras 1.9.6
bq 2.0.18
bq-nix 2.0.18
compute 2014.09.30
core 2014.09.30
core-nix 2014.09.30
dns 2014.09.02
gae-python 2014.05.06
gae-python-launcher-mac 1.9.12
gcutil 1.16.5
gcutil-nix 1.16.5
gsutil 4.6
gsutil-nix 4.6
sql 2014.09.30

pip requires virtualenv (in .bashrc):
# pip should only run if there is a virtualenv currently activated
export PIP_REQUIRE_VIRTUALENV=true

Googled the last line (httplib.BadStatusLine: '')
but didn't see anything too poignant given I'm running 2.7.8: 
https://docs.python.org/2/library/httplib.html

Thanks in advance

Original issue reported on code.google.com by sakott...@gmail.com on 15 Oct 2014 at 12:06

GoogleCodeExporter commented 9 years ago
I tested on another mac running 10.9.5 with homebrewed python 2.7.8 and had no 
problem. I believe that safely narrows it down to a OSX Yosemite issue.

Obviously beta software on a beta OS, I don't expect everything to run smoothly 
but Yosemite is slanted to be released soon and I'm not sure how many more 
updates there will be given they've entered Gold (from what I've read). 
Hopefully this feedback is useful. 

Original comment by sakott...@gmail.com on 15 Oct 2014 at 12:18

GoogleCodeExporter commented 9 years ago
Tested again on the same computer on another internet connection and it's 
working. I tried a number of times on the previous connection to no avail, 
doesn't make a lot of sense given that the second computer was on the previous 
connection and it worked without a hitch. 

Solved, although unclear as to why. 

SOLUTION = try a different internet connection 

Original comment by sakott...@gmail.com on 15 Oct 2014 at 1:26

GoogleCodeExporter commented 9 years ago

Original comment by rdayal@google.com on 10 Nov 2014 at 4:34