Configuration error in prometheus

2,271 views
Skip to first unread message

parth....@parlamind.com

unread,
Sep 3, 2018, 10:02:12 AM9/3/18
to Prometheus Users
Hi all,

Good afternoon.

I am trying to run custom image of prometheus from docker and I am having following error:

level=info ts=2018-09-03T13:46:53.942699542Z caller=main.go:222 msg="Starting Prometheus" version="(version=2.3.2, branch=HEAD, revision=71af5e29e815795e9dd14742ee7725682fa14b7b)"
level=info ts=2018-09-03T13:46:53.943117569Z caller=main.go:223 build_context="(go=go1.10.3, user=root@5258e0bd9cc1, date=20180712-14:02:52)"
level=info ts=2018-09-03T13:46:53.943458738Z caller=main.go:224 host_details="(Linux 4.9.93-boot2docker #1 SMP Thu Jul 19 18:29:50 UTC 2018 x86_64 41cf78bf20e6 (none))"
level=info ts=2018-09-03T13:46:53.943751514Z caller=main.go:225 fd_limits="(soft=1048576, hard=1048576)"
level=info ts=2018-09-03T13:46:53.945879012Z caller=main.go:533 msg="Starting TSDB ..."
level=info ts=2018-09-03T13:46:53.953162692Z caller=web.go:415 component=web msg="Start listening for connections" address=0.0.0.0:9090
level=info ts=2018-09-03T13:46:53.955430332Z caller=main.go:543 msg="TSDB started"
level=info ts=2018-09-03T13:46:53.956360763Z caller=main.go:603 msg="Loading configuration file" filename=/etc/prometheus/prometheus.yml
level=info ts=2018-09-03T13:46:53.957499561Z caller=main.go:402 msg="Stopping scrape discovery manager..."
level=info ts=2018-09-03T13:46:53.957806425Z caller=main.go:416 msg="Stopping notify discovery manager..."
level=info ts=2018-09-03T13:46:53.958072894Z caller=main.go:438 msg="Stopping scrape manager..."
level=info ts=2018-09-03T13:46:53.958259314Z caller=main.go:412 msg="Notify discovery manager stopped"
level=info ts=2018-09-03T13:46:53.958519921Z caller=main.go:398 msg="Scrape discovery manager stopped"
level=info ts=2018-09-03T13:46:53.958730489Z caller=manager.go:464 component="rule manager" msg="Stopping rule manager..."
level=info ts=2018-09-03T13:46:53.959019201Z caller=manager.go:470 component="rule manager" msg="Rule manager stopped"
level=info ts=2018-09-03T13:46:53.959271066Z caller=notifier.go:512 component=notifier msg="Stopping notification manager..."
level=info ts=2018-09-03T13:46:53.959532471Z caller=main.go:587 msg="Notifier manager stopped"
level=info ts=2018-09-03T13:46:53.959752357Z caller=main.go:432 msg="Scrape manager stopped"
level=error ts=2018-09-03T13:46:53.960224713Z caller=main.go:596 err="Error loading config couldn't load configuration (--config.file=/etc/prometheus/prometheus.yml): parsing YAML file /etc/prometheus/prometheus.yml: yaml: line 20: found character that cannot start any token"

I did try to alter my configuration file, but didn't found any success, any guidance or assistance in these matter would be highly appreciable.

Thanks!!

Regards,
Parth


Julius Volz

unread,
Sep 3, 2018, 10:24:22 AM9/3/18
to parth....@parlamind.com, Prometheus Users
Can you share your prometheus.yml file? The error message means that the file does not contain valid YAML. If I just do "docker run prom/prometheus", it starts up fine (without changing anything).

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/92d99cbb-d93e-4668-a19e-fa53691d7152%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Parth Bhagat

unread,
Sep 3, 2018, 10:27:56 AM9/3/18
to Julius Volz, Prometheus Users
Hi Julius,

global:
  scrape_interval: 15s
  scrape_timeout: 10s
  evaluation_interval: 15s
alerting:
  alertmanagers:
  - static_configs:
    - targets: []
    scheme: http
    timeout: 10s
scrape_configs:
- job_name: prometheus
  scrape_interval: 15s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: http
  static_configs:
  - targets:
    - localhost:9132

Julius Volz

unread,
Sep 3, 2018, 10:50:08 AM9/3/18
to Parth Bhagat, Prometheus Users
That file works perfectly well for me locally. Maybe there is a problem with mapping it into the Docker container? You said "custom image", maybe something's broken in the custom image?

Parth Bhagat

unread,
Sep 4, 2018, 7:45:40 AM9/4/18
to Julius Volz, Prometheus Users
Hi Julius,

I have re build the image from scratch, as this time around when implementing the run command found this error.!!


On 4 September 2018 at 12:44, Julius Volz <juliu...@gmail.com> wrote:
This second copy of your YAML file is indented differently (and incorrectly) than the first one. Are you sure you are using the correctly indented version you sent here earlier?

Btw., please keep discussions on the public lists.

On Tue, Sep 4, 2018 at 11:32 AM, Parth Bhagat <parth....@parlamind.com> wrote:
Hey,

I had removed the old container and rebuild everything from scratch and still receiveing the below mentioned configuration error,

"Error loading config couldn't load configuration (--config.file=/etc/prometheus/prometheus.yml): parsing YAML file /etc/prometheus/prometheus.yml: yaml: line 8: did not find expected key"

My configuration file:

global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []  (line 8)
    scheme: http
    timeout: 10s
scrape_configs:
- job_name: prometheus
  scrape_interval: 15s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: http
  static_configs:
   - targets:
    - localhost:"9132"
On 4 September 2018 at 10:28, Parth Bhagat <parth....@parlamind.com> wrote:
Hi Julius,

I tried implementing both the above mentioned solutions, but still it is returning the same error. 😇

On 3 September 2018 at 17:36, Julius Volz <juliu...@gmail.com> wrote:
Using the custom image build process you linked to with your configuration file also works for me.

If you put your configuration file into /tmp/prometheus.yml, can you confirm that the following works with the standard Prometheus image?

$ docker run -p 9090:9090 -v /tmp/prometheus:/etc/prometheus/prometheus.yml' prom/prometheus

If not, can you also try purging the local copy of the prom/prometheus image and try again:

$ docker rmi prom/prometheus

(you might need to remove containers referring to the image first before deleting it)

On Mon, Sep 3, 2018 at 5:05 PM, Parth Bhagat <parth....@parlamind.com> wrote:
Docker command: $ docker run -p 9132:9132 my-prometheus

Custom image build process, I followed the following link, 


On 3 September 2018 at 16:56, Julius Volz <juliu...@gmail.com> wrote:
Can you share the exact Docker command that you are using to run it? Can you also share how you built the custom image?

At this point it doesn't look like a problem with Prometheus or the official Prometheus Docker images though...

On Mon, Sep 3, 2018 at 4:53 PM, Parth Bhagat <parth....@parlamind.com> wrote:
I tried to re-run the image with same configuration, as still got the same error.... 

And it is the first run for the image, so I don't find any broken link in the image as well. 

Any other idea or some trick to make it run?

Thanks!!

Reply all
Reply to author
Forward
0 new messages