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: Add nil check to support bundle printer that prints remotecfg & local sources #2355

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

dehaansa
Copy link
Contributor

@dehaansa dehaansa commented Jan 8, 2025

PR Description

@mattdurham encountered the following panic when testing the RC for 1.6

EDIT: Also removing public preview requirement for support bundle.

2025/01/08 12:10:50 http: panic serving 127.0.0.1:60176: runtime error: invalid memory address or nil pointer dereference
goroutine 1288 [running]:
net/http.(*conn).serve.func1()
        /home/mdurham/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:1947 +0xbe
panic({0x9456080?, 0x114afc70?})
        /home/mdurham/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:785 +0x132
github.com/grafana/alloy/syntax/printer.(*walker).walkFile(0xc001d2f1f8, 0x0)
        /home/mdurham/source/alloy_grafana/vendor/github.com/grafana/alloy/syntax/printer/walker.go:35 +0x25
github.com/grafana/alloy/syntax/printer.(*walker).Walk(0x10?, {0xbc0bee0?, 0x0?})
        /home/mdurham/source/alloy_grafana/vendor/github.com/grafana/alloy/syntax/printer/walker.go:20 +0x45
github.com/grafana/alloy/syntax/printer.(*Config).Fprint(0xa9ae0a0?, {0xbc0be40, 0xc00dcf5350}, {0xbc0bee0, 0x0})
        /home/mdurham/source/alloy_grafana/vendor/github.com/grafana/alloy/syntax/printer/printer.go:29 +0x169
github.com/grafana/alloy/internal/service/http.printFileRedacted(0x0)
        /home/mdurham/source/alloy_grafana/internal/service/http/http.go:670 +0x56
github.com/grafana/alloy/internal/service/http.remoteCfgRedactedCachedConfig({0xbcd6920?, 0xc001b4ae00?})
        /home/mdurham/source/alloy_grafana/internal/service/http/http.go:660 +0x52
github.com/grafana/alloy/internal/service/http.(*Service).Run.(*Service).generateSupportBundleHandler.func12({0xbca82f0, 0xc001a1c9c0}, 0xc0009dac80)
        /home/mdurham/source/alloy_grafana/internal/service/http/http.go:341 +0x2ea
net/http.HandlerFunc.ServeHTTP(0xbc9b500?, {0xbca82f0?, 0xc001a1c9c0?}, 0xa9b615a?)
        /home/mdurham/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2220 +0x29
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux.traceware.ServeHTTP({{0xa998833, 0x5}, {0xbc3b528, 0xc00119f680}, {0xbc9df30, 0xc001432340}, {0xbc0c5e0, 0xc001d12d80}, 0xafc8af8, 0x0, ...}, ...)
        /home/mdurham/source/alloy_grafana/vendor/go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux/mux.go:179 +0xb91
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0010d29c0, {0xbc9b500, 0xc001b50380}, 0xc0009da640)
        /home/mdurham/source/alloy_grafana/vendor/github.com/gorilla/mux/mux.go:212 +0x1e2
golang.org/x/net/http2/h2c.h2cHandler.ServeHTTP({{0xbc0d0e0?, 0xc0010d29c0?}, 0xc0005c80e0?}, {0xbc9b500, 0xc001b50380}, 0xc0009da640)
        /home/mdurham/source/alloy_grafana/vendor/golang.org/x/net/http2/h2c/h2c.go:125 +0x673
net/http.serverHandler.ServeHTTP({0xc00dcf5110?}, {0xbc9b500?, 0xc001b50380?}, 0x6?)
        /home/mdurham/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc03d3a2510, {0xbcc4ac8, 0xc001b84300})
        /home/mdurham/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 722
        /home/mdurham/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:3360 +0x485

Which issue(s) this PR fixes

Notes to the Reviewer

PR Checklist

@dehaansa dehaansa requested a review from a team as a code owner January 8, 2025 17:21
Copy link
Contributor

github-actions bot commented Jan 8, 2025

💻 Deploy preview deleted.

Copy link
Collaborator

@mattdurham mattdurham left a comment

Choose a reason for hiding this comment

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

Lgtm will wait for Clayton’s blessing

@mattdurham
Copy link
Collaborator

Gonna go ahead and merge this since it was only a label change on the docs.

@mattdurham mattdurham merged commit bd20017 into main Jan 9, 2025
19 of 20 checks passed
@mattdurham mattdurham deleted the fix/support-bundle-nil-panic branch January 9, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants