Httputil: ReverseProxy read error during body copy: unexpected EOF

I have some Kubernetes clusters, all created using K0S, where most of them are very simple with one controller and a few nodes, but I have a cluster working with “high availability” where we have 3 controllers and several nodes and the cluster address is on an HA Proxy, configured on a PFSense .
In simple clusters I have no problems, but in a cluster with HA, there are usually some disconnections that usually last around 30 seconds (or less) and then connect again.
Checking the logs, at the time of disconnection, I noticed some messages like:

  • httputil: ReverseProxy read error during body copy: unexpected EOF

It probably may not be a problem with Lens Desktop, but I would like some guidance on how to resolve this issue.
Thank you in advance for any help.

What version of Lens are you using?

@phorsmalahti
Lens: 2024.5.271333-latest

@phorsmalahti or anyone else, do you need any more information or should I do something else to resolve it?

This is the exact same issue that I’m experiencing. HAProxy managed by PFSense that balances the traffic among 5 k8s API endpoints (K3S is the distro I’m using). The settings are pretty much default on the frontend, the load balancing “Balance” option is currently set to “Source” for the backend.

I noticed that the frontend uses the “http-keep-alive” value for the “Use “httpclose” option” in the Advanced settings - is Lens configured to send HTTP Keepalives to the K8S API endpoint by default?

Hi @abrindeyev. Same configuration here.

Was the question for me? If yes, i don’t know where to find this configuration.

What helped me is to adjust the server timeout in the K3S API backend settings - mine was set to a default value (30000) and when I decreased it to 5 seconds, the rate of errors increased dramatically - and I further proved it by experimenting with openssl s_client -connect test. Next, I confirmed that original K3S endpoint don’t timeout by themselves by connecting to them directly - this points all fingers to HAProxy settings.

Once I increased server timeout beyond default setting of 30 seconds I no longer experience the issue above.

Niiiice! It seems that this configuration solved my problem. I’ll check the Lens logs later, but so far I haven’t had any disconnection issues.

I set the timeout setting on the frontend to 60000ms (60s) and, just out of curiosity, what configuration did you set on yours? Did you set it on the frontend or the backend? Or both?