k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Segmentation fault with `microk8s`

Open csegarragonz opened this issue 2 years ago • 2 comments




Describe the bug After updating the credentials in ~/.kube/config I can not connect to my cluster using k9s. I attach the stack trace:

$ k9s --kubeconfig ~/.kube/config
panic: runtime error: invalid memory address or nil pointer dereference                                                                                                                                                                                                   [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5eac05]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
goroutine 48 [running]:                                                                                                                                                                                                                                                        math/big.(*Int).Cmp(0x0?, 0x47e480?)                                                                                                                                                                                                                                                  
math/big/int.go:328 +0x25                                                                                                                                                                                                                                             
crypto/elliptic.Unmarshal({0x26c2a28, 0xc000834f40}, {0xc0000b9632, 0x41, 0x94e})                                                                                                                                                                                                     
crypto/elliptic/elliptic.go:400 +0x1f7                                                                                                                                                                                                                                
crypto/x509.parsePublicKey(0x3, 0xc00068f648)                                                                                                                                                                                                                                         
crypto/x509/parser.go:282 +0x805                                                                                                                                                                                                                                      
crypto/x509.parseCertificate({0xc0000b950b, 0x56b, 0xa75})                                                                                                                                                                                                                            
crypto/x509/parser.go:935 +0x8b2                                                                                                                                                                                                                                      
crypto/x509.ParseCertificate({0xc0000b950b?, 0x56b, 0x382f981b9b39ad90?})                                                                                                                                                                                                             
crypto/x509/parser.go:990 +0x25                                                                                                                                                                                                                                       
crypto/tls.(*Conn).verifyServerCertificate(0xc000b0c380, {0xc000528480, 0x2, 0x2})                                                                                                                                                                                                    
crypto/tls/handshake_client.go:849 +0xaf                                                                                                                                                                                                                              
crypto/tls.(*clientHandshakeStateTLS13).readServerCertificate(0xc00068fd98)                                                                                                                                                                                                           
crypto/tls/handshake_client_tls13.go:457 +0x2d1                                                                                                                                                                                                                       
crypto/tls.(*clientHandshakeStateTLS13).handshake(0xc00068fd98)                                                                                                                                                                                                                       
crypto/tls/handshake_client_tls13.go:87 +0x1d9                                                                                                                                                                                                                        
crypto/tls.(*Conn).clientHandshake(0xc000b0c380, {0x26bd5f0, 0xc000834ec0})                                                                                                                                                                                                           
crypto/tls/handshake_client.go:219 +0x578                                                                                                                                                                                                                             
crypto/tls.(*Conn).handshakeContext(0xc000b0c380, {0x26bd660, 0xc0003e85a0})                                                                                                                                                                                                          
crypto/tls/conn.go:1452 +0x3d1                                                                                                                                                                                                                                        
crypto/tls.(*Conn).HandshakeContext(...)                                                                                                                                                                                                                                              
crypto/tls/conn.go:1402                                                                                                                                                                                                                                               
net/http.(*persistConn).addTLS.func2()                                                                                                                                                                                                                                                
net/http/transport.go:1537 +0x71                                                                                                                                                                                                                                      
created by net/http.(*persistConn).addTLS                                                                                                                                                                                                                                             
net/http/transport.go:1533 +0x345 

Versions (please complete the following information):

  • OS: Ubuntu 20.04
  • K9s: 0.25.21
  • K8s: 1.24.2

Additional context I am running on a microk8s cluster behind a corporate proxy. k9s was working fine before I re-generated the config file (new cluster).

csegarragonz avatar Jul 21 '22 15:07 csegarragonz

PS: re-installing k9s does temporarily fix the issue, but I guess my comment still applies.

csegarragonz avatar Jul 22 '22 07:07 csegarragonz

@csegarragonz thanks for your trace. But it's hard to realize the real problem, because all trace from go standard library, and without your config I can't reproduce. Please add more context if it happens again. Thanks!

slimus avatar Jul 24 '22 16:07 slimus

Just happened to come across this. I've installed microk8s on bare-metal (debian 10.13) and everything works as expected, except k9s. Kubectl runs fine, while k9s throws 'Segmentation fault'. I installed k9s via brew. Reinstalling did not help. Any ideas what could cause this?

spuxx-dev avatar Apr 24 '23 14:04 spuxx-dev

@spuxx1701 can you please share the trace with us? And your versions (k8s, k9s). Thanks!

slimus avatar Jun 05 '23 18:06 slimus

Hey @slimus ! I'm sorry, it's been a month and I probably got k9s running soon after, but I don't remember what I did to fix it. 😅

spuxx-dev avatar Jun 05 '23 21:06 spuxx-dev

I'm going to close this issue. Please feel free and create a new one again :)

slimus avatar Jun 06 '23 21:06 slimus