Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcloud auth login windows proxy failure #576

Open
GoogleCodeExporter opened this issue Mar 14, 2016 · 8 comments
Open

gcloud auth login windows proxy failure #576

GoogleCodeExporter opened this issue Mar 14, 2016 · 8 comments

Comments

@GoogleCodeExporter
Copy link
Contributor

Issue running command [gcloud auth login].


What steps will reproduce the problem?

Any attemt to run login on Windows 7 behind an HTTP/S Proxy.


What is the expected output? What do you see instead?

After confirming the Google Auth prompt on the website, gcloud auth login 
crashes with a proxy error, HTTP status 407.


Please provide any additional information below.

HTTP_PROXY / HTTPS_PROXY is set in Windows env and confirmed working with other 
Python scripts / windows tools.


Traceback (most recent call last):
  File "lib\googlecloudsdk\gcloud_main.py", line 169, in main
    gcloud_cli.Execute()
  [...]
  File "lib\googlecloudsdk\core\credentials\flow.py", line 170, in Run
    credential = flow.step2_exchange(code, http=http)
  File "bin\..\lib\third_party\oauth2client\util.py", line 137, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "bin\..\lib\third_party\oauth2client\client.py", line 1993, in step2_exchange
    headers=headers)
  File "bin\..\lib\third_party\httplib2\__init__.py", line 1610, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "bin\..\lib\third_party\httplib2\__init__.py", line 1352, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "bin\..\lib\third_party\httplib2\__init__.py", line 1272, in _conn_request
    conn.connect()
  File "bin\..\lib\third_party\httplib2\__init__.py", line 1033, in connect
    sock.connect((self.host, self.port))
  File "bin\..\lib\third_party\socks\__init__.py", line 442, in connect
    self.__negotiatehttp(destpair[0], destpair[1])
  File "bin\..\lib\third_party\socks\__init__.py", line 406, in __negotiatehttp
    raise HTTPError((statuscode, statusline[2]))
HTTPError: (407, 'Proxy Authentication Required')

[output truncated]

Original issue reported on code.google.com by johannes...@gmail.com on 23 Feb 2016 at 12:48

@GoogleCodeExporter
Copy link
Contributor Author

gcloud -v

Google Cloud SDK 97.0.0

bq 2.0.18
bq-win 2.0.18
core 2016.02.11
core-win 2016.02.05
gcloud
gsutil 4.16
gsutil-win 4.16
windows-ssh-tools 2016.01.29

Original comment by johannes...@gmail.com on 23 Feb 2016 at 12:49

@GoogleCodeExporter
Copy link
Contributor Author

Can you try setting the appropriate gcloud-specific proxy settings?

    $ gcloud config set proxy/address
    $ gcloud config set proxy/port
    $ gcloud config set proxy/type
    $ gcloud config set proxy/username
    $ gcloud config set proxy/password

Supported proxy types are: [http, http_no_tunnel, socks4, socks5].

We attempt to detect the HTTP_PROXY/HTTPS_PROXY settings automatically, but 
configure proxy settings internally for better cross-platform support and more 
flexibility.

We'll look into why HTTP_PROXY/HTTPS_PROXY isn't working in this scenario.

Original comment by z...@google.com on 23 Feb 2016 at 1:00

  • Changed state: NeedsMoreInfo

@GoogleCodeExporter
Copy link
Contributor Author

[deleted comment]

@GoogleCodeExporter
Copy link
Contributor Author

I manually created a keyfile and added a service-account. That works, but when 
trying to deploy I run into the same proxy 407, so it doesn't help.


I configured the proxy with the commands you provided and known to be working 
credentials, but I get the same error.


Current Properties:
  [core]
    project: [...]
    account: [...@appspot.gserviceaccount.com]
    disable_usage_reporting: [True]
  [app]
    suppress_change_warning: [true]
  [proxy]
    username: [...]
    password: [...]
    type: [http]
    port: [80]
    address: [...]

Original comment by johannes...@gmail.com on 23 Feb 2016 at 1:16

@GoogleCodeExporter
Copy link
Contributor Author

[deleted comment]

@GoogleCodeExporter
Copy link
Contributor Author

You mentioned "trying to deploy" gives the same proxy 407 error. What is the 
exact command you are running?

Original comment by svalen...@google.com on 23 Feb 2016 at 4:35

@GoogleCodeExporter
Copy link
Contributor Author

Sorry for not making that clearer. I'm essentially trying to follow the hello 
world tutorial (https://cloud.google.com/python/getting-started/hello-world). 
That tutorial has a later step "gcloud preview app deploy", which also fails 
with 407. But that's besides the point.

The original issue still persists - when I run 'gcloud auth login'  (or 'gcloud 
init') on a clean installation of Windows in an HTTP Proxy network environment, 
my browser opens to let me authenticate (HTTP proxy works fine in the browser), 
I get redirected to localhost:8xxx with the key and then gcloud crashes with 
the above message and a 407 status.

I tried the same procedure again outside of the proxy network and it works fine 
there, but no dice on my HTTP-proxied company LAN.

Extra logs:

--

Windows env has HTTP_PROXY set

C:\>env | grep http
HTTPS_PROXY=https://<user>:<password>@<server>:80/
HTTP_PROXY=https://<user>:<password>@<server>:80/

--

Python urllib2 automatically uses the proxy and can contact outside servers

C:\>echo import urllib2 >> prox.py
C:\>echo response = urllib2.urlopen('http://echo.jsontest.com/test') >> prox.py
C:\>echo print response.read() >> prox.py
C:\>python prox.py
{"test": ""}

Original comment by johannes...@gmail.com on 24 Feb 2016 at 9:07

@mughal61
Copy link

mughal61 commented Feb 5, 2019

how you got to resolve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants