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

fix: Init internal server log along with loki's server instance #13221

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

periklis
Copy link
Collaborator

What this PR does / why we need it:
Currently Loki's internal server instance is running by default in a panic: nil pointer dereference because along all the updates for 3.0.0, we missed to initialize this server properly:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x84a4ff]

goroutine 1 [running]:
github.com/go-kit/log/level.NewFilter(...)
	/src/loki/vendor/github.com/go-kit/log/level/level.go:43
github.com/grafana/dskit/log.NewGoKitWithLevel({{0x0?, 0xc00192c208?}, 0x0?}, {0x0, 0x0})
	/src/loki/vendor/github.com/grafana/dskit/log/gokit.go:34 +0x21f
github.com/grafana/dskit/server.newServer({{0x0, 0x0}, 0x0, {0x2a68ab9, 0x3}, {0x0, 0x0}, 0xc1d, 0x0, {0x0, ...}, ...}, ...)
	/src/loki/vendor/github.com/grafana/dskit/server/server.go:254 +0x67
github.com/grafana/dskit/server.New({{0x0, 0x0}, 0x0, {0x2a68ab9, 0x3}, {0x0, 0x0}, 0xc1d, 0x0, {0x0, ...}, ...})
	/src/loki/vendor/github.com/grafana/dskit/server/server.go:241 +0x5f
github.com/grafana/loki/v3/pkg/loki.(*Loki).initInternalServer(0xc000d46000)
	/src/loki/pkg/loki/modules.go:213 +0xb8
github.com/grafana/dskit/modules.(*Manager).initModule(0xc000150e40, {0x7ffdd3022ccb, 0xd}, 0x1?, 0xc0008f88d0?)
	/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:136 +0x1f7
github.com/grafana/dskit/modules.(*Manager).InitModuleServices(0x0?, {0xc000e8dca0, 0x1, 0xc0008e8660?})
	/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:108 +0xd8
github.com/grafana/loki/v3/pkg/loki.(*Loki).Run(0xc000d46000, {0x0?, {0x4?, 0x3?, 0x4912940?}})
	/src/loki/pkg/loki/loki.go:453 +0x9d
main.main()
	/src/loki/cmd/loki/main.go:122 +0x113b

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

The internal server in Loki is mainly used in mTLS setups on Kubernetes where we want to allow TLS-secured Readiness/Liveness-Checks without client certificates. Usually k8s readiness/liveness checks do not support mTLS.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@periklis periklis self-assigned this Jun 14, 2024
@periklis periklis requested a review from a team as a code owner June 14, 2024 13:22
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cyriltovena cyriltovena merged commit 66b8c9b into grafana:main Jun 17, 2024
60 checks passed
@slim-bean slim-bean added type/bug Somehing is not working as expected backport k207 labels Jun 18, 2024
grafanabot pushed a commit that referenced this pull request Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport k207 size/XS type/bug Somehing is not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants