ERROR: myURL/v1 is not accessible (Connection timed out after 15001 milliseconds)

Hello every one,
I’m working on creating my first Rancher Host, but i’m facing now this error:

INFO: Running Agent Registration Process, CATTLE_URL=http://myURL:8081/v1
INFO: Attempting to connect to: http:// myURL:8081/v1
ERROR: http:// myURL:8081/v1 is not accessible (Connection timed out after 15002 milliseconds)

This is my docker-compose.yml

nginx-proxy:
image: jwilder/nginx-proxy
ports:
- 8081:80
- 4436:443
volumes:
- ./etc/nginx/certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./vhost:/etc/nginx/vhost.d
- ./web:/usr/share/nginx/html
restart: always
letsencrypt-nginx:
image: jrcs/letsencrypt-nginx-proxy-companion
volumes:
- ./etc/nginx/certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes_from:
- nginx-proxy
rancher-server:
image: rancher/server
environment:
VIRTUAL_PORT: 8080
VIRTUAL_PROTO: https
VIRTUAL_HOST: myURL
LETSENCRYPT_HOST: myURL
LETSENCRYPT_EMAIL: email
volumes:
- ./rancher-server/mysql:/var/lib/mysql:rw

When I execute :
docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.6 http://myURL:8081/v1/scripts/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I get the error, is that related to iptables service because i’m working on ubuntu 14.04 ?

Thank you for your help

Is this running on a cloud provider, or in your local network?
Are you able to get to the URL from your computer?

Hello,
Thank you for your response , it’s in my local network.

Are you able to get a response if you put that URL in your browser on a separate computer?

Thank you for your response, i found the solution ,
I added the hostname in /etc/hosts ,
ip_adresse hostname
I reboot the machine and i repeat the scénario and every think work’s good.

I’m still searching for the solution to the same problem, and it’s not my local network… :expressionless:

Hello there ,

I ve same problem.

I can access my url through https without any problem. ( ending with /v1 )

I have a public IP address and my rancher agent works on ( at least trying…).

I can also do ping to rancher._____.com on the host. I mean , there is no accessing problem to this url…

but when I try to run rancher agents on my docker host machine we’re facing this error. (…is not accessible (Connection timed out after 15001 milliseconds))

Please help…

PS : That’s command that we run on host…

sudo docker run -e CATTLE_AGENT_IP=“94.x.y.z” --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.7 https://rancher.___.com/v1/scripts/3BRRR29F8D16236RRRRR08:1483142400000:hbdaxQY8u5RQe7apyStN9XXXXXXXX

Are you able to get a response to that URL from the host using curl?

You can troubleshoot this by running the commands (ping and curl) inside the agent container, as this is where the connection is initiated.