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

failed run exporter inside docker #59

Closed
Electronn opened this issue Jun 12, 2017 · 10 comments
Closed

failed run exporter inside docker #59

Electronn opened this issue Jun 12, 2017 · 10 comments

Comments

@Electronn
Copy link

Hello,

I try to ran image inside docker build :

  • Dockerfile
FROM golang
RUN go get -u github.com/justwatchcom/elasticsearch_exporter
COPY start.sh /
RUN chmod +x /start.sh
CMD /start.sh
  • start.sh
#!/bin/bash
elasticsearch_exporter -es.uri http://my.ip.ad.dr:9200
  • docker-compose.yml
prom-elastic:
  build: ./prom-elastic
  container_name: prom-elastic
  hostname: prom-elastic
  ports:
   - 9108:9108
  • docker version
# docker --version
Docker version 17.03.1-ce, build c6d412e

Error :

2017/06/12 20:45:58 Starting Server: :9108
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6f8062]

goroutine 49 [running]:
github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*CounterVec).WithLabelValues(0x0, 0xc42009c938, 0x2, 0x2, 0xa77300, 0xc42027b200)
        /go/src/github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus/counter.go:139 +0x22
main.(*Exporter).Collect(0xc420194080, 0xc420196480)
        /go/src/github.com/justwatchcom/elasticsearch_exporter/exporter.go:459 +0x39af
github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*registry).writePB.func2(0xc4201b4750, 0xc420196480, 0xa252e0, 0xc420194080)
        /go/src/github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:420 +0x61
created by github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*registry).writePB
        /go/src/github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:421 +0x274
@Foxsa
Copy link

Foxsa commented Jun 15, 2017

+1

2017/06/15 09:44:51 Starting Server: :9108
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x59fb4d]

goroutine 21 [running]:
panic(0x8931e0, 0xc820012080)
	/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*CounterVec).WithLabelValues(0x0, 0xc820228a88, 0x2, 0x2, 0x0, 0x0)
	/home/asavin/golang/src/github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus/counter.go:139 +0xbd
main.(*Exporter).Collect(0xc820084580, 0xc82000eba0)
	/home/asavin/golang/src/github.com/justwatchcom/elasticsearch_exporter/exporter.go:471 +0x5805
github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*registry).writePB.func2(0xc820131240, 0xc82000eba0, 0x7f5860df8c98, 0xc820084580)
	/home/asavin/golang/src/github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:420 +0x58
created by github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*registry).writePB
	/home/asavin/golang/src/github.com/justwatchcom/elasticsearch_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:421 +0x34d

@dominikschulz
Copy link
Contributor

Which ES versions are you using? Couldn't reproduce with ES 5.4.1.

@Foxsa
Copy link

Foxsa commented Jun 15, 2017

tested on 5.4.0 and 2.4.1

@Electronn
Copy link
Author

2.4.5 , 5.4.1

@dominikschulz
Copy link
Contributor

Hmm, will need some more time to investigate ...

@Electronn
Copy link
Author

Also tested on 4 different servers ( exporters ) with various hardware.

@dominikschulz
Copy link
Contributor

dominikschulz commented Jun 15, 2017

Thank you, I do not doubt there is a bug somewhere, only I couldn't reproduce it in my (very brief) first tests.

We're using this exporter in production, and it's very important to us, so we'll definitely try to fix this soon.

Unfortunately no ETA, sorry.

yackushevas added a commit to yackushevas/elasticsearch_exporter that referenced this issue Jun 15, 2017
dominikschulz pushed a commit that referenced this issue Jun 16, 2017
* Added several comments to the exported types (https://github.com/golang/go/wiki/CodeReviewComments)

* golint: fix warnings (initialisms)

* golint: "if block ends with a return statement,
so drop this else and outdent its block"
https://golang.org/doc/effective_go.html#if

* fix failed run exporter
solution for issue:
#59

* Update github.com/prometheus/common/model

* Update github.com/prometheus/common/model
@dominikschulz
Copy link
Contributor

Can you please check if the issue is gone with 0.3.3? Works for us (but 0.3.1 also did ...)

@Foxsa
Copy link

Foxsa commented Jun 16, 2017

It works for me now! Thanks!

@dominikschulz
Copy link
Contributor

In case you have any trouble with the current 1.0.0-rc1 or later, please open another issue.

endlessor pushed a commit to endlessor/elasticsearch_exporter that referenced this issue Jun 7, 2021
* Added several comments to the exported types (https://github.com/golang/go/wiki/CodeReviewComments)

* golint: fix warnings (initialisms)

* golint: "if block ends with a return statement,
so drop this else and outdent its block"
https://golang.org/doc/effective_go.html#if

* fix failed run exporter
solution for issue:
prometheus-community/elasticsearch_exporter#59

* Update github.com/prometheus/common/model

* Update github.com/prometheus/common/model
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

3 participants