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

promtool says config is valid when it isn't #1458

Closed
davidmankin opened this Issue Mar 3, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@davidmankin
Copy link

davidmankin commented Mar 3, 2016

promtool told me that this (snippet of) config was valid but Prometheus crashed trying to read it.

    relabel_configs:
   - source_labels: [__address__]
      #regex: "(.+):10255"
      target_label: node
      # replacement: "${1}"

Promtool says SUCCESS

$ promtool check-config prometheus-config/prometheus.yml
Checking prometheus-config/prometheus.yml
  SUCCESS: 0 rule files found

Prometheus crashes:

time="2016-03-03T19:21:53Z" level=error msg="Couldn't load configuration (-config.file=/etc/prometheus/prometheus.yml): relabel configuration requires a regular expression" source="main.go:208"

Further it would be useful if the error message explained specifically that it was a 'regex' field that was missing on line 92.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Mar 3, 2016

Are they both from the same Prometheus version? Relabel configs don't need an explicitly specified regex field anymore since Prometheus 0.17.0, so if your promtool is 0.17.0, but your Prometheus is older, you will hit this problem.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Mar 3, 2016

(meaning, there is now a default regex of (.*) when nothing is specified)

@davidmankin

This comment has been minimized.

Copy link
Author

davidmankin commented Mar 3, 2016

Oops, nope. My prometheus is v0.16.2 and I just got promtool with "go get" so it's probably newer.

I can't tell what version my promtool is:

$ go-venv/bin/promtool version
prometheus, version  (branch: , revision: )
  build user:
  build date:
  go version:

@davidmankin davidmankin closed this Mar 3, 2016

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Mar 3, 2016

Yeah, the version information is only filled in when building Prometheus or promtool via make.

@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.