runtime error: invalid memory address or nil pointer dereference
- Dominant language
- Go
- Stars
- 98
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
2023/05/16 02:43:18 http: panic serving 172.64.182.254:59840: runtime error: invalid memory address or nil pointer dereference
goroutine 58308 [running]:
net/http.(*conn).serve.func1(0xc000186e60)
/usr/local/go/src/net/http/server.go:1795 +0x139
panic(0x13594c0, 0x208c260)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
bufio.(*Writer).Flush(0xc00290c3c0, 0x16a6d20, 0xc00290c3c0)
/usr/local/go/src/bufio/bufio.go:593 +0x5c
net/http.(*Request).write(0xc001908e00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/net/http/request.go:691 +0x7bb
net/http.(*Request).Write(...)
/usr/local/go/src/net/http/request.go:524
k8s.io/apimachinery/pkg/util/proxy.dial(0xc001908e00, 0x16a84c0, 0xc00027a280, 0xc0003af160, 0xc0003aefe0, 0xc000fd7a60, 0x14efb96)
/go/pkg/mod/k8s.io/apimachinery@v0.18.6/pkg/util/proxy/upgradeaware.go:428 +0x165
k8s.io/apimachinery/pkg/util/proxy.(*UpgradeAwareHandler).DialForUpgrade(0xc00335a5a0, 0xc001908e00, 0x890575e8, 0xffffffffffffffff, 0x0, 0x3e0000c002b22fa8)
/go/pkg/mod/k8s.io/apimachinery@v0.18.6/pkg/util/proxy/upgradeaware.go:399 +0x11b
k8s.io/apimachinery/pkg/util/proxy.(*UpgradeAwareHandler).tryUpgrade(0xc00335a5a0, 0x16d7f80, 0xc002af42a0, 0xc001908c00, 0x5f9f00)
/go/pkg/mod/k8s.io/apimachinery@v0.18.6/pkg/util/proxy/upgradeaware.go:280 +0x15ea
k8s.io/apimachinery/pkg/util/proxy.(*UpgradeAwareHandler).ServeHTTP(0xc00335a5a0, 0x16d7f80, 0xc002af42a0, 0xc001908c00)
/go/pkg/mod/k8s.io/apimachinery@v0.18.6/pkg/util/proxy/upgradeaware.go:189 +0x6a
kubesphere.io/tower/pkg/proxy.(*Server).ServeHTTP(0xc0006da120, 0x16d7f80, 0xc002af42a0, 0xc001908c00)
/workspace/pkg/proxy/proxy_server.go:186 +0x355
net/http.serverHandler.ServeHTTP(0xc0000288c0, 0x16d7f80, 0xc002af42a0, 0xc001908c00)
/usr/local/go/src/net/http/server.go:2831 +0xa4
net/http.(*conn).serve(0xc000186e60, 0x16dbc40, 0xc001c9af40)
/usr/local/go/src/net/http/server.go:1919 +0x875
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2957 +0x384
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x63bc15]
goroutine 82318 [running]:
crypto/tls.(*Conn).write(0xc001523180, 0xc0009ba300, 0xf3, 0x100, 0xc000460300, 0xee, 0x180)
/usr/local/go/src/crypto/tls/conn.go:915 +0x135
crypto/tls.(*Conn).writeRecordLocked(0xc001523180, 0x16, 0xc000460300, 0xee, 0x180, 0x0, 0x0, 0xc000460300)
/usr/local/go/src/crypto/tls/conn.go:964 +0x29f
crypto/tls.(*Conn).writeRecord(0xc001523180, 0xc000460316, 0xc000460300, 0xee, 0x180, 0x0, 0x0, 0x0)
/usr/local/go/src/crypto/tls/conn.go:986 +0xe2
crypto/tls.(*Conn).clientHandshake(0xc001523180, 0x0, 0x0)
/usr/local/go/src/crypto/tls/handshake_client.go:167 +0x179
crypto/tls.(*Conn).Handshake(0xc001523180, 0x0, 0x0)
/usr/local/go/src/crypto/tls/conn.go:1362 +0x12b
net/http.(*persistConn).addTLS.func2(0x0, 0xc001523180, 0x0, 0xc0005dcf00)
/usr/local/go/src/net/http/transport.go:1414 +0x42
created by net/http.(*persistConn).addTLS
/usr/local/go/src/net/http/transport.go:1410 +0x1aa
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at pkg/proxy/proxy_server.go:186 and compare the request path with the k8s.io/apimachinery proxy frames in the stack trace. Investigate the reported Go net/http and crypto/tls nil-pointer panics and determine whether they can be reproduced. Done means the cause is identified and the proxy no longer produces this panic, with supporting verification recorded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100