kubesphere / kubesphere/tower

agent设置kubesphere-service代理本地测试服务,proxy panic

Open
#39 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
98
Forks
69
PR merge metrics
No merged PRs in 30d

Description

run agen
```bash
./bin/agent --kubeconfig ~/.kube/config --kubesphere-service http://0.0.0.0:8000 --token 13530761f40fc3161ed59316a6b3ed7b6ba44c5cca613f03d37db3fe9d903e87 --name alpha --v 4 --proxy-server http://192.168.1.31:30880
```

`http://0.0.0.0:8000`是本地的一个python文件服务 (`python3 -m http.server`)

集群pod内访问代理的80端口, proxy panic,

日志:

```
http: panic serving 10.233.124.47:41500: runtime error: invalid memory address or nil pointer dereference
goroutine 588 [running]:
net/http.(*conn).serve.func1(0xc000238280)
/usr/local/go/src/net/http/server.go:1795 +0x139
panic(0x13594c0, 0x208c260)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
k8s.io/apimachinery/pkg/util/proxy.normalizeLocation(0xc000017b88, 0x20c5d60)
/go/pkg/mod/k8s.io/apimachinery@v0.18.6/pkg/util/proxy/upgradeaware.go:168 +0x48
k8s.io/apimachinery/pkg/util/proxy.NewUpgradeAwareHandler(...)
/go/pkg/mod/k8s.io/apimachinery@v0.18.6/pkg/util/proxy/upgradeaware.go:178
kubesphere.io/tower/pkg/proxy.(*Server).ServeHTTP(0xc000337b00, 0x16d7f80, 0xc00012a700, 0xc000260c00)
/workspace/pkg/proxy/proxy_server.go:184 +0x28b
net/http.serverHandler.ServeHTTP(0xc0002aa380, 0x16d7f80, 0xc00012a700, 0xc000260c00)
/usr/local/go/src/net/http/server.go:2831 +0xa4
net/http.(*conn).serve(0xc000238280, 0x16dbc40, 0xc0000a6dc0)
/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

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the proxy panic with the provided agent command and a request from a cluster pod, then inspect pkg/proxy/proxy_server.go around line 184 and the k8s.io/apimachinery proxy call shown in the stack trace. Done means the same request completes without a nil-pointer panic and the regression is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.