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

Service fails to start under systemd #244

Closed
slarti5191 opened this issue Jul 31, 2018 · 4 comments
Closed

Service fails to start under systemd #244

slarti5191 opened this issue Jul 31, 2018 · 4 comments

Comments

@slarti5191
Copy link

Quotes in web.external-url are breaking the service with systemd.

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.4.0
  • Ruby: 2.0.0p648
  • Distribution: CentOS 7
  • Module version: 6.1.0

How to reproduce (e.g Puppet code you use)

Attempt to manage service with systemd and prometheus 2.0.0

What are you seeing

Service fails to start with this error:

Jul 31 13:53:14 prometheus.example.com prometheus[25352]: parse external URL "'/prometheus'": URL must not begin or end with quotes

Behavior is the same when external.url is not populated.

What behaviour did you expect instead

Normal service start

Output log

Any additional information you'd like to impart

Fixed with:

diff --git a/modules/prometheus/manifests/config.pp b/modules/prometheus/manifests/config.pp
index 9218a41..f198d6c 100644
--- a/modules/prometheus/manifests/config.pp
+++ b/modules/prometheus/manifests/config.pp
@@ -30,7 +30,7 @@ class prometheus::config {
         "--storage.tsdb.retention=${prometheus::server::storage_retention}",
         "--web.console.templates=${prometheus::server::shared_dir}/consoles",
         "--web.console.libraries=${prometheus::server::shared_dir}/console_libraries",
-        "--web.external-url='${prometheus::server::external_url}'",
+        "--web.external-url=${prometheus::server::external_url}",
       ]
     }
@bastelfreak
Copy link
Member

Hey @slarti5191, thanks for rising this issue. Can you provide the puppet code you use to call the module? Do you explicitly set the $prometheus::server::external_url parameter?

@slarti5191
Copy link
Author

Here is what I have - it is a near exact copy/paste from the example here

    manage_prometheus_server => true,
    version => '2.0.0',
    #lint:ignore:140chars
    alerts => { 'groups' => [{ 'name' => 'alert.rules', 'rules' => [{ 'alert' => 'InstanceDown', 'expr' => 'up == 0', 'for' => '5m', 'labels' => { 'severity' => 'page', }, 'annotations' => { 'summary' => 'Instance {{ $labels.instance }} down', 'description' => '{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.' } }]}]},
    scrape_configs => [
      { 'job_name' => 'prometheus',
         'scrape_interval' => '10s',
         'scrape_timeout'  => '10s',
         'static_configs'  => [
           { 'targets' => [ 'localhost:9090' ],
             'labels'  => { 'alias'=> 'Prometheus'}
           }
         ]
       },
      { 'job_name' => 'files',
        'scrape_interval' => '5s',
        'scrape_timeout'  => '5s',
        'file_sd_configs'  => [
          { 'files' => [ '/etc/prometheus/conf.d/*.json' ],}
        ]
      }
    ],
    alertmanagers_config => [{ 'static_configs' => [{'targets' => [ 'localhost:9093' ]}]}],
  }

I tried specifying external_url => and encountered the same failure, once I removed the single quotes at line 33 of config.pp the issue went away.

@bastelfreak
Copy link
Member

@slarti5191 We just merged #245, can you test if that fixes your issues?

@slarti5191
Copy link
Author

Looks good - thank 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

2 participants