Skip to content

Instantly share code, notes, and snippets.

@Skarlso
Created July 31, 2022 15:11
Show Gist options
  • Save Skarlso/4379333c43a0ee684fa687ceea17a81a to your computer and use it in GitHub Desktop.
Save Skarlso/4379333c43a0ee684fa687ceea17a81a to your computer and use it in GitHub Desktop.
2022/07/31 14:56:21 http: panic serving 10.244.0.1:2734: runtime error: invalid memory address or nil pointer dereference
goroutine 1836 [running]:
net/http.(*conn).serve.func1()
/usr/local/go/src/net/http/server.go:1825 +0xbf
panic({0x2229e20, 0x3f9c090})
/usr/local/go/src/runtime/panic.go:844 +0x258
encoding/json.(*encodeState).marshal.func1()
/usr/local/go/src/encoding/json/encode.go:328 +0x6e
panic({0x2229e20, 0x3f9c090})
/usr/local/go/src/runtime/panic.go:838 +0x207
encoding/json.(*encodeState).marshal.func1()
/usr/local/go/src/encoding/json/encode.go:328 +0x6e
panic({0x2229e20, 0x3f9c090})
/usr/local/go/src/runtime/panic.go:838 +0x207
encoding/json.(*encodeState).string(0xc0011dd200, {0x0, 0xc000a87620}, 0x1)
/usr/local/go/src/encoding/json/encode.go:1035 +0x64
encoding/json.stringEncoder(0xc0011dd200, {0x2052420?, 0xc0000a2430?, 0xc0009a6330?}, {0xdb?, 0x1d?})
/usr/local/go/src/encoding/json/encode.go:647 +0x157
encoding/json.structEncoder.encode({{{0xc000b04480?, 0x0?, 0x2053860?}, 0xc000024d20?}}, 0xc0011dd200, {0x24c4440?, 0xc0000a2420?, 0x17?}, {0x0, 0x1})
/usr/local/go/src/encoding/json/encode.go:761 +0x1f4
encoding/json.arrayEncoder.encode({0x0?}, 0xc0011dd200, {0x22c1860?, 0xc00002a5e0?, 0x771609?}, {0x0?, 0x1?})
/usr/local/go/src/encoding/json/encode.go:916 +0xb5
encoding/json.sliceEncoder.encode({0xc0009a65a0?}, 0xc0011dd200, {0x22c1860?, 0xc00002a5e0?, 0xc0009a65d8?}, {0xe?, 0x0?})
/usr/local/go/src/encoding/json/encode.go:889 +0x2ca
encoding/json.structEncoder.encode({{{0xc000ad7b00?, 0x0?, 0xc000dd8790?}, 0xc000024d80?}}, 0xc0011dd200, {0x24062a0?, 0xc00002a5c0?, 0xb?}, {0x0, 0x1})
/usr/local/go/src/encoding/json/encode.go:761 +0x1f4
encoding/json.mapEncoder.encode({0xc0009a68a8?}, 0xc0011dd200, {0x21e5600?, 0xc0009c4cc0?, 0x5?}, {0x11?, 0x0?})
/usr/local/go/src/encoding/json/encode.go:814 +0x583
encoding/json.structEncoder.encode({{{0xc000b02240?, 0x2012d20?, 0x264bc44?}, 0xc000025110?}}, 0xc0011dd200, {0x232ce60?, 0xc0009c4cc0?, 0xa?}, {0x0, 0x1})
/usr/local/go/src/encoding/json/encode.go:761 +0x1f4
encoding/json.structEncoder.encode({{{0xc000b04000?, 0x18?, 0x2053860?}, 0xc0000255c0?}}, 0xc0011dd200, {0x248ee60?, 0xc0009c4cb8?, 0x9?}, {0x0, 0x1})
/usr/local/go/src/encoding/json/encode.go:761 +0x1f4
encoding/json.structEncoder.encode({{{0xc000ada900?, 0x4041f4?, 0xc0006d9d40?}, 0xc000025620?}}, 0xc0011dd200, {0x2405ca0?, 0xc0009c4a80?, 0x28?}, {0x0, 0x1})
/usr/local/go/src/encoding/json/encode.go:761 +0x1f4
encoding/json.ptrEncoder.encode({0xc0011dd200?}, 0xc0011dd200, {0x25eeb00?, 0xc0009c4a80?, 0x25eeb00?}, {0x8?, 0x6d?})
/usr/local/go/src/encoding/json/encode.go:945 +0x25e
encoding/json.(*encodeState).reflectValue(0x0?, {0x25eeb00?, 0xc0009c4a80?, 0x40d987?}, {0x78?, 0x0?})
/usr/local/go/src/encoding/json/encode.go:360 +0x78
encoding/json.(*encodeState).marshal(0xc001204570?, {0x25eeb00?, 0xc0009c4a80?}, {0xa8?, 0x4?})
/usr/local/go/src/encoding/json/encode.go:332 +0xfa
encoding/json.Marshal({0x25eeb00, 0xc0009c4a80})
/usr/local/go/src/encoding/json/encode.go:161 +0x45
k8s.io/apimachinery/pkg/runtime.RawExtension.MarshalJSON({{0x0, 0x0, 0x0}, {0x2ad0658, 0xc0009c4a80}})
/Users/skarlso/go/pkg/mod/k8s.io/[email protected]/pkg/runtime/extension.go:45 +0x56
encoding/json.addrMarshalerEncoder(0xc000cd6100, {0x2370ce0?, 0xc000bb3020?, 0xc000cd6100?}, {0xe0?, 0x7e?})
/usr/local/go/src/encoding/json/encode.go:496 +0x102
encoding/json.condAddrEncoder.encode({0x2761c08?, 0x2761c58?}, 0x7645d8?, {0x2370ce0?, 0xc000bb3020?, 0xc0006d9d10?}, {0x17?, 0x0?})
/usr/local/go/src/encoding/json/encode.go:960 +0x4a
encoding/json.arrayEncoder.encode({0x767171?}, 0xc000cd6100, {0x1fe9e80?, 0xc0013d7390?, 0x2aecb01?}, {0xe9?, 0x3d?})
/usr/local/go/src/encoding/json/encode.go:916 +0xb5
encoding/json.sliceEncoder.encode({0x2051720?}, 0xc000cd6100, {0x1fe9e80?, 0xc0013d7390?, 0x0?}, {0x13?, 0x0?})
/usr/local/go/src/encoding/json/encode.go:889 +0x2ca
encoding/json.structEncoder.encode({{{0xc000546240?, 0xc00039a800?, 0xc00110a500?}, 0xc0006741b0?}}, 0xc000cd6100, {0x2392800?, 0xc0013d7380?, 0x2500?}, {0x0, 0x1})
/usr/local/go/src/encoding/json/encode.go:761 +0x1f4
encoding/json.ptrEncoder.encode({0x2053860?}, 0xc000cd6100, {0x252ef40?, 0xc000497be8?, 0xc00110ca00?}, {0xb?, 0x0?})
/usr/local/go/src/encoding/json/encode.go:945 +0x25e
encoding/json.structEncoder.encode({{{0xc000649d40?, 0x4041f4?, 0x1f?}, 0xc000674210?}}, 0xc000cd6100, {0x23f87a0?, 0xc000497bc0?, 0x37?}, {0x0, 0x1})
/usr/local/go/src/encoding/json/encode.go:761 +0x1f4
encoding/json.ptrEncoder.encode({0xc000bb3020?}, 0xc000cd6100, {0x2595d80?, 0xc000497bc0?, 0x2595d80?}, {0x68?, 0xaa?})
/usr/local/go/src/encoding/json/encode.go:945 +0x25e
encoding/json.(*encodeState).reflectValue(0xc0009a7670?, {0x2595d80?, 0xc000497bc0?, 0xc0008e36a0?}, {0x20?, 0xdd?})
/usr/local/go/src/encoding/json/encode.go:360 +0x78
encoding/json.(*encodeState).marshal(0x16?, {0x2595d80?, 0xc000497bc0?}, {0xa0?, 0xa0?})
/usr/local/go/src/encoding/json/encode.go:332 +0xfa
encoding/json.(*Encoder).Encode(0xc0009a77d0, {0x2595d80, 0xc000497bc0})
/usr/local/go/src/encoding/json/stream.go:206 +0x7e
sigs.k8s.io/controller-runtime/pkg/webhook/conversion.(*Webhook).ServeHTTP(0x2aca5c0?, {0x7f2f334ab110?, 0xc00037e050}, 0xc000aac000)
/Users/skarlso/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/webhook/conversion/conversion.go:84 +0x32c
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerInFlight.func1({0x7f2f334ab110, 0xc00037e050}, 0x2ade800?)
/Users/skarlso/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:40 +0xd4
net/http.HandlerFunc.ServeHTTP(0x2ade848?, {0x7f2f334ab110?, 0xc00037e050?}, 0xc0008e3a38?)
/usr/local/go/src/net/http/server.go:2084 +0x2f
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1({0x2ade848?, 0xc00070c000?}, 0xc000aac000)
/Users/skarlso/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:117 +0xaa
net/http.HandlerFunc.ServeHTTP(0x3fdbf20?, {0x2ade848?, 0xc00070c000?}, 0x800?)
/usr/local/go/src/net/http/server.go:2084 +0x2f
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2({0x2ade848, 0xc00070c000}, 0xc000aac000)
/Users/skarlso/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:84 +0xbf
net/http.HandlerFunc.ServeHTTP(0x3c59007d2e?, {0x2ade848?, 0xc00070c000?}, 0xc0003e02f0?)
/usr/local/go/src/net/http/server.go:2084 +0x2f
net/http.(*ServeMux).ServeHTTP(0xc000d3e0fe?, {0x2ade848, 0xc00070c000}, 0xc000aac000)
/usr/local/go/src/net/http/server.go:2462 +0x149
net/http.serverHandler.ServeHTTP({0x2ad0108?}, {0x2ade848, 0xc00070c000}, 0xc000aac000)
/usr/local/go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc000e70000, {0x2adfe88, 0xc000704bd0})
/usr/local/go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:3071 +0x4db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment