Skip to content
New issue

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

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

Already on GitHub? # to your account

DNS Error when resolving subgraph Url on subgraph introspect (error[E028]) #1580

Open
platzhersh opened this issue Apr 19, 2023 · 6 comments
Labels
bug 🐞 triage issues and PRs that need to be triaged

Comments

@platzhersh
Copy link

platzhersh commented Apr 19, 2023

Description

I wanted to make an instrospection on one of our subgraphs.

rover subgraph introspect https://k8s-dev.cistec.com/com/patient/graphql --header "Authorization: Bearer <token>"

but instead I am getting

error[E028]: error sending request for url (https://k8s-dev.cistec.com/com/patient/graphql): error trying to connect: dns error: no record found for Query { name: Name("k8s-dev.cistec.com.home."), query_type: AAAA, query_class: IN }
        Make sure the endpoint is accepting connections and is spelled correctly

Something seems to not work with the host resolution. The hostname is resolvable in our company network. A curl / ping to it works perfectly fine.

Thought maybe its SSL related, found #837, but the new insecure options didn't help.

Also I executed the exact same command just about 10 minutes earlier, before upgrading rover cli and it worked. (Previous version was v0.8.1)

Steps to reproduce

Clear steps describing how to reproduce the issue. Please link to a reproduction if you can. This makes your issue much easier to diagnose.

Expected result

Expected introspection response with schema.

Actual result

error sending request for url (https://k8s-dev.cistec.com/com/patient/graphql): error trying to connect: dns error: no record found for Query { name: Name("k8s-dev.cistec.com.home."), query_type: AAAA, query_class: IN }
        Make sure the endpoint is accepting connections and is spelled correctly

Environment

Run rover info and paste the results here

Rover Info:
Version: 0.13.0
Install Location: /Users/cglat/.rover/bin/rover
OS: Mac OS 13.2.1 [64-bit]
Shell: /bin/zsh
cglat@cglat-mac s

@platzhersh platzhersh added bug 🐞 triage issues and PRs that need to be triaged labels Apr 19, 2023
@platzhersh platzhersh changed the title DNS Error when resolving subgraph Url DNS Error when resolving subgraph Url on subgraph introspect Apr 19, 2023
@platzhersh
Copy link
Author

For now, I'm just using curl and jq, which does the job. But would be nice to have the rover CLI to work too.

curl --location 'https://k8s-dev.cistec.com/com/patient/graphql' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{"query":"\nquery SDL {\n  _service {\n    sdl\n  }\n}","variables":{},"operationName":"SDL"}'\
| jq -r '.data._service.sdl' > subgraph.graphql

@platzhersh platzhersh changed the title DNS Error when resolving subgraph Url on subgraph introspect DNS Error when resolving subgraph Url on subgraph introspect (error[E028]) Apr 19, 2023
@platzhersh
Copy link
Author

platzhersh commented Apr 19, 2023

rover explain E028 prints this: (didn't help much)

E028

This error occurs when Rover could not connect to an HTTP endpoint.

If you encountered this error while running introspection, you'll want to make sure that you typed the endpoint correctly, your Internet connection is stable, and that your server is responding to requests. You may wish to run the command again with --log=debug.

@m4r0z
Copy link

m4r0z commented Nov 21, 2023

Hey mate, any fix for this?

@platzhersh
Copy link
Author

I know there was something about header option not being supported for certain rover cli commands, but that was for rover dev if i'm not mistaken. So no, no solution yet afaik, we are still just using curl.

@abernix
Copy link
Member

abernix commented Apr 30, 2024

Just as a note to point out from the original issue, it appears two things are true:

  • There is a seemingly errant .home suffix on the error message which would seem to suggest that a .home TLD is being attempted during the DNS lookup: Is there a search domain setup in the /etc/resolv.conf (or similar) that could be causing this?
  • Rover is attempting a IPv6 lookup here (based on the AAAA query). Is that expected given your network? What happens if you pass the -6 flag to your curl command (which has curl use IPv6)?
Query { name: Name("k8s-dev.cistec.com.home."), query_type: AAAA, query_class: IN }

@furai
Copy link

furai commented Jul 17, 2024

Seems I'm affected by this and can reproduce it without issues. It's something about DNS resolution. One of our domains has CNAME which resolves to 3 different IPv4 addresses, to access it I connect through OpenVPN. My host machine supports IPv6. I have valid IPv6 assigned to the machine I'm using but I guess our VPN does not have IPv6.

When running rover with --log=debug I get messages about it trying to resolve AAAA address even though there's no valid AAAA assigned to that domain. So I guess it somehow checks that system capabilities allow for IPv6 connection but then when connecting to some other network that won't support IPv6 it still tries to do it nonetheless instead of just using available IPv4 addresses.

Curiously enough it won't happen when I use npx. When using npm run script it breaks. No idea what's the deal here.

I'm using version 0.24.0.

EDIT: OK, it's working properly in version 0.24.0. When running npx I was using newer version than running through npm run script. Didn't notice it at first. I guess that some dependency update to some cargo packages fixed this issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug 🐞 triage issues and PRs that need to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants