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

[Bug]: panic: runtime error: invalid memory address or nil pointer dereference #519

Closed
robinsmidsrod opened this issue Nov 8, 2024 · 4 comments · Fixed by #520
Closed
Assignees
Labels
bug Something isn't working

Comments

@robinsmidsrod
Copy link

Grizzly Version

2024/11/08 09:31:06 grr version v0.6.0

Expected Behavior

Running grr apply 7veier.yaml should apply the check to our monitoring stack.

Actual Behavior

$ grr apply 7veier.yaml
Applying 1 resource
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xfc1035]

goroutine 1 [running]:
github.com/grafana/grizzly/pkg/grizzly.(*Resource).Spec(...)
        /home/runner/work/grizzly/grizzly/pkg/grizzly/resources.go:170
github.com/grafana/grizzly/pkg/grizzly.(*Resource).GetSpecValue(...)
        /home/runner/work/grizzly/grizzly/pkg/grizzly/resources.go:154
github.com/grafana/grizzly/pkg/syntheticmonitoring.(*SyntheticMonitoringHandler).Prepare(0xc0003b7ce0?, 0x0, {0xc000410060, {{0x132527d, 0x4}, {0x0, 0x0}, {0x7ffffea136df, 0xb}, 0x1, ...}})
        /home/runner/work/grizzly/grizzly/pkg/syntheticmonitoring/synthetic-monitoring-handler.go:65 +0x95
github.com/grafana/grizzly/pkg/grizzly.applyResource({{0xc0003b7b30, 0x3, 0x3}, 0xc0003b7b60, {0xc0000a7400, 0x9, 0x10}}, {0xc000410060, {{0x132527d, 0x4}, ...}}, ...)
        /home/runner/work/grizzly/grizzly/pkg/grizzly/workflow.go:422 +0xeb5
github.com/grafana/grizzly/pkg/grizzly.Apply({{0xc0003b7b30, 0x3, 0x3}, 0xc0003b7b60, {0xc0000a7400, 0x9, 0x10}}, {0xc0003b7b30?}, 0x0, {0x1513850, ...})
        /home/runner/work/grizzly/grizzly/pkg/grizzly/workflow.go:390 +0x1a5
main.applyCmd.func1(0xc0000a7a00?, {0xc0003ccf70, 0x1, 0x601804?})
        /home/runner/work/grizzly/grizzly/cmd/grr/workflow.go:260 +0x3fb
main.initialiseOnlySpec.func1(0xc0003e2820, {0xc0003ccf70, 0x1, 0x1})
        /home/runner/work/grizzly/grizzly/cmd/grr/workflow.go:537 +0x73
main.initialiseLogging.func1(0xc0003e2820, {0xc0003ccf70, 0x1, 0x1})
        /home/runner/work/grizzly/grizzly/cmd/grr/workflow.go:552 +0x7f
github.com/go-clix/cli.(*Command).execute(0xc0003e2820, {0xc0003ccf50, 0x1, 0x1})
        /home/runner/go/pkg/mod/github.com/go-clix/[email protected]/command.go:118 +0x444
github.com/go-clix/cli.(*Command).Execute(0xc00033d0e0)
        /home/runner/go/pkg/mod/github.com/go-clix/[email protected]/command.go:76 +0xbb
main.main()
        /home/runner/work/grizzly/grizzly/cmd/grr/main.go:71 +0x673

Steps to Reproduce

  1. grr apply 7veier.yaml

The YAML manifest is like this:

apiVersion: grizzly.grafana.com/v1alpha1
kind: SyntheticMonitoringCheck
metadata:
    name: 7veiertildrama.fagbokforlaget.no
    type: http
spec:
    alertSensitivity: low
    basicMetricsOnly: true
    enabled: true
    frequency: 120000
    job: 7veiertildrama.fagbokforlaget.no
    labels:
        - name: cluster
          value: mo
        - name: service
          value: nginx
    offset: 0
    probes:
        - Amsterdam
        - London
    settings:
        http:
            failIfNotSSL: true
            failIfSSL: false
            ipVersion: V4
            method: HEAD
            noFollowRedirects: false
    target: https://7veiertildrama.fagbokforlaget.no
    timeout: 3000

This is the contents of the settings.yaml (with my own values masked):

apiversion: v1alpha1
contexts:
    default:
        grafana:
            url: https://forxxx.grafana.net
        mimir:
            address: https://prometheus-prod-22-prod-eu-west-3.grafana.net
            tenant-id: "611119"
        name: default
        synthetic-monitoring:
            access-token: eyJrxxx30=
            logs-id: "311110"
            metrics-id: "671119"
            stack-id: "411112"
            url: https://synthetic-monitoring-api-eu-west-3.grafana.net
        targets:
            - SyntheticMonitoringCheck
current-context: default

The core thing to take into account is that grafana and mimir is not authenticated, only synthetic monitoring. But this shouldn't be a problem, as the monitoring stack is already created, so the plan is to only add/modify/remove checks.

@robinsmidsrod robinsmidsrod added the bug Something isn't working label Nov 8, 2024
@K-Phoen K-Phoen self-assigned this Nov 8, 2024
@K-Phoen
Copy link
Member

K-Phoen commented Nov 8, 2024

Thanks for reporting this issue!

I'm working on a fix in #520

@robinsmidsrod
Copy link
Author

Thanks for the quick turnaround! Impressed! Is a new release with this fix included expected soon?

@K-Phoen
Copy link
Member

K-Phoen commented Nov 10, 2024

My pleasure :)

I'll most likely tag a new release Tuesday or Wednesday

@K-Phoen
Copy link
Member

K-Phoen commented Nov 14, 2024

And it's out!

https://github.com/grafana/grizzly/releases/tag/v0.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants