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

Flow UI: Panic when viewing otelcol.exporter.otlp component #2361

Closed
rfratto opened this issue Oct 13, 2022 · 0 comments · Fixed by #2437
Closed

Flow UI: Panic when viewing otelcol.exporter.otlp component #2361

rfratto opened this issue Oct 13, 2022 · 0 comments · Fixed by #2437
Assignees
Labels
bug Something isn't working frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Milestone

Comments

@rfratto
Copy link
Member

rfratto commented Oct 13, 2022

Given the following config file:

otelcol.exporter.otlp "example" {
	client {
		endpoint = "example:4317"
	}
}

Perform the following steps:

You will see a panic in stdout.

Panic info
2022-10-13 15:27:43.488277 I | http: panic serving 127.0.0.1:52833: reflect: call of reflect.Value.IsZero on zero Value
goroutine 290 [running]:
net/http.(*conn).serve.func1()
	/opt/homebrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:1850 +0xb0
panic({0x1072a7de0, 0x1400055d878})
	/opt/homebrew/Cellar/go/1.19.1/libexec/src/runtime/panic.go:890 +0x258
reflect.Value.IsZero({0x0?, 0x0?, 0x140005ff7c0?})
	/opt/homebrew/Cellar/go/1.19.1/libexec/src/reflect/value.go:1602 +0x488
github.com/grafana/agent/pkg/river/encoding.(*attributeField).convertAttribute(0x140005ff7c0, {{0x0?, 0x0?, 0x140013c8fd8?}, 0x10?}, {{0x14000b7c610, 0x1, 0x1}, {0x140013c8fd8, 0x1, ...}, ...})
	/Users/robert/dev/grafana/agent/pkg/river/encoding/attribute.go:46 +0xe8
github.com/grafana/agent/pkg/river/encoding.newAttribute(...)
	/Users/robert/dev/grafana/agent/pkg/river/encoding/attribute.go:20
github.com/grafana/agent/pkg/river/encoding.getFieldsForBlock({0x107c44300?, 0x14000fd3000?})
	/Users/robert/dev/grafana/agent/pkg/river/encoding/block.go:97 +0x348
github.com/grafana/agent/pkg/river/encoding.(*blockField).convertBlock(0x140009763f0, {0x107c44300?, 0x14000fd3000?, 0x140013c8d40?}, {{0x1400087f710, 0x1, 0x1}, {0x140013c8d40, 0x1, 0x1}, ...})
	/Users/robert/dev/grafana/agent/pkg/river/encoding/block.go:47 +0x18c
github.com/grafana/agent/pkg/river/encoding.newBlock(...)
	/Users/robert/dev/grafana/agent/pkg/river/encoding/block.go:22
github.com/grafana/agent/pkg/river/encoding.getFieldsForBlock({0x107abc5a0?, 0x14000fd2fc0?})
	/Users/robert/dev/grafana/agent/pkg/river/encoding/block.go:88 +0x214
github.com/grafana/agent/pkg/river/encoding.ConvertRiverBodyToJSON({0x107abc5a0?, 0x14000fd2fc0?})
	/Users/robert/dev/grafana/agent/pkg/river/encoding/encoding.go:25 +0x28
github.com/grafana/agent/pkg/flow.(*Flow).ComponentJSON(0x0?, {0x107e70b80, 0x140013d2f30}, 0x140016701a0)
	/Users/robert/dev/grafana/agent/pkg/flow/flow_http.go:64 +0x168
github.com/grafana/agent/web/api.(*FlowAPI).json(0x14000956530, 0x140013d2d50?)
	/Users/robert/dev/grafana/agent/web/api/api.go:72 +0x50
github.com/grafana/agent/web/api.(*FlowAPI).listComponentHandler.func1({0x107eaae40, 0x1400096f500}, 0x0?)
	/Users/robert/dev/grafana/agent/web/api/api.go:55 +0xe0
net/http.HandlerFunc.ServeHTTP(0x107eb96c0?, {0x107eaae40?, 0x1400096f500?}, 0x106a5dd20?)
	/opt/homebrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:2109 +0x38
github.com/prometheus/prometheus/util/httputil.CompressionHandler.ServeHTTP({{0x107e88f60?, 0x1400001ca70?}}, {0x107eb96c0?, 0x140003ec1c0?}, 0x14002042600?)
	/Users/robert/dev/go/pkg/mod/github.com/grafana/[email protected]/util/httputil/compression.go:90 +0x6c
github.com/gorilla/mux.(*Router).ServeHTTP(0x140020409c0, {0x107eb96c0, 0x140003ec1c0}, 0x140013dae00)
	/Users/robert/dev/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:210 +0x19c
net/http.serverHandler.ServeHTTP({0x14001cfbd70?}, {0x107eb96c0, 0x140003ec1c0}, 0x140013dae00)
	/opt/homebrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:2947 +0x2c4
net/http.(*conn).serve(0x14001f68640, {0x107ebcb48, 0x140016043c0})
	/opt/homebrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:1991 +0x560
created by net/http.(*Server).Serve
	/opt/homebrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:3102 +0x444
@rfratto rfratto added bug Something isn't working area/signals labels Oct 13, 2022
@rfratto rfratto added this to the v0.29.0 milestone Oct 13, 2022
@mattdurham mattdurham self-assigned this Oct 13, 2022
@mattdurham mattdurham moved this from Todo to In Progress in Grafana Agent (Public) Oct 18, 2022
@rfratto rfratto assigned rfratto and unassigned mattdurham Oct 26, 2022
rfratto added a commit to rfratto/agent that referenced this issue Oct 26, 2022
… empty objects

This change is similar to the change introduced in grafana#2369, where calling
the `Interface()` method on River values forced a type change from an
interface-based capsule to an any-type capsule.

The new `value.FromRaw` method allows constructing a River value from a
reflect.Value directly, avoiding the need to convert to interface{}.

As part of this change, a `!reflect.Value.IsZero()` check has been added
for safety; this shouldn't happen in most circumstances unless a
value.Null is trying to be encoded.

Fixes grafana#2361.
rfratto added a commit that referenced this issue Oct 27, 2022
… empty objects (#2437)

This change is similar to the change introduced in #2369, where calling
the `Interface()` method on River values forced a type change from an
interface-based capsule to an any-type capsule.

The new `value.FromRaw` method allows constructing a River value from a
reflect.Value directly, avoiding the need to convert to interface{}.

As part of this change, a `!reflect.Value.IsZero()` check has been added
for safety; this shouldn't happen in most circumstances unless a
value.Null is trying to be encoded.

Fixes #2361.
Repository owner moved this from In Progress to Done in Grafana Agent (Public) Oct 27, 2022
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants