Skip to content
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

Error logs in agent: Unable to cancel request for *exec.roundTripper #3497

Closed
anfernee opened this issue Mar 21, 2022 · 3 comments · Fixed by #3742
Closed

Error logs in agent: Unable to cancel request for *exec.roundTripper #3497

anfernee opened this issue Mar 21, 2022 · 3 comments · Fixed by #3742
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@anfernee
Copy link
Contributor

Describe the bug
antrea-agent on windows (only observed in windows, but it should be platform independent) shows a lot of error logs saying Unable to cancel request for *exec.roundTripper. It's pretty annoying, though the functionality seems not impacted. The DEBUG logs are like the following.

I0318 22:25:03.370898    9568 config.go:168] Calling handler.OnEndpointsUpdate
I0318 22:25:03.370898    9568 config.go:168] Calling handler.OnEndpointsUpdate
W0318 22:25:03.884876    9568 transport.go:260] Unable to cancel request for *exec.roundTripper
I0318 22:25:03.884876    9568 streamwatcher.go:114] Unable to decode an event from the watch stream: net/http: request canceled (Client.Timeout or context cancellation while reading body)
I0318 22:25:03.884876    9568 reflector.go:530] pkg/mod/k8s.io/client-go@v0.21.0/tools/cache/reflector.go:167: Watch close - *v1.ConfigMap total 0 items received
W0318 22:25:04.581472    9568 transport.go:260] Unable to cancel request for *exec.roundTripper
I0318 22:25:04.581472    9568 streamwatcher.go:114] Unable to decode an event from the watch stream: net/http: request canceled (Client.Timeout or context cancellation while reading body)
I0318 22:25:04.581472    9568 reflector.go:530] pkg/mod/k8s.io/client-go@v0.21.0/tools/cache/reflector.go:167: Watch close - *v1.ConfigMap total 0 items received
I0318 22:25:04.608774    9568 net_windows.go:332] IP configuration for interface antrea-gw0 does not need to change
I0318 22:25:05.377107    9568 config.go:168] Calling handler.OnEndpointsUpdate
I0318 22:25:05.377107    9568 config.go:168] Calling handler.OnEndpointsUpdate

To Reproduce
Run the agent and check the log.

Expected
No error logs

Actual behavior
There are error logs.

Versions:
Please provide the following information:

  • Antrea version (Docker image tag). v1.2.0
  • Kubernetes version (use kubectl version). If your Kubernetes components have different versions, please provide the version for all of them. v1.22.4
  • Container runtime: which runtime are you using (e.g. containerd, cri-o, docker) and which version are you using? containerd and docker
  • Linux kernel version on the Kubernetes Nodes (uname -r). n/a
  • If you chose to compile the Open vSwitch kernel module manually instead of using the kernel module built into the Linux kernel, which version of the OVS kernel module are you using? Include the output of modinfo openvswitch for the Kubernetes Nodes. n/a
@anfernee anfernee added the kind/bug Categorizes issue or PR as related to a bug. label Mar 21, 2022
@anfernee anfernee changed the title Error logs in agent: `Unable to cancel request for *exec.roundTripper Error logs in agent: Unable to cancel request for *exec.roundTripper Mar 21, 2022
@anfernee
Copy link
Contributor Author

cc @shettyg

@antoninbas
Copy link
Contributor

I did some research into this.
This is specific to users of client-go credential plugins, and in this case the exec auth plugin. @anfernee I assume that you are indeed using this plugin for client-go authentication and that you configured this plugin in the kubeconfig used by the antrea-agent?

This issue doesn't impact functionality and it was fixed in K8s v1.23: kubernetes/kubernetes#106014. The fix wasn't backported to earlier versions, so this issue will be resolved when we upgrade the client-go dependency in Antrea to v0.23 (we currently use v0.21.2).

Given that there is an open feature request (#3540) which requires us to update to client-go v0.24, and given that updating the client-go version can be a bit of a pain, I suggest that we tackle both of these at the same time, when K8s v1.24 is GA at the end of the month.

@anfernee
Copy link
Contributor Author

Thanks @antoninbas for the updates. Yes, you are right. We do use exec auth plugin for both kubelet and antrea-agent in GKE, so very likely to be the issue you described.

antoninbas added a commit to antoninbas/antrea that referenced this issue May 7, 2022
Some notable changes since v0.21:
* some apiserver library functions have a new signature and now take a
  context.Context instead of a stopCh
* TopologyKeys was removed from ServiceSpec (this required a small
  cleanup in the third-party proxy code)
* SelfLink field for K8s metadata (ListMeta / ObjectMeta) was deprecated
* k8s.io/apimachinery/util/clock was deprecated and replaced with
  k8s.io/utils/clock
* there was a small change in k8s.io/kubectl/pkg/proxy, which we use to
  implement "antctl proxy"

Fixes antrea-io#3118
Fixes antrea-io#3497
Fixes antrea-io#3584

Signed-off-by: Antonin Bas <abas@vmware.com>
antoninbas added a commit to antoninbas/antrea that referenced this issue May 7, 2022
Some notable changes since v0.21:
* some apiserver library functions have a new signature and now take a
  context.Context instead of a stopCh
* TopologyKeys was removed from ServiceSpec (this required a small
  cleanup in the third-party proxy code)
* SelfLink field for K8s metadata (ListMeta / ObjectMeta) was deprecated
* k8s.io/apimachinery/util/clock was deprecated and replaced with
  k8s.io/utils/clock
* there was a small change in k8s.io/kubectl/pkg/proxy, which we use to
  implement "antctl proxy"

Fixes antrea-io#3118
Fixes antrea-io#3497
Fixes antrea-io#3584

Signed-off-by: Antonin Bas <abas@vmware.com>
antoninbas added a commit to antoninbas/antrea that referenced this issue May 13, 2022
Some notable changes since v0.21:
* some apiserver library functions have a new signature and now take a
  context.Context instead of a stopCh
* TopologyKeys was removed from ServiceSpec (this required a small
  cleanup in the third-party proxy code)
* SelfLink field for K8s metadata (ListMeta / ObjectMeta) was deprecated
* k8s.io/apimachinery/util/clock was deprecated and replaced with
  k8s.io/utils/clock
* there was a small change in k8s.io/kubectl/pkg/proxy, which we use to
  implement "antctl proxy"

Fixes antrea-io#3118
Fixes antrea-io#3497
Fixes antrea-io#3584

Signed-off-by: Antonin Bas <abas@vmware.com>
antoninbas added a commit to antoninbas/antrea that referenced this issue May 16, 2022
Some notable changes since v0.21:
* some apiserver library functions have a new signature and now take a
  context.Context instead of a stopCh
* TopologyKeys was removed from ServiceSpec (this required a small
  cleanup in the third-party proxy code)
* SelfLink field for K8s metadata (ListMeta / ObjectMeta) was deprecated
* k8s.io/apimachinery/util/clock was deprecated and replaced with
  k8s.io/utils/clock
* there was a small change in k8s.io/kubectl/pkg/proxy, which we use to
  implement "antctl proxy"

Fixes antrea-io#3118
Fixes antrea-io#3497
Fixes antrea-io#3584

Signed-off-by: Antonin Bas <abas@vmware.com>
antoninbas added a commit to antoninbas/antrea that referenced this issue May 17, 2022
Some notable changes since v0.21:
* some apiserver library functions have a new signature and now take a
  context.Context instead of a stopCh
* TopologyKeys was removed from ServiceSpec (this required a small
  cleanup in the third-party proxy code)
* SelfLink field for K8s metadata (ListMeta / ObjectMeta) was deprecated
* k8s.io/apimachinery/util/clock was deprecated and replaced with
  k8s.io/utils/clock
* there was a small change in k8s.io/kubectl/pkg/proxy, which we use to
  implement "antctl proxy"
* additional metrics were added to the apiserver, so we needed to
  regenerate the Prometheus metrics doc

Fixes antrea-io#3118
Fixes antrea-io#3497
Fixes antrea-io#3584

Signed-off-by: Antonin Bas <abas@vmware.com>
antoninbas added a commit that referenced this issue May 17, 2022
* Upgrade K8s libraries to v0.24

Some notable changes since v0.21:
* some apiserver library functions have a new signature and now take a
  context.Context instead of a stopCh
* TopologyKeys was removed from ServiceSpec (this required a small
  cleanup in the third-party proxy code)
* SelfLink field for K8s metadata (ListMeta / ObjectMeta) was deprecated
* k8s.io/apimachinery/util/clock was deprecated and replaced with
  k8s.io/utils/clock
* there was a small change in k8s.io/kubectl/pkg/proxy, which we use to
  implement "antctl proxy"
* additional metrics were added to the apiserver, so we needed to
  regenerate the Prometheus metrics doc

Fixes #3118
Fixes #3497
Fixes #3584

Signed-off-by: Antonin Bas <abas@vmware.com>

* Fix logging after upgrading to K8s v1.24

klog flags are no longer added automatically to the command-line when
running the InitLogs() function (from k8s.io/component-base/logs). The
AddFlags() function must be called first, with the InitLogs() function
being called after flags have been parsed.

Note that K8s has deprecated klog flags as part of
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components.
When these flags are used, a deprecation warning is displayed. We need
to revisit how we do logging for Antrea components.

Signed-off-by: Antonin Bas <abas@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants