txn2 / kubefwd

Bulk port forwarding Kubernetes services for local development.
https://imti.co/kubernetes-port-forwarding/
Apache License 2.0
3.79k stars 205 forks source link

Panic: index out of range #278

Open lainiwa opened 2 months ago

lainiwa commented 2 months ago

Hi! I got an unusual error today:

...
INFO[18:23:30] Port-Forward:      127.1.28.46 kafka-cluster-kafka-external-bootstrap.project-staging:9094 to pod kafka-cluster-kafka-0:9094
panic: runtime error: index out of range [116] with length 116

goroutine 494 [running]:
github.com/txn2/txeh.(*Hosts).AddHost(0x14000695950, {0x140003f8f10, 0xa}, {0x140002dec80?, 0x140005e9b48?})
 github.com/txn2/txeh@v1.3.0/txeh.go:235 +0x500
github.com/txn2/kubefwd/pkg/fwdport.(*PortForwardOpts).addHost(0x140005f5080, {0x140002dec80, 0x40})
 github.com/txn2/kubefwd/pkg/fwdport/fwdport.go:252 +0x11c
github.com/txn2/kubefwd/pkg/fwdport.(*PortForwardOpts).addHost(0x140005f5080, {0x140002dea00, 0x40})
 github.com/txn2/kubefwd/pkg/fwdport/fwdport.go:256 +0x164
github.com/txn2/kubefwd/pkg/fwdport.(*PortForwardOpts).AddHosts(0x140005f5080)
 github.com/txn2/kubefwd/pkg/fwdport/fwdport.go:306 +0x2ac
github.com/txn2/kubefwd/pkg/fwdport.(*PortForwardOpts).PortForward(0x140005f5080)
 github.com/txn2/kubefwd/pkg/fwdport/fwdport.go:160 +0x284
github.com/txn2/kubefwd/pkg/fwdservice.(*ServiceFWD).LoopPodsToForward.func1()
 github.com/txn2/kubefwd/pkg/fwdservice/fwdservice.go:333 +0x38
created by github.com/txn2/kubefwd/pkg/fwdservice.(*ServiceFWD).LoopPodsToForward
 github.com/txn2/kubefwd/pkg/fwdservice/fwdservice.go:331 +0xb14

OS:

ProductName: macOS
ProductVersion: 12.3
BuildVersion: 21E230

kubefwd version:

...
INFO[19:04:36] Version 1.22.5
INFO[19:04:36] https://github.com/txn2/kubefwd
INFO[19:04:36]
Kubefwd version: 1.22.5
https://github.com/txn2/kubefwd
ndj888 commented 1 month ago

Show u are kube.yaml and some yaml configuation .