-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
port-forward dropping the connection for certain type of files #1368
Comments
/triage accepted |
It looks like curl is the one breaking the pipe. When I run your curl command, I get this warning and it exits with exit code 23:
curl gives you a couple of options:
When I did option 1, it works:
I did however notice that once you get the broken pipe, kubectl's port forwarding seems to get into some weird random (?) timeout state until you restart port forwarding. It just doesn't recover well from errors (and it doesn't exit either). If port forward cannot recover from an error, it should exit with a non-zero exit code, not keep running in some semi-operable state. Example output of this weird timeout state:
|
I encountered a similar problem on mac M1, where the websocket protocol was running on the forwarding port. There will be no forwarding interruption for the same service on the linux arm64 version of kubectl
|
@brianpursley I don't think it's curl alone, we noticed this happening when our web-app attempted to load a video for a background animation, so I think it has to do more with the content being returned than anything |
Sorry for not bringing any concrete evidence, but I'm experiencing the same problem while port fowarding kafka-ui, it's just doing boring rest calls under the hood. Using a mac M1 as well if that matters. |
I'm also having this issue with Apache Superset on M1 Mac. |
containerd/containerd#8418 <- there might be a fix in the pipeline for this, as per this comment |
Same here - M1 as well FWIW |
Same here for Grafana UI on Mac M1 |
seems to be an issue happening on Apple Silicon mainly |
Apple Silicon, grafana-ui, but also cockroach-ui triggers this for me. For local clusters via docker-desktop, but also remote x86 clusters. On kubernetes-cli 1.27.4 this hangs after the first problem, on 1.28.2 this seems to at least recover after such a problem. So still excessive logging, but better behavior? Do you guys consider this problem solved with that, or is the logging (see collapsed section) something you also want to fix? Logs
|
This issue happens on windows too for us. |
I have the same issue with Postgres and pgadmin4. and doing a |
Still an issue |
containerd/containerd#9875 maybe related? It seems like attempts to fix this have been ongoing. |
Not 100% sure if my issue is the same, but I have created a reproduction scenario that locks up the port forwarding every time. Both on Apple Silicon, Windows (running WSL2) and AKS (MS Azure). Full repo can be found here: https://github.com/ramondeklein/k8s-portforward-bug. |
I think @ramondeklein is also interesting as it shines more light on this problem @brianpursley in how the TCP streams seems to be the problem, but I don't see what in kubectl could have changed around the 1.20 release to have introduced this problem |
I have also encountered similar issue when running load tests on a forwarded port -
|
We are seeing a problem where
kubectl port-forward
is dropping the connection after serving a particular type of file, in this case a video, strangely enough, when we serve videos from non static files (copying a stream of bytes from MinIO for example) the pipe never breaks, file size makes no difference.I created a repo with a reproduction case at https://github.com/dvaldivia/gofileserve
Steps to reproduction
1. Deploy the app in your kubernetes cluster
2. Port Forward to this service
3. On another terminal, try to get
Spinning-Cat.mp4
You'll see how the port-forward breaks, and no request will work afterwards
if you restart the port-forward and you try to get other static files, like
hello.json
the pipe will never breakSo for this particular type of file being returned something cracks inside
kubectl port-forward
The text was updated successfully, but these errors were encountered: