Linkerd2: linkerd should report the name of the pod in when portforward fails

Created on 29 Dec 2020  Â·  2Comments  Â·  Source: linkerd/linkerd2

Feature Request

What problem are you trying to solve?

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

How should the problem be solved?

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

Any alternatives you've considered?

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...

How would users interact with this feature?

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
arecli good first issue help wanted

All 2 comments

@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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

franziskagoltz picture franziskagoltz  Â·  3Comments

zaharidichev picture zaharidichev  Â·  4Comments

ihcsim picture ihcsim  Â·  4Comments

miklezzzz picture miklezzzz  Â·  3Comments

adleong picture adleong  Â·  4Comments