-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Provisioning: Validate that dashboard providers have unique names #22898
Provisioning: Validate that dashboard providers have unique names #22898
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
But I think we need a better way to handle this error when starting grafana. This is the error message I get when I have duplicate dashboard provisioners.
EROR[03-20|22:12:09] Failed to provision dashboard logger=provisioning error="Failed to create provisioner: Failed to read dashboards config: could not parse provisioning config file: dev.yaml error: dashboards name \"gdev dashboards\" is not unique"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1482ce0]
goroutine 151 [running]:
github.com/grafana/grafana/pkg/services/provisioning.(*provisioningServiceImpl).Run(0xc00053a000, 0x1de04c0, 0xc000056140, 0x0, 0x0)
/home/carl/go/src/github.com/grafana/grafana/pkg/services/provisioning/provisioning.go:89 +0x170
main.(*Server).Run.func1(0x0, 0x0)
/home/carl/go/src/github.com/grafana/grafana/pkg/cmd/grafana-server/server.go:129 +0x60
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc000398450, 0xc000a17200)
/home/carl/go/src/github.com/grafana/grafana/vendor/golang.org/x/sync/errgroup/errgroup.go:57 +0x59
created by golang.org/x/sync/errgroup.(*Group).Go
/home/carl/go/src/github.com/grafana/grafana/vendor/golang.org/x/sync/errgroup/errgroup.go:54 +0x66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just saw a typo.
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM code-wise
@bergquist pushed a fix for handling of error when starting grafana which will make Grafana server stop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you for contributing to Grafana! :) |
What this PR does / why we need it:
This PR introduces a check if an array of
*DashboardsAsConfig
has only unique namesWhich issue(s) this PR fixes:
Fixes #20421
(this is a clean version of #21676 which I've messed up beautifully)
@marefr :)