https://github.com/linkerd/linkerd2/issues/5423#issuecomment-750480989
Currently, when port forwarding fails, the error message reports [::1] (localhost ipv6) : + (random transient local port) as source and destination:
linkerd-data-plane
------------------
√ data plane namespace exists
√ data plane proxies are ready
E1223 16:27:11.233873 16623 portforward.go:385] error copying from local connection to remote stream: read tcp6 [::1]:63479->[::1]:63481: read: connection reset by peer
E1223 16:27:11.317924 16623 portforward.go:385] error copying from local connection to remote stream: read tcp6 [::1]:63479->[::1]:63491: read: connection reset by peer
√ data plane proxy metrics are present in Prometheus
√ data plane is up-to-date
E1223 16:27:11.405402 16623 portforward.go:385] error copying from local connection to remote stream: read tcp6 [::1]:63479->[::1]:63492: read: connection reset by peer
√ data plane and cli versions match
E1223 16:27:11.490493 16623 portforward.go:385] error copying from local connection to remote stream: read tcp6 [::1]:63479->[::1]:63493: read: connection reset by peer
What do you want to happen? Add any considered drawbacks.
https://github.com/linkerd/linkerd2/blob/main/pkg/k8s/portforward.go should report the namespace+pod name
Is there another way to solve this problem that isn't as good a solution?
I suppose one could print out each namespace+pod+port before making each connection instead of just at the error state and then force users to collate the port themselves...
If you can, explain how users will be able to use this. Maybe some sample CLI
output?
linkerd-data-plane
------------------
√ data plane namespace exists
√ data plane proxies are ready
E1223 16:27:11.233873 16623 portforward.go:385] error copying from local connection to remote stream: read tcp6 [::1]:63479->[::1]:63481 for somenamespace1/somepodname5: read: connection reset by peer
E1223 16:27:11.317924 16623 portforward.go:385] error copying from local connection to remote stream: read tcp6 [::1]:63479->[::1]:63491 for somenamespace2/somepodname6: read: connection reset by peer
√ data plane proxy metrics are present in Prometheus
√ data plane is up-to-date
E1223 16:27:11.405402 16623 portforward.go:385] error copying from local connection to remote stream: read tcp6 [::1]:63479->[::1]:63492 for somenamespace3/somepodname7: read: connection reset by peer
√ data plane and cli versions match
E1223 16:27:11.490493 16623 portforward.go:385] error copying from local connection to remote stream: read tcp6 [::1]:63479->[::1]:63493 for somenamespace4/somepodname8: read: connection reset by peer
@jsoref it looks like this error message comes from the portforward.go in client-go.
And, if I'm reading the code correctly, the error propagates up from the run function in the Linkerd k8s package.
In order to get the output, the pod name and namespace from the NewPortForward will have to be made available when the error is written.
Hi, I'm working on this :)