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

RpcFailure: 14-UNAVAILABLE failed to connect to all addresses, when executed behind corporate proxy server #556

Open
maheshrayas opened this issue Feb 1, 2022 · 3 comments

Comments

@maheshrayas
Copy link

Describe the bug
When I run my code behind the corporate proxy server below is the error I get
RpcFailure: 14-UNAVAILABLE failed to connect to all addresses.

Does the code automatically set the http proxy env variables ?

To Reproduce

  1. Connected to corporate VPN
  2. Set the ENV variables: http_proxy``https_proxy HTTP_PROXY HTTPS_PROXY, GOOGLE_APPLICATION_CREDENTIALS, GRPC_DEFAULT_SSL_ROOTS_FILE_PATH
  3. Fails to generate the Client

Expected behavior
Successfully generate the Client

System information

  • local work station: MacOSx
  • connecting to endpoint : container.googleapis.com
  • Code works fine when I am not connected to corporate vpn.
@BusyJay
Copy link
Member

BusyJay commented Feb 7, 2022

Can you paste the log after enabling debug logs? Following is an example of doing so:

env GRPC_VERBOSITY=debug https_proxy=http://127.0.0.1:1234  cargo run

@maheshrayas
Copy link
Author

maheshrayas commented Feb 8, 2022

HI @BusyJay, Thanks for replying.
Below are the logs after setting the verbosity to debug

D0208 16:20:47.794876000 4354020864 lb_policy_registry.cc:42]          registering LB policy factory for "grpclb"
D0208 16:20:47.794895000 4354020864 lb_policy_registry.cc:42]          registering LB policy factory for "priority_experimental"
D0208 16:20:47.794906000 4354020864 lb_policy_registry.cc:42]          registering LB policy factory for "weighted_target_experimental"
D0208 16:20:47.794917000 4354020864 lb_policy_registry.cc:42]          registering LB policy factory for "pick_first"
D0208 16:20:47.794923000 4354020864 lb_policy_registry.cc:42]          registering LB policy factory for "round_robin"
D0208 16:20:47.794931000 4354020864 dns_resolver_ares.cc:499]          Using ares dns resolver
D0208 16:20:47.795046000 4354020864 certificate_provider_registry.cc:33] registering certificate provider factory for "file_watcher"
D0208 16:20:47.795060000 4354020864 lb_policy_registry.cc:42]          registering LB policy factory for "cds_experimental"
D0208 16:20:47.795071000 4354020864 lb_policy_registry.cc:42]          registering LB policy factory for "xds_cluster_impl_experimental"
D0208 16:20:47.795083000 4354020864 lb_policy_registry.cc:42]          registering LB policy factory for "xds_cluster_resolver_experimental"
D0208 16:20:47.795092000 4354020864 lb_policy_registry.cc:42]          registering LB policy factory for "xds_cluster_manager_experimental"
I0208 16:20:47.797360000 4354020864 check_gcp_environment_no_op.cc:28] ALTS: Platforms other than Linux and Windows are not supported
I0208 16:20:47.799762000 123145487593472 http_connect_handshaker.cc:332] Connecting to server container.googleapis.com via HTTP proxy ipv4:127.0.0.1:3128
I0208 16:20:47.867741000 123145487593472 subchannel.cc:1012]           Connect failed: {"created":"@1644297647.867577000","description":"HTTP proxy returned response code 502","file":"/Users/rayasm1/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.9.1+1.38.0/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc","file_line":252}
I0208 16:20:47.867870000 123145487593472 subchannel.cc:957]            Subchannel 0x7f81917084e0: Retry in 930 milliseconds
RpcFailure: 14-UNAVAILABLE failed to connect to all addresses```

@BusyJay
Copy link
Member

BusyJay commented Feb 8, 2022

You can also enabling tracer tcp to find out more information and compare what's the difference after using a proxy.

An example would be:

env GRPC_VERBOSITY=debug GRPC_TRACE=tcp

Note the debug information may contains sensitive information and not be appropriate to paste here. From the informations given above, proxy should work as expected, though there may be some parameters not available for remote to process the requests or perhaps the remote just deny proxy.

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

No branches or pull requests

2 participants