K9s: Logs are not shown for not running containers

Created on 24 Mar 2020  ·  5Comments  ·  Source: derailed/k9s






Describe the bug
Unable to see logs for Completed or Error or CrashLoopBackOff containers.
Checking the same container with kubectl show the logs correctly.
Tried the previous logs option on CrashLoopBackOff containers, but that does not work either.

To Reproduce
Steps to reproduce the behavior:

  1. Go to pod view and select a pod with multiple containers, one of them has to be in a not running state
  2. Open containers view
  3. Select the not running pod and press l and maybe press 0 to show all logs
  4. "no logs found for container ..." error

Logs, first showed the last 30m, that's my default, then pressed 0 to show all logs:

11:57AM INF 🐶 K9s starting up...
11:57AM DBG DEMO MODE (*bool)(0xc000333420)
11:57AM DBG Active Context "dlv-sbx-cluster-eks-51cea26"
11:57AM DBG Setting active ns "sbx"
11:57AM DBG Connecting to API Server https://****.sk1.eu-west-1.eks.amazonaws.com
11:57AM INF ✅ Kubernetes connectivity
11:57AM DBG [Config] Saving configuration...
11:57AM DBG Loading raw config from flags...
11:57AM INF No context specific skin file found -- /home/ncsibra/.k9s/dlv-sbx-cluster-eks-51cea26_skin.yml
11:57AM INF No skin file found -- /home/ncsibra/.k9s/skin.yml. Loading stock skins.
11:57AM DBG Factory START with ns `"sbx"
11:57AM DBG Failed to load preferred resources error="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server could not find the requested resource"
11:57AM DBG CustomView watching `/home/ncsibra/.k9s/views.yml
11:57AM DBG Setting active ns "sbx"
11:57AM DBG [Config] Saving configuration...
11:57AM DBG Failed to load preferred resources error="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server could not find the requested resource"
11:57AM DBG Model canceled -- "v1/pods"
11:57AM DBG Failed to load preferred resources error="unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server could not find the requested resource"
11:57AM DBG Model canceled -- "containers"
11:57AM DBG CONTAINER-LOGS
11:57AM DBG TAIL-LOGS for "sbx/elastic-indexer-server-77bf5d8c6-cf2s4":"elastic-indexer-server-bootstrap"
11:57AM ERR Tail logs failed error="no logs found for container elastic-indexer-server-bootstrap on sbx/elastic-indexer-server-77bf5d8c6-cf2s4"
11:57AM ERR Tail logs failed! error="no logs found for container elastic-indexer-server-bootstrap on sbx/elastic-indexer-server-77bf5d8c6-cf2s4"
11:57AM DBG Closed channel detected. Bailing out...
11:57AM DBG updateLogs view bailing out!
11:57AM ERR no logs found for container elastic-indexer-server-bootstrap on sbx/elastic-indexer-server-77bf5d8c6-cf2s4
11:57AM DBG <<<< Logger STOPPED!
11:57AM DBG CONTAINER-LOGS
11:57AM DBG TAIL-LOGS for "sbx/elastic-indexer-server-77bf5d8c6-cf2s4":"elastic-indexer-server-bootstrap"
11:57AM ERR Tail logs failed error="no logs found for container elastic-indexer-server-bootstrap on sbx/elastic-indexer-server-77bf5d8c6-cf2s4"
11:57AM ERR Tail logs failed! error="no logs found for container elastic-indexer-server-bootstrap on sbx/elastic-indexer-server-77bf5d8c6-cf2s4"
11:57AM DBG updateLogs view bailing out!
11:57AM ERR no logs found for container elastic-indexer-server-bootstrap on sbx/elastic-indexer-server-77bf5d8c6-cf2s4

Versions (please complete the following information):

  • OS: Manjaro Linux
  • K9s 0.18.0
  • K8s v1.14.9-eks-502bfb
bug

Most helpful comment

We have the same pb on 0.24.2 on one of our computers, not all of them :/ the 0 helps, thanks for that!

All 5 comments

@ncsibra Thanks Norbert! Found it! will fix in the next drop.

@ncsibra Fixed v0.18.1!

@derailed Thanks, it's basically working but had a visual glitch when checking completed containers.
I just went to a pod which had two containers, opened container view, selected the completed container, show logs.
First, it showed only the stream closed message, then pressed 0 for all logs and that's when I got what you can see on the picture.
image

I am running 0.24.2 and having the same problem, when I hit 'l' it shows nothing but if I hit '0' i see logs

We have the same pb on 0.24.2 on one of our computers, not all of them :/ the 0 helps, thanks for that!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brentco picture brentco  ·  4Comments

krysopath picture krysopath  ·  3Comments

pgoodjohn picture pgoodjohn  ·  4Comments

binarycoded picture binarycoded  ·  3Comments

dalgibbard picture dalgibbard  ·  3Comments