# ERROR: http://rancher:8080/v1 is not accessible

**URL:** <https://forums.suse.com/t/error-http-rancher-8080-v1-is-not-accessible/6469>\
**Category:** RancherOS\
**Created:** [May 25, 2017, 7:41pm UTC](https://forums.suse.com/t/error-http-rancher-8080-v1-is-not-accessible/6469 "2017-05-25T19:41:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawandeepthind](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pawandeepthind](https://forums.suse.com/u/pawandeepthind)\
**Post date:** [May 25, 2017, 7:41pm UTC](https://forums.suse.com/t/error-http-rancher-8080-v1-is-not-accessible/6469/1 "2017-05-25T19:41:42Z")

</div>

I am trying to run rancher to test it out and promote it with in my organization.  
Here i have a multivm vagrant based setup. All the VMs are CentOS 7 (Linux host1 3.10.0-327.el7.x86\_64 #1MP Thu Nov 19 22:10:57 UTC 2015 x86\_64 x86\_64 x86\_64 GNU/Linux)

1. One machine is dedicated to rancher.
2. Two other machines are host1 and host2.  
Note: all these machines can ping each other and do ssh.  
I ran rancher in my rancher server box with following command:  
$ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable  
This works fine i can see the UI and then when i try to add the host using this command

> sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.2 [http://rancher:8080/v1cripts/78651D3B0D78F77EF0B9:1483142400000:dIEJCGrcGbIKE0jHF7C3oU7bwOY](http://rancher:8080/v1cripts/78651D3B0D78F77EF0B9:1483142400000:dIEJCGrcGbIKE0jHF7C3oU7bwOY)  
> I see following output,  
> INFO: Running Agent Registration Process, CATTLE\_URL=[http://rancher:8080/v1](http://rancher:8080/v1)  
> INFO: Attempting to connect to: [http://rancher:8080/v1](http://rancher:8080/v1)  
> ERROR: [http://rancher:8080/v1](http://rancher:8080/v1) is not accessible  
> ERROR: [http://rancher:8080/v1](http://rancher:8080/v1) is not accessible  
> If i do curl i get following outputs,  
> [vagrant@host1 ~]$ curl -k -i [http://rancher:8080/v1](http://rancher:8080/v1)  
> HTTP/1.1 401 Unauthorized  
> Content-Type: application/json; charset=utf-8  
> Date: Wed, 24 May 2017 15:33:28 GMT  
> Expires: Thu, 01 Jan 1970 00:00:00 GMT  
> Server: Jetty(9.2.11.v20150529)  
> Set-Cookie: PL=rancher;Path=/  
> Www-Authenticate: Basic realm=“Enter API access key and secret key as username and password”  
> X-Api-Schemas: [http://rancher:8080/v1/schemas](http://rancher:8080/v1/schemas)  
> X-Rancher-Version: v1.5.10  
> Content-Length: 177  
> {“id”:“ecd5644f-e765-4dc3-bc77-e9d7a2797184”,“type”:“error”,“links”:{},“actions”:{},“status”:401,“code”:“Uuthorized”,“message”:“Unauthorized”,“detail”:null,“baseType”:“error”}  
> [vagrant@host1 ~]$ curl -k -i [http://rancher:8080/v1cripts/78651D3B0D78F77EF0B9:1483142400000:dIEJCGrcGbIKE0jHF7C3oU7bwOY](http://rancher:8080/v1cripts/78651D3B0D78F77EF0B9:1483142400000:dIEJCGrcGbIKE0jHF7C3oU7bwOY)  
> HTTP/1.1 200 OK  
> Content-Type: text/plain  
> Date: Wed, 24 May 2017 15:34:04 GMT  
> Expires: Thu, 01 Jan 1970 00:00:00 GMT  
> Server: Jetty(9.2.11.v20150529)  
> Set-Cookie: PL=rancher;Path=/  
> Vary: Accept-Encoding, User-Agent  
> Www-Authenticate: Basic realm=“Enter API access key and secret key as username and password”  
> X-Api-Schemas: [http://rancher:8080/v1/schemas](http://rancher:8080/v1/schemas)  
> X-Rancher-Version: v1.5.10  
> Content-Length: 263  
> #!/bin/sh  
> export CATTLE\_REGISTRATION\_ACCESS\_KEY=“registrationToken”  
> export CATTLE\_REGISTRATION\_SECRET\_KEY=“78651D3B0D78F77EF0B9:1483142400000:dIEJCGrcGbIKE0jHF7C3oU7bwOY”  
> export CATTLE\_URL=“[http://rancher:8080/v1](http://rancher:8080/v1)”  
> export DETECTED\_CATTLE\_AGENT\_IP=“192.168.33.21”

Not sure how to proceed from here. And do further debugging.

---

<div class="post-metadata">

**Author:** ![superseb](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/superseb/32/2424_2.png) [@superseb](https://forums.suse.com/u/superseb)\
**Post date:** [June 29, 2017, 8:26am UTC](https://forums.suse.com/t/error-http-rancher-8080-v1-is-not-accessible/6469/2 "2017-06-29T08:26:45Z")

</div>

Only thing I can think of here is that `rancher` in your example is resolvable from the host but not within the container. Remember that the agent runs in a container which doesn’t have any `/etc/hosts` modifications that the host may have. Can you let me know if this helps?
