atombender/ktail

ktail continually prints connection warnings/errors after losing network connection

schellj opened this issue · 2 comments

I usually have a terminal window open running ktail on one or more deployments/statefulsets. If I close my laptop and come back later, the terminal window will be continually printing the warnings/errors below.
The logs will resume tailing as expected if I quit ktail and run the same command that was running.

==> Warning: Error while tailing container [xxx-1:yyy]: Get https://xxx.xxx.xxx.xxx/api/v1/namespaces/default/pods/xxx-1/log?container=yyy&follow=true&sinceTime=2020-04-14T18%3A52%3A51Z&timestamps=true: http2: no cached connection was available
E0414 14:11:26.286144   59041 reflector.go:205] pkg/mod/k8s.io/client-go@v7.0.0+incompatible/tools/cache/reflector.go:99: Failed to list *v1.Pod: Get https://xxx.xxx.xxx.xxx/api/v1/namespaces/default/pods?limit=500&resourceVersion=0: http2: no cached connection was available
E0414 14:11:27.290462   59041 reflector.go:205] pkg/mod/k8s.io/client-go@v7.0.0+incompatible/tools/cache/reflector.go:99: Failed to list *v1.Pod: Get https://xxx.xxx.xxx.xxx/api/v1/namespaces/default/pods?limit=500&resourceVersion=0: http2: no cached connection was available
E0414 14:11:28.292712   59041 reflector.go:205] pkg/mod/k8s.io/client-go@v7.0.0+incompatible/tools/cache/reflector.go:99: Failed to list *v1.Pod: Get https://xxx.xxx.xxx.xxx/api/v1/namespaces/default/pods?limit=500&resourceVersion=0: http2: no cached connection was available
E0414 14:11:29.295761   59041 reflector.go:205] pkg/mod/k8s.io/client-go@v7.0.0+incompatible/tools/cache/reflector.go:99: Failed to list *v1.Pod: Get https://xxx.xxx.xxx.xxx/api/v1/namespaces/default/pods?limit=500&resourceVersion=0: http2: no cached connection was available
E0414 14:11:30.296057   59041 reflector.go:205] pkg/mod/k8s.io/client-go@v7.0.0+incompatible/tools/cache/reflector.go:99: Failed to list *v1.Pod: Get https://xxx.xxx.xxx.xxx/api/v1/namespaces/default/pods?limit=500&resourceVersion=0: http2: no cached connection was available

(Statefulset, container, and IP addresses redacted)

Unfortunately, I believe this happens internally in the Kubernetes client and isn't something that can be handled by ktail. Maybe you can try the latest release of ktail, which upgrades the client to a newer version?

@atombender thanks, updating ktail seems to have done the trick. Closing.