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

chore: [k207] fix: Init internal server log along with loki's server instance #13256

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

grafanabot
Copy link
Collaborator

Backport 66b8c9b from #13221


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

@grafanabot grafanabot requested a review from a team as a code owner June 18, 2024 15:06
@grafanabot grafanabot added backport size/XS type/bug Somehing is not working as expected labels Jun 18, 2024
@grafanabot grafanabot requested a review from cyriltovena June 18, 2024 15:06
@slim-bean slim-bean merged commit f0bfa65 into k207 Jun 18, 2024
61 checks passed
@slim-bean slim-bean deleted the backport-13221-to-k207 branch June 18, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 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