Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Health checks fail due to missing hostname #650

Open
ben-foster-cko opened this issue Nov 25, 2018 · 3 comments
Open

Health checks fail due to missing hostname #650

ben-foster-cko opened this issue Nov 25, 2018 · 3 comments

Comments

@ben-foster-cko
Copy link

  • What version of docker are you running?
    • Docker version 18.03.1-ce, build 9ee9f40
  • What version of registrator are you running?
    • v7
  • Did you build a custom version of registrator? If so, what is that image?
    • No
  • What is the exact command you are running registrator with?
$ docker run -d \
    --name=registrator \
    --net=host \
    --volume=/var/run/docker.sock:/tmp/docker.sock \
    gliderlabs/registrator:latest \
      consul://localhost:8500
  • What is the exact command you are running your container with?
docker run --rm -it -P -e ASPNETCORE_URLS=http://+:5000 -e SERVICE_NAME=simulator -e SERVICE_TAGS=gateway -e SERVICE_CHECK_HTTP=/_system/health simulator
  • A log capture of all the docker events before, during, and after the issue.
  • If relevant, Dockerfile for application that is having issues.

Description of the problem:

After starting consul with the following:

docker run --rm -it -p 8500:8500 -p 8600:8600/udp --name=dev-consul -e CONSUL_BIND_INTERFACE=eth0 consul

Then running registrator and my application (simulator) as described above my health checks are failing. I was expecting that registrator would fill the host portion of the URL but I'm seeing the following in the Consul logs:

    2018/11/24 21:31:18 [WARN] agent: Check "service:linuxkit-025000000001:vigilant_meitner:5000" HTTP request failed: Get http://:32776/_system/health: dial tcp :32776: connect: connection refused

Note the missing host name (http://:32776).

I'm not sure if related but when I request the service via the Consul API, the service address is empty.

How reproducible:

Always

Steps to Reproduce:

See above. I'm assuming this would be the same for any web application running in docker

Actual Results:

HTTP health check failing due to missing host

Expected Results:

HTTP health check executed successfully

Additional info:

@learningfun-dev
Copy link

@ben-foster-cko facing the similar issue. Any update on how to fix it?

@artursmolarek
Copy link

I can confirm the same problem with

Docker version 19.03.5, build 633a0ea838

@hypolas
Copy link

hypolas commented May 23, 2023

Hello,

I had this problem too, so i do a fork and build my custom Docker images:
https://hub.docker.com/r/hypolas/registrator
https://gitlab.com/dkr-registrator/registrator

If tat can help you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants