Skip to content

[gRPC] DNS resolution failed for service #1871

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

Closed
chenaoxd opened this issue Jul 15, 2021 · 2 comments
Closed

[gRPC] DNS resolution failed for service #1871

chenaoxd opened this issue Jul 15, 2021 · 2 comments

Comments

@chenaoxd
Copy link

chenaoxd commented Jul 15, 2021

GRPC will report DNS resolution failed when with telepresence connected on macos.

The error message is listed below:

  File "/Users/foo/bar/venv/lib/python3.7/site-packages/etcd3/client.py", line 1186, in client
    grpc_options=grpc_options)
  File "/Users/foo/bar/venv/lib/python3.7/site-packages/etcd3/client.py", line 148, in __init__
    resp = self.auth_stub.Authenticate(auth_request, self.timeout)
  File "/Users/foo/bar/venv/lib/python3.7/site-packages/grpc/_channel.py", line 923, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/Users/foo/bar/venv/lib/python3.7/site-packages/grpc/_channel.py", line 826, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "DNS resolution failed for service: http://foo.somehost.com"
        debug_error_string = "{"created":"@1626334038.200779000","description":"Resolver transient failure","file":"src/core/ext/filters/client_channel/resolving_lb_policy.cc","file_line":220,"referenced_errors":[{"created":"@1626334038.200765000","description":"DNS resolution failed for service: http://foo.somehost.com","file":"src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc","file_line":378,"grpc_status":14,"referenced_errors":[{"created":"@1626334038.200675000","description":"C-ares status is not ARES_SUCCESS qtype=A name=http is_balancer=0: Domain name not found","file":"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc","file_line":287,"referenced_errors":[{"created":"@1626334038.199993000","description":"C-ares status is not ARES_SUCCESS qtype=AAAA name=http is_balancer=0: Domain name not found","file":"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc","file_line":287}]}]}]}"
@chenaoxd chenaoxd reopened this Jul 15, 2021
@chenaoxd
Copy link
Author

chenaoxd commented Jul 15, 2021

After a period of trying, I found it's related to the gRPC C-Ares issues. Adding the GRPC_DNS_RESOLVER=native environment variable will resolve my issue. And here's the related issue: grpc/grpc#19954.

Thanks and telepresence is a really good tool!

@astro-stan
Copy link

astro-stan commented Feb 23, 2023

I know this has been closed for a long time and I am using GRPC for something totally different but I had the same issue with the python GRPC client. It was working fine for weeks until one day it just stopped with the above error. The environment variable above made no difference.

After hours of fiddling with it I found the error. Turns out I was accidentally using a target URL with a specified scheme ("https://"). Apparently the python client must be called without one:
Example:

grpc.insecure_channel("mydomain.com:50051")

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