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

The server run by the Docker image does not respond to requests #1187

Closed
exarkun opened this Issue Oct 27, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@exarkun
Copy link

exarkun commented Oct 27, 2015

If I start a Prometheus server like this:

jean-paul@dilaton:~$ mkdir /tmp/prometheus                                                                                                                                                     
jean-paul@dilaton:~$ cat /tmp/prometheus.yml 
# vi: set ft=yaml sw=2 :
# Global settings and defaults.
global:
  # By default, scrape targets every 60 seconds.
  scrape_interval: "60s"
  # By default, evaluate alerting and recording rules every 60 seconds.
  evaluation_interval: "60s"

scrape_configs:
- job_name: "prometheus"
  target_groups:
  - targets:
    - "localhost:9090"
jean-paul@dilaton:~$ docker run --rm -v /tmp/prometheus.yml:/prometheus.yml:ro -v /tmp/prometheus:/data -p 9090:9090 prom/prometheus -storage.local.path=/data -config.file=/prometheus.yml -lo
g.level debug                                                                                                                                                                                  
prometheus, version 0.16.1 (branch: stable, revision: 968ee35)
  build user:       @afbbf75ae75d
  build date:       20151016-11:46:24
  go version:       1.5.1
time="2015-10-27T13:21:09Z" level=info msg="Loading configuration file /prometheus.yml" source="main.go:196" 
time="2015-10-27T13:21:09Z" level=info msg="Loading series map and head chunks..." source="storage.go:262" 
time="2015-10-27T13:21:09Z" level=info msg="0 series loaded." source="storage.go:267" 
time="2015-10-27T13:21:09Z" level=info msg="Listening on :9090" source="web.go:223" 
time="2015-10-27T13:21:09Z" level=info msg="Starting target manager..." source="targetmanager.go:114" 
time="2015-10-27T13:21:09Z" level=debug msg="Received potential update for target group \"prometheus:static:0:0\"" source="targetmanager.go:179" 
time="2015-10-27T13:21:09Z" level=debug msg="Starting scraper for target localhost:9090..." source="target.go:313" 

And then submit a request to it like this:

$ curl http://localhost:9090/
curl: (56) Recv failure: Connection reset by peer

Something seems to be wrong. I expected Prometheus to answer my request (even if only with a 404 or a 500 or something). Instead, the connection is closed with no response after a couple seconds.

The exact image on my system is ecf5b3caa2818084751cc936248f9de4237ef00963f7f2c4b601bdcb1ab4fdd0

$ docker version
Client:
 Version:      1.8.3
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   f4bf5c7
 Built:        Mon Oct 12 05:37:18 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.8.3
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   f4bf5c7
 Built:        Mon Oct 12 05:37:18 UTC 2015
 OS/Arch:      linux/amd64
@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Dec 28, 2015

This seems to be an issue with your Docker networking setup rather than Prometheus.

Try setting up a port binding when starting the container (-p 9090:9090) and make sure you are using the correct host. localhost might not be right when using docker-machine (use docker-machine ip to find out the VM IP).

@fabxc fabxc closed this Dec 28, 2015

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.