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

Unable to start K9s after upgrade to v0.31.0 #2442

Closed
maxsxu opened this issue Jan 9, 2024 · 15 comments
Closed

Unable to start K9s after upgrade to v0.31.0 #2442

maxsxu opened this issue Jan 9, 2024 · 15 comments
Labels
question Further information is requested

Comments

@maxsxu
Copy link

maxsxu commented Jan 9, 2024




Describe the bug

K9s panic with following errors while starting:

panic: k9s config file "/Users/test/.config/k9s/config.yaml" load failed:
Additional property fullScreenLogs is not allowed

goroutine 1 [running]:
github.com/derailed/k9s/cmd.Execute(...)
        github.com/derailed/k9s/cmd/root.go:60
main.main()
        github.com/derailed/k9s/main.go:32 +0x3c

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to K9s v0.31.0
  2. Start K9s

Historical Documents

  • The .config/k9s/config.yaml file contains following:
k9s:
  logger:
    tail: 100
    buffer: 5000
    sinceSeconds: -1
    fullScreenLogs: false
    textWrap: false
    showTime: false

Expected behavior

Able to start K9s

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: macOS
  • K9s:
    • Version: v0.31.0
    • Commit: f8397a8
    • Date: 2024-01-09T01:36:34Z
  • K8s: any

Additional context
Add any other context about the problem here.

@slimus
Copy link
Collaborator

slimus commented Jan 9, 2024

Hello @maxsxu! Fernand recorder YouTube video about this issue https://www.youtube.com/watch?v=X3444KfjguE.
But the short answer is: find your config and rename fullScreenLogs to fullScreen

@tuananh170489
Copy link

Try with sample configuration files, I'm working with them

config.yaml

k9s:
  liveViewAutoRefresh: true
  refreshRate: 2
  maxConnRetry: 5
  readOnly: false
  noExitOnCtrlC: false
  ui:
    enableMouse: false
    headless: false
    logoless: true
    crumbsless: false
    noIcons: false
    reactive: true
  shellPod:
    image: busybox:1.35.0
    namespace: default
    limits:
      cpu: 100m
      memory: 100Mi
  skipLatestRevCheck: false
  logger:
    tail: 100
    buffer: 5000
    sinceSeconds: -1
    fullScreen: false
    textWrap: false
    showTime: false
  imageScans:
    enable: false
  thresholds:
    cpu:
      critical: 90
      warn: 70
    memory:
      critical: 90
      warn: 70
  screenDumpDir: /tmp/k9s-screens
  disablePodCounting: false

views.yaml

views:
  # Charts skins...
  charts:
    bgColor: default
    defaultDialColors:
      - *purple
      - *red
    defaultChartColors:
      - *purple
      - *red
  # TableView attributes.
  table:
    fgColor: *foreground
    bgColor: *background
    # Header row styles.
    header:
      fgColor: *foreground
      bgColor: *background
      sorterColor: *cyan
  # Xray view attributes.
  xray:
    fgColor: *foreground
    bgColor: *background
    cursorColor: *current_line
    graphicColor: *purple
    showIcons: false
  # YAML info styles.
  yaml:
    keyColor: *pink
    colonColor: *purple
    valueColor: *foreground
  # Logs styles.
  logs:
    fgColor: *foreground
    bgColor: *background
    indicator:
      fgColor: *foreground
      bgColor: *purple
      toggleOnColor: *green
      toggleOffColor: *cyan

@codestation
Copy link

Note that it also panics when there is no config file:

panic: open /home/code/.config/k9s/config.yaml: no such file or directory

goroutine 1 [running]:
github.com/derailed/k9s/cmd.Execute(...)
        github.com/derailed/[email protected]/cmd/root.go:60
main.main()
        github.com/derailed/[email protected]/main.go:32 +0x3c

@derailed
Copy link
Owner

derailed commented Jan 9, 2024

@codestation Doh! Thank you!! Good catch. Will fix in the next drop.

@derailed derailed added the question Further information is requested label Jan 9, 2024
@shou333
Copy link

shou333 commented Jan 9, 2024

me too

@muicoder
Copy link
Contributor

muicoder commented Jan 9, 2024

Unable to start K9s

root@master1:~# rm -rf ~/.config/k9s/
root@master1:~# k9s version -s
Version              v0.31.1
Commit               91f0805
root@master1:~# k9s
Error: save failed. no active config detected
Usage:
  k9s [flags]
  k9s [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  info        List K9s configurations info
  version     Print version/build info

Flags:
  -A, --all-namespaces                 Launch K9s in all namespaces
      --as string                      Username to impersonate for the operation
      --as-group stringArray           Group to impersonate for the operation
      --certificate-authority string   Path to a cert file for the certificate authority
      --client-certificate string      Path to a client certificate file for TLS
      --client-key string              Path to a client key file for TLS
      --cluster string                 The name of the kubeconfig cluster to use
  -c, --command string                 Overrides the default resource to load when the application launches
      --context string                 The name of the kubeconfig context to use
      --crumbsless                     Turn K9s crumbs off
      --headless                       Turn K9s header off
  -h, --help                           help for k9s
      --insecure-skip-tls-verify       If true, the server's caCertFile will not be checked for validity
      --kubeconfig string              Path to the kubeconfig file to use for CLI requests
      --logFile string                 Specify the log file (default "/root/.local/state/k9s/k9s.log")
  -l, --logLevel string                Specify a log level (info, warn, debug, trace, error) (default "info")
      --logoless                       Turn K9s logo off
  -n, --namespace string               If present, the namespace scope for this CLI request
      --readonly                       Sets readOnly mode by overriding readOnly configuration setting
  -r, --refresh int                    Specify the default refresh rate as an integer (sec) (default 2)
      --request-timeout string         The length of time to wait before giving up on a single server request
      --screen-dump-dir string         Sets a path to a dir for a screen dumps
      --token string                   Bearer token for authentication to the API server
      --user string                    The name of the kubeconfig user to use
      --write                          Sets write mode by overriding the readOnly configuration setting

Use "k9s [command] --help" for more information about a command.

panic: save failed. no active config detected

goroutine 1 [running]:
github.com/derailed/k9s/cmd.Execute(...)
        github.com/derailed/k9s/cmd/root.go:60
main.main()
        github.com/derailed/k9s/main.go:32 +0x3c

@Slach
Copy link

Slach commented Jan 9, 2024

the same behavior for windows 10

panic: open C:\Users\USER\AppData\Local\k9s\config.yaml: The system cannot find the file specified.
goroutine 1 [running]:
github.com/derailed/k9s/cmd.Execute(...)
        github.com/derailed/k9s/cmd/root.go:60
main.main()
        github.com/derailed/k9s/main.go:32 +0x3c

I think if file not present k9s shall create default config

@Slach
Copy link

Slach commented Jan 9, 2024

If create empty config then get other error

panic: k9s config file "C:\\Users\\USER\\AppData\\Local\\k9s\\config.yaml" load failed:
Invalid type. Expected: object, given: null

goroutine 1 [running]:
github.com/derailed/k9s/cmd.Execute(...)
        github.com/derailed/k9s/cmd/root.go:60
main.main()
        github.com/derailed/k9s/main.go:32 +0x3c

i understood you try to validate configuration, but empty config file or not exists config file, then this not validation error, i think k9s shall just use default internal config

by default some releases artifact just not contains any config files and just contains k9s, README, LICENSE files

@pincher95
Copy link

pincher95 commented Jan 9, 2024

Also panic on custom shellPod configuration

k9s:
...
  shellPod:
    image: docker.io/library/alpine
    command:
      - nsenter
      - --target
      - "1"
      - --mount
      - --uts
      - --ipc
      - --net
      - --pid
      - bash
      - -l
    namespace: default
    tty: true
    limits:
      cpu: 100m
      memory: 100Mi
...

@karunsiri
Copy link

You need to add back the .thresholds key to the config file.

k9s:
  ...
  thresholds:
    cpu:
      critical: 90
      warn: 70
    memory:
      critical: 90
      warn: 70

@assices
Copy link

assices commented Jan 9, 2024

Also panic on custom shellPod configuration

k9s:
...
  shellPod:
    image: docker.io/library/alpine
    command:
      - nsenter
      - --target
      - "1"
      - --mount
      - --uts
      - --ipc
      - --net
      - --pid
      - bash
      - -l
    namespace: default
    tty: true
    limits:
      cpu: 100m
      memory: 100Mi
...

Same issue on my side

@derailed
Copy link
Owner

derailed commented Jan 9, 2024

Thank you all for your feedback on this!

@Slach I think this is fixed in v0.31.1 ie generating a default config if one is not present
@assices @pincher95 @muicoder Good catch!! That's on me

Let see if we're happier on v0.31.2...

@cbc02009
Copy link

cbc02009 commented Jan 9, 2024

getting the same issue as @Slach on v0.31.1.

panic: save failed. no active config detected

goroutine 1 [running]:
github.com/derailed/k9s/cmd.Execute(...)
        github.com/derailed/k9s/cmd/root.go:60
main.main()
        github.com/derailed/k9s/main.go:32 +0x3c

@monrax
Copy link

monrax commented Jan 9, 2024

Thank you all for your feedback on this!

@Slach I think this is fixed in v0.31.1 ie generating a default config if one is not present @assices @pincher95 @muicoder Good catch!! That's on me

Let see if we're happier on v0.31.2...

Just upgraded from v0.30.8 to v0.31.2 on macOS 14 (arm). Removing the config.yaml file makes it generate a default one and I can confirm it was happy with it. I can both start k9s and change ns without issues now. Thank you!

@derailed
Copy link
Owner

derailed commented Jan 9, 2024

@monrax Cool! Thank you for circling back! Glad to hear we're happy again.

@derailed derailed closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests