cloudfoundry-attic / cfdev

A fast and easy local Cloud Foundry experience on native hypervisors, powered by LinuxKit with VPNKit
Apache License 2.0
227 stars 64 forks source link

CF DEV START: Request error: Get https://api.dev.cfdev.sh/v2/info: dial tcp: lookup api.dev.cfdev.sh: no such host #123

Closed thlcodes closed 4 years ago

thlcodes commented 4 years ago

Hi, on macOS 10.14.6 (MBP & MacMini) cf dev start fails with latest plugin version:

➜  ~ cf dev start
Downloading Network Helper...
Progress: |====================>| 100.0%
Installing cfdevd network helper (requires administrator privileges)...
Setting up IP aliases for the BOSH Director & CF Router (requires administrator privileges)
Downloading Resources...
Progress: |====================>| 100.0%
Setting State...
Creating the VM...
Starting VPNKit...
Waiting for the VM...
Deploying the BOSH Director...
Deploying CF...
  Progress: 14 of 15 (9m52s)FAILED
cf dev start: Failed to deploy services: Failed to deploy CF: exit status 1

~/.cfdev/logs/deploy-cf.log says:

[...]
Task 71 | 09:59:49 | Updating instance log-api: log-api/daf42aa0-c17f-43b9-ad15-0908e51d7c47 (0) (00:01:26)
Task 71 | 10:00:03 | Updating instance diego-api: diego-api/d4c2ea6c-abed-4587-b581-86f0992813e8 (0) (00:01:40)
Task 71 | 10:00:17 | Updating instance singleton-blobstore: singleton-blobstore/d336d586-702b-4b98-a061-02649727a60d (0) (00:01:54)
Task 71 | 10:01:08 | Updating instance cc-worker: cc-worker/cd42bc29-13e4-47f7-99b8-89d2de23732e (0) (00:02:45)
Task 71 | 10:02:23 | Updating instance scheduler: scheduler/a394ccdb-6de5-42e6-ac01-2d863324ddc1 (0) (00:04:00)
Task 71 | 10:05:59 | Updating instance uaa: uaa/79b0e5dc-8507-4c1d-b01d-61f02c77dc00 (0) (00:07:36)
Task 71 | 10:06:15 | Updating instance doppler: doppler/dcacbb7f-c807-4509-9bfc-e4e02d87930d (0) (00:07:52)
Task 71 | 10:06:20 | Updating instance diego-cell: diego-cell/b4ce80fe-912d-4f6b-b4ab-d2fbbb04a065 (0) (00:07:57)
Task 71 | 10:06:47 | Updating instance router: router/19430c8a-bbdb-4a43-bb51-1a5a33c4a7e8 (0) (00:08:24)
Task 71 | 10:06:54 | Updating instance api: api/170b351f-9c5a-4d0d-a4d1-fb849e30aa2d (0) (00:08:31)
Task 71 | 10:07:15 | Updating instance credhub: credhub/3181d69a-3310-4e1d-9289-ecfa55a535c7 (0) (00:08:52)

Task 71 Started  Wed Jan 29 09:52:38 UTC 2020
Task 71 Finished Wed Jan 29 10:07:15 UTC 2020
Task 71 Duration 00:14:37
Task 71 done

Succeeded
Setting api endpoint to api.dev.cfdev.sh...
Request error: Get https://api.dev.cfdev.sh/v2/info: dial tcp: lookup api.dev.cfdev.sh: no such host
TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection.
FAILED

There is no HTTP proxy required and firewall is deactivated.

Any idea?

cf-gitbot commented 4 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/170970330

The labels on this github issue will be updated when the story is started.

aemengo commented 4 years ago

Looks like a DNS issue: we’re seeing no such host. The domain api.dev.cfdev.sh can’t be resolved. Is your MacBook connected to the internet to make the resolution?

What does dig api.dev.cfdev.sh yield?

thlcodes commented 4 years ago

Yep, all devices are connected to the internet. Even my phone (on mobile data) cannot resolve the address.

$ dig api.dev.cfdev.sh

; <<>> DiG 9.10.6 <<>> api.dev.cfdev.sh
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46131
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;api.dev.cfdev.sh.              IN      A

;; Query time: 80 msec
;; SERVER: 192.168.52.1#53(192.168.52.1)
;; WHEN: Wed Jan 29 12:04:13 CET 2020
;; MSG SIZE  rcvd: 45

But, isn't CF DEV supposed to host the API? Via HTTPS with self-signed certificates? To me it looks more like the api cannot be served or the name resolving does not work.

aemengo commented 4 years ago

Thanks for the response. It definitely appears like address cannot be resolved on your machine. I'm afraid that getting that to resolve is outside scope of this repository. Maybe a quick fix might be to temporarily change your DNS address to 8.8.8.8 and then see if the dig command works.

isn't CF DEV supposed to host the API?

Yes, it is supposed to host the API. Nothing that you've posted so far indicates that the api didn't come up successfully on your machine, only you cannot reach it via the domain name: api.dev.cfdev.sh. This is a publicly registered domain name, so you'll need internet access to resolve it. You should have the following answer (10.144.0.34):

;; ANSWER SECTION:
api.dev.cfdev.sh.   60  IN  A   10.144.0.34
kubiani commented 4 years ago

Was experiencing the same issue. Tracked it down to rebinding protection on my pfSense box as the culprit. If you're using any custom router solution (ddwrt, openwrt, tomato, etc) it's probably the same deal. You'll need to disable rebinding protection or find out how to add exceptions for your setup.

For pfSense with the DNS Resolver enabled, add a line to the custom options to create an exception:

private-domain: "cfdev.sh"

Note: This is an unbound dns config option so this should work anywhere unbound is used as the backing dns resolver; you just need to add/inject it into unbound.conf. The private-domain option includes all subdomains as well so I used cfdev.sh but you may be able to get away with dev.cfdev.sh. However, there are multiple subdomains under the dev portion (api, login, uaa) that need to resolve so if you just use api.dev.cfdev.sh it'll fail somewhere else later on.