Failed to connect to Cloud Foundry endpoint

284 views
Skip to first unread message

Arbi Akhina

unread,
Feb 27, 2015, 11:12:59 AM2/27/15
to bosh-...@cloudfoundry.org

I've setup Cloud Foundry locally with Bosh Lite and uploaded stemcells and releases as describedhere. When I try use my CF installation and connect to the API endpoint I get a connection refused error as follows:

$ cf api --skip-ssl-validation https://api.10.244.0.34.xip.io
Setting api endpoint to https://api.10.244.0.34.xip.io...
FAILED
Error performing request: Get https://api.10.244.0.34.xip.io/v2/info: dial tcp
10.244.0.34:443: connection refused

I can reach the 10.244.0.34 ip address (and all addresses listed below) from my machine:

$ ping 10.244.0.34
PING 10.244.0.34 (10.244.0.34) 56(84) bytes of data.
64 bytes from 10.244.0.34: icmp_seq=1 ttl=63 time=2.47 ms
64 bytes from 10.244.0.34: icmp_seq=2 ttl=63 time=1.84 ms
64 bytes from 10.244.0.34: icmp_seq=3 ttl=63 time=2.28 ms

--- 10.244.0.34 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 1.842/2.201/2.473/0.264 ms

However I cannot connect to https://api.10.244.0.34.xip.io/v2/info with a connection refused on port 443

Here is the list of the different VMs running on the cloud:

$ bosh vms
Deployment `cf-warden'

Director task 6

Task 6 done

+------------------------------------+---------+---------------+--------------+
| Job/index                          | State   | Resource Pool | IPs          |
+------------------------------------+---------+---------------+--------------+
| api_z1/0                           | running | large_z1      | 10.244.0.138 |
| etcd_z1/0                          | running | medium_z1     | 10.244.0.42  |
| ha_proxy_z1/0                      | running | router_z1     | 10.244.0.34  |
| hm9000_z1/0                        | running | medium_z1     | 10.244.0.142 |
| loggregator_trafficcontroller_z1/0 | running | small_z1      | 10.244.0.150 |
| loggregator_z1/0                   | running | medium_z1     | 10.244.0.146 |
| login_z1/0                         | running | medium_z1     | 10.244.0.134 |
| nats_z1/0                          | running | medium_z1     | 10.244.0.6   |
| postgres_z1/0                      | running | medium_z1     | 10.244.0.30  |
| router_z1/0                        | running | router_z1     | 10.244.0.22  |
| runner_z1/0                        | running | runner_z1     | 10.244.0.26  |
| uaa_z1/0                           | running | medium_z1     | 10.244.0.130 |
+------------------------------------+---------+---------------+--------------+

VMs total: 12

What I'm missing to successfully establish a connection the endpoint?

James Bayer

unread,
Feb 27, 2015, 11:23:28 AM2/27/15
to bosh-users
looks like a networking problem.

can you check the ha_proxy job and see if you can reach port 443 from inside the "VM" which is a container? does port 80 work?

To unsubscribe from this group and stop receiving emails from it, send an email to bosh-users+...@cloudfoundry.org.



--
Thank you,

James Bayer

Arbi Akhina

unread,
Feb 27, 2015, 11:43:44 AM2/27/15
to bosh-...@cloudfoundry.org
I tried from inside Bosh Lite VM, here is the output

$ vagrant ssh

vagrant@agent-id-bosh-0:~$ wget https://api.10.244.0.34.xip.io/v2/info
--2015-02-27 16:34:43--  https://api.10.244.0.34.xip.io/v2/info
Resolving api.10.244.0.34.xip.io (api.10.244.0.34.xip.io)... 10.244.0.34
Connecting to api.10.244.0.34.xip.io (api.10.244.0.34.xip.io)|10.244.0.34|:443... failed: Connection refused.

vagrant@agent-id-bosh-0:~$ wget http://api.10.244.0.34.xip.io/
--2015-02-27 16:39:55--  http://api.10.244.0.34.xip.io/
Resolving api.10.244.0.34.xip.io (api.10.244.0.34.xip.io)... 10.244.0.34
Connecting to api.10.244.0.34.xip.io (api.10.244.0.34.xip.io)|10.244.0.34|:80... failed: Connection refused.

James Bayer

unread,
Feb 27, 2015, 11:56:06 AM2/27/15
to bosh-users
ok, so definitely a problem in here somewhere. you could "bosh ssh" inside the ha_proxy job and see if those ports are open and have the ha_proxy process listening to them. if yes as i expect because the jobs say they are running in "bosh vms", then probably an ip_tables thing or similar in the bosh_lite vm.

Arbi Akhina

unread,
Feb 27, 2015, 12:05:14 PM2/27/15
to bosh-...@cloudfoundry.org
I cannot ssh !! 

$ bosh ssh

Processing deployment manifest
------------------------------
Incorrect YAML structure in `/home/heavenize/bosh-lite/manifests/cf-manifest.yml': expected Hash at the root

cf-manifest.yml is empty, in fact I used "./bin/provision_cf" and didn't generate a manifest file manually.

Arbi Akhina

unread,
Feb 27, 2015, 12:36:24 PM2/27/15
to bosh-...@cloudfoundry.org
I manged to run "bosh ssh" into "1. ha_proxy_z1/0", however there is nothing listening on ports 80 and 443!
I tried with "lsof -i :PORT_NUM" and "sudo netstat -lpn |grep :PORT_NUM" for both ports.

Dmitriy Kalinin

unread,
Feb 27, 2015, 12:44:13 PM2/27/15
to bosh-...@cloudfoundry.org
What does monit summary show (run as root)?

Arbi Akhina

unread,
Feb 27, 2015, 12:58:33 PM2/27/15
to bosh-...@cloudfoundry.org
bosh_hmwavnvgq@78872f59-9bfb-483e-b895-3e1a4b5595f3:~$ sudo /var/vcap/bosh/bin/monit summary
/var/vcap/bosh/etc/monitrc:8: Warning: include files not found '/var/vcap/monit/job/*.monitrc'
The Monit daemon 5.2.4 uptime: 3h 45m

System 'system_78872f59-9bfb-483e-b895-3e1a4b5595f3' running
bosh_hmwavnvgq@78872f59-9bfb-483e-b895-3e1a4b5595f3:~$
Reply all
Reply to author
Forward
0 new messages