dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Previous and next is not working under logs

Open johnr84 opened this issue 3 years ago • 15 comments

Installation method: Kubernetes version: 1.21.1 Dashboard version: 2.3.1 Operating system: Ubuntu 20.04.2

Steps to reproduce Deploy Deployment with colored logs:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: color
spec:
  selector:
    matchLabels:
      app: color
  template:
    metadata:
      labels:
        app: color
    spec:
      containers:
      - image: ubuntu
        name: color
        command: ["/bin/bash", "-c", 'while true; do echo -e "Meet the \e[92mcucumber!"; sleep 1; done']

Go to pod logs. Click "<" or ">" button. It will show error as "The selected container has not logged any messages yet".

Observed result image

Expected result Both the next and previous buttons shows the respective logs

johnr84 avatar Jul 01 '21 16:07 johnr84

I have tested it using provided deployment yaml and haven't encountered this issue. Are you sure you didn't check Show previous logs option?

floreks avatar Jul 02 '21 09:07 floreks

@floreks

No I didn't choose the "Show previous logs" option. I just tested the same on a kind cluster on my MAC and there it works as expected(In chrome). I am facing this problem in chrome browser on windows, I am not sure what is the reason. As mentioned, it works fine in the old dashboard version - 2.0.1 on our k8s 1.18.3 cluster.

image

johnr84 avatar Jul 02 '21 10:07 johnr84

Are there any unusual logs in the dev console? Can you also check API calls?

floreks avatar Jul 02 '21 10:07 floreks

dev console is empty, no errors or warnings.

Every second click is creating a different query:

:method: GET
:path: /api/v1/log/default/color-55bdd5665b-jpjmb/color?logFilePosition=&referenceTimestamp=2021-07-02T13:24:08.961448936+02:00&referenceLineNum=-1&offsetFrom=2500&offsetTo=2600&previous=false
:method: GET
:path: /api/v1/log/default/color-55bdd5665b-jpjmb/color?logFilePosition=&referenceTimestamp=&referenceLineNum=0&offsetFrom=0&offsetTo=100&previous=false

dano0b avatar Jul 02 '21 12:07 dano0b

And the response of this call is what you see in the log viewer?

floreks avatar Jul 02 '21 12:07 floreks

dashboard-empty-responses every second is more or less empty:

{
 "info": {
  "podName": "color-55bdd5665b-jpjmb",
  "containerName": "color",
  "initContainerName": "",
  "fromDate": "",
  "toDate": "",
  "truncated": false
 },
 "selection": {
  "referencePoint": {
   "timestamp": "",
   "lineNum": 0
  },
  "offsetFrom": 0,
  "offsetTo": 0,
  "logFilePosition": ""
 },
 "logs": []
}

the healthy one:

{
 "info": {
  "podName": "color-55bdd5665b-jpjmb",
  "containerName": "color",
  "initContainerName": "",
  "fromDate": "2021-07-02T14:46:37.200487993+02:00",
  "toDate": "2021-07-02T14:48:16.360482711+02:00",
  "truncated": false
 },
 "selection": {
  "referencePoint": {
   "timestamp": "2021-07-02T14:06:33.223579256+02:00",
   "lineNum": -1
  },
  "offsetFrom": 2400,
  "offsetTo": 2500,
  "logFilePosition": ""
 },
 "logs": [
  {
   "timestamp": "2021-07-02T14:46:37.200487993+02:00",
   "content": "Meet the \u001b[92mcucumber!"
  },
...
}

dano0b avatar Jul 02 '21 12:07 dano0b

Interesting. The parameters are missing. We have to find a way to reproduce this.

floreks avatar Jul 02 '21 13:07 floreks

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 30 '21 14:09 k8s-triage-robot

/remove-lifecycle stale

dano0b avatar Sep 30 '21 14:09 dano0b

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Dec 29 '21 15:12 k8s-triage-robot

/remove-lifecycle stale

dano0b avatar Dec 29 '21 15:12 dano0b

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Mar 29 '22 16:03 k8s-triage-robot

/lifecycle frozen

maciaszczykm avatar Mar 30 '22 08:03 maciaszczykm

/remove-lifecycle stale

ivyswen avatar Nov 03 '22 00:11 ivyswen

Installation method: kubeadm Kubernetes version: 1.24.7 Dashboard version: 2.6.1 Operating system: CentOS Linux release 7.7.1908

Same problem.

ivyswen avatar Nov 03 '22 03:11 ivyswen