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

promtail: panic with external_labels #1404

Closed
maxtar opened this issue Dec 12, 2019 · 1 comment · Fixed by #1416
Closed

promtail: panic with external_labels #1404

maxtar opened this issue Dec 12, 2019 · 1 comment · Fixed by #1416
Labels
component/agent good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! keepalive An issue or PR that will be kept alive and never marked as stale.

Comments

@maxtar
Copy link

maxtar commented Dec 12, 2019

Describe the bug
Incorrect hyphen in yaml config leads to panic error.

To Reproduce

  1. Add to client section the following section:
clients:
  - url: https://need.host.com:3100/loki/api/v1/push
  - external_labels:
      host: host1
  1. Start promtail.
  2. See error in journalctl.

Expected behavior
Log contains clear error message.

Systemd log

Started Promtail for loki.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x124a17a]
goroutine 1 [running]:
github.com/grafana/loki/pkg/promtail/client.New(0x0, 0x3b9aca00, 0x19000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /src/loki/pkg/promtail/client/client.go:107 +0x3a
github.com/grafana/loki/pkg/promtail/client.NewMulti(0x2dee8e0, 0xc00037b770, 0xc000184820, 0x2, 0x2, 0xc00011a140, 0x0, 0x0, 0xc0005
        /src/loki/pkg/promtail/client/multi.go:23 +0x140
github.com/grafana/loki/pkg/promtail.New(0x0, 0x0, 0x0, 0x0, 0x2378, 0x0, 0x0, 0x2387, 0x1, 0x6fc23ac00, ...)
        /src/loki/pkg/promtail/promtail.go:33 +0x1e1
main.main()
        /src/loki/cmd/promtail/main.go:59 +0x262
 Main process exited, code=exited, status=2/INVALIDARGUMENT
 Failed with result 'exit-code'.
@cyriltovena cyriltovena added component/agent good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! keepalive An issue or PR that will be kept alive and never marked as stale. labels Dec 13, 2019
@pstibrany
Copy link
Member

This is a problem with YAML syntax. This config creates two clients, with with url: https://need.host.com:3100/loki/api/v1/push and no external labels, the other one with external labels but no url. Promtail fails with panic because it expects URL to exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/agent good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! keepalive An issue or PR that will be kept alive and never marked as stale.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants