k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Pod logs not ending in line break are not shown

Open sralloza opened this issue 3 years ago • 2 comments




Describe the bug When viewing the logs, if the last line is not ending in a line break it doesn't appear in the logs view.

To Reproduce Steps to reproduce the behavior:

  1. Create the file test.yml with the following content:
apiVersion: v1
kind: Pod
metadata:
  name: test
spec:
  containers:
  - name: test
    image: ubuntu:22.04
    command: ["curl", "https://httpbin.org/base64/whatever"]
  1. Apply the manifest with kubectl apply -f test.yml
  2. Open the logs of the test pod in k9s
  3. Logs only shows Stream closed EOF for xxxxx/test (test). It doesn't change with other modes (tail, head, 1m, 30m, etc.)

Expected behavior

In step 4 it should log Incorrect Base64 data try: SFRUUEJJTiBpcyBhd2Vzb21l

Screenshots N/A

Versions (please complete the following information):

  • OS: macOS 12.4
  • K9s: v0.26.7
  • K8s: v1.23.12

Additional context

Executing the curl command in bash shows that there is no line break at the end of the response:

bash-5.2$ curl https://httpbin.org/base64/whatever
Incorrect Base64 data try: SFRUUEJJTiBpcyBhd2Vzb21lbash-5.2$

sralloza avatar Nov 07 '22 13:11 sralloza

Adding a new situation: When I trying to check the log from cronjob, if it only has one line of log, k9s shows nothing but a yellow sentence Stream closed EOF for xxx

WokoLiu avatar Nov 10 '23 07:11 WokoLiu

Just checked with the latest version (0.32.5), still there. I needed to update the k8s manifest, the old one didn't work anymore.

apiVersion: batch/v1
kind: Job
metadata:
  name: myjob
spec:
  ttlSecondsAfterFinished: 100
  template:
    spec:
      containers:
        - name: love
          image: curlimages/curl
          args: [curl, -s, https://httpbin.org/base64/whatever]
      restartPolicy: Never

When requesting the logs, k9s displays:

Stream closed EOF for default/myjob-jpvnc (love)

With kubectl:

$ kubectl logs myjob-jpvnc                                                                                       
Incorrect Base64 data try: SFRUUEJJTiBpcyBhd2Vzb21lāŽ                                                                            

sralloza avatar Sep 27 '24 09:09 sralloza

Have this issue on v0.40.5. When looking at pod logs from a job, if last line doesn't have line break, k9s doesn't show it.

eliduvid avatar Mar 05 '25 09:03 eliduvid

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Nov 10 '25 02:11 github-actions[bot]