kubernetes: API server: spammy error logs when client closes proxied watch requests

What happened?

Our project (Calico) includes an aggregated API server. (I think) when somethin watches resources exposed by the aggregated server via the kube API server, the kube API server emits error logs every 10 minutes for each resource:

wrap.go:53] timeout or abort while handling: method=GET URI="/apis/projectcalico.org/v3/profiles?allowWatchBookmarks=true&resourceVersion=73417144%2F73417144&watch=true" audit-ID="c17b2ff6-c3a8-4698-a9b5-58b9dc6bf56a"
wrap.go:53] timeout or abort while handling: method=GET URI="/apis/projectcalico.org/v3/globalnetworksets?allowWatchBookmarks=true&resourceVersion=73417144&watch=true" audit-ID="e853832c-3508-48a7-b5a8-f3e787df9c94
wrap.go:53] timeout or abort while handling: method=GET URI="/apis/projectcalico.org/v3/hostendpoints?allowWatchBookmarks=true&resourceVersion=73417144&watch=true" audit-ID="31ef1042-a457-4510-997a-26cd306e0551"
...

Since these are watches, the client retries and the errors are benign AFAICT.

Since these are errors they tend to get picked up by log monitoring tools and need to be filtered out (or cost money in log storage).

What did you expect to happen?

No timeout errors should for watch requests. Either there’s some detail that Calico’s API server is getting wrong(?) or these should be handled/suppressed in the k8s API server.

How can we reproduce it (as minimally and precisely as possible)?

Install a cluster with Calico’s aggregated API server and watch the kube API server logs.

Anything else we need to know?

Quite possible it’s a bug on our side or mismatched expectation but I’m having a very hard time tracking down the Kubernetes code that handles these proxied requests (and it’s all very abstract so I’m finding it very hard to guess what we might need to do on our side to avoid this error).

Kubernetes version

$ kubectl version
# paste output here

Users have reported the issue on k8s 1.25 and 1.29.6

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, …) and versions (if applicable)

Calico with its API server installed.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

@thisisharrsh why reassign to sig network? Calico is a CNI but this is clearly an API server issue, not to do with networking.