keybase / keybase-issues

A single repo for managing publicly recognized issues with the keybase client, installer, and website.
902 stars 37 forks source link

Not able to disable proxy #2191

Open klauern opened 8 years ago

klauern commented 8 years ago

I looked at the options in the keybase help advanced command, but I can't find a way to disable my proxy settings. I've put in --proxy="" in hopes that it would unset it, as well as unsetting my $http/s_proxy environment variable, but no matter what, I still get an error with it trying to go through the proxy:

C:\Users\Me > keybase --proxy="" login
- WARNING Failed to register as a logger: The handle is invalid.
- ERROR Access is denied.
C:\Users\Me > keybase login
Your keybase username or email address: klauern
- ERROR API network error: Get https://keybase.io/_/api/1.0/user/lookup.json?fields=basics%2Cpublic_keys%2Cpictures&multi=1&username=klauern: http: error connecting to proxy http://myproxy.somewhere.com:80: dial tcp: lookup myproxy.somewhere.com: getaddrinfow: No such host is known. (error 1601)
zanderz commented 8 years ago

Those look like Windows prompts, have you checked environment variables HTTP_PROXY, HTTPS_PROXY or NO_PROXY? set h
set n

klauern commented 8 years ago

I do have these set, but I've unset them explicitly (I frequently have to do this, so I've even created an alias):

# in Powershell:
function noproxy
{
    $env:HTTPS_PROXY=""
    $env:HTTP_PROXY=""
}
zanderz commented 8 years ago

One more thing to try: environment variables set in the local console may not be seen by the running keybase service until it is restarted. Try: keybase ctl restart

klauern commented 8 years ago

hm, not much different, but possibly weird:

C:\Users\Me> noproxy
C:\Users\Me> keybase ctl restart
C:\Users\Me> keybase login
- WARNING Failed to register as a logger: The handle is invalid.
- ERROR The handle is invalid.
C:\Users\Me> keybase logout
- ERROR API network error: Post https://keybase.io/_/api/1.0/logout.json: http: error connecting to proxy http://myproxy.somewhere.com:80: dial tcp: lookup myproxy.somewhere.com: getaddrinfow: No such host is known. (error 1601)
C:\Users\Me> keybase login
- WARNING Failed to register as a logger: The handle is invalid.
- ERROR Access is denied.
C:\Users\Me> $env:http_proxy
C:\Users\Me> $env:HTTP_PROXY
C:\Users\Me> $env:HTTPS_PROXY
C:\Users\Me> $env:NO_PROXY
C:\Users\Me>
klauern commented 8 years ago

In using keybase -d login, it looks like it's still referencing my proxy:

...
2016-04-08T17:46:39.194405 - [DEBU keybase globals.go:266] 042 Calling shutdown first time through
2016-04-08T17:46:39.194405 - [DEBU keybase login_state.go:953] 043 + Account "LoginState - Shutdown"
2016-04-08T17:46:39.210005 - [DEBU keybase login_state.go:955] 044 - Account "LoginState - Shutdown"
2016-04-08T17:46:39.210005 - [DEBU keybase globals.go:312] 045 exiting shutdown code=0; err=<nil>
2016-04-08T17:46:39.225605 - [ERRO keybase standard.go:197] 046 API network error: Get https://keybase.io/_/api/1.0/merkle/path.json?poll=10&uid=35b7fda663be78addfb98608e5096f19: http: error connecting to proxy http://myproxy.somewhere.com:80: dial tcp: lookup myproxy.somewhere.com: getaddrinfow: No such host is known. (error 1601)
zanderz commented 8 years ago

hmm, would it work to set NO_PROXY to something non-empty? And then to keybase ctl restart of course.
Even if this works, it is troubling where the proxy info is coming from.

klauern commented 8 years ago

I tried to do that, too, but no change. I'm not sure where it's pulling the proxy info from, unless it's something more deeply nested, a la Google Chrome leveraging my IE settings.

zanderz commented 8 years ago

One more way to make sure environment settings are not different from the daemon is to try running without it: keybase ctl stop
keybase -standalone login
(maybe add debug to that login command)

One other place proxy may be set is in the config file. Check %appdata%\Keybase\config.json

klauern commented 8 years ago

That last one worked! I'll try to do some more debugging to see if there's something special about that.

klauern commented 8 years ago

That is, I did keybase ctl stop, then keybase -standalone login. I'll look at the config.json next.

zanderz commented 8 years ago

That would seem to suggest that the keybase service is running with a different environment after all. Maybe try looking with task manager to make sure there are no running keybase.exe instances after you issue keybase ctl stop

majkinetor commented 6 years ago

It works with standalone option and local proxy settings, however, GUI app doesn't see it and cant use it, and in CLI options are not available (such as chat).

I made sure on Windows the env vars are set for the service:

> keybase login majkinetor
 WARNING (CONN keybase service dc2ceee0) Connection: error dialing transport: dial tcp: lookup gregord.kbfs.keybase.io: context deadline exceeded

Via process explorer:

Command:

C:\Users\mmilic\AppData\Local\Keybase\keybase.exe --debug --log-file C:\Users\mmilic\AppData\Local\Keybase\keybase.service.log service --chdir C:\Users\mmilic\AppData\Local\Keybase --auto-forked

Environment is correct as I added proxy vars in machine env. vars:

untitled

The same proxy settings works locally with --standalone params

I then tried to run keybase service with proxy param:

keybase --proxy http://10.... ctl start

I started GUI manually and it showed users with REKEY button on each of them.

majkinetor commented 6 years ago

Above actually about way to enable proxy, not disable it...