headlamp-k8s / headlamp

A Kubernetes web UI that is fully-featured, user-friendly and extensible
https://headlamp.dev
Apache License 2.0
2.22k stars 156 forks source link

macOS app cannot connect to http://localhost:4466/config #112

Closed marians closed 3 years ago

marians commented 3 years ago

Description

MacOS app does not get beyond "Wait while fetching clusters..." state. Cannot connect to http://localhost:4466/config.

Impact

App seems completely dysfunctional.

Environment and steps to reproduce

  1. Set-up: macOS Big Sur v11.0.1 (20B29), Headlamp Version 0.1.0 (0.1.0)
  2. Task: Launched the App
  3. Action(s):
  4. Error: See below

Expected behavior

Expected to see some clusters, kubectl context or similar.

Additional information

Screenshots

image

image

image

joaquimrocha commented 3 years ago

Hi @marians ! Do you have a kube config with clusters/contexts set up when you started Headlamp? We may have a bug when no kube config is found locally and we'll be looking into this tomorrow. In the meanwhile if you can confirm whether you had a kube config set up in the default path before running Headlamp (or add it and restart Headlamp), it would be awesome!

Thank you for your help in advance!

marians commented 3 years ago

Yes, I have a ~/.kube/config file with lots of contexts.

joaquimrocha commented 3 years ago

We will be releasing a new version hopefully today that fixes a bug in the server start up. Hopefully this will fix your issues, but if not, I will ask you to please provide more information afterwards. Stay tuned!

joaquimrocha commented 3 years ago

Hi @marians , sorry it took us a while. We're still preparing the new release with a few bug fixes. In the meanwhile I think I may have reproduced your problem: I noticed that when we quit the application, the server is still running (ps aux|grep Headlamp). If I kill the server process, then I can reuse Headlamp again correctly.

We will obviously include a fix for this in the next release. Thanks.

Dbz commented 3 years ago

I also have this issue. I have a kube config in the same location and get the same issue while attempting to load clusters.

Dbz commented 3 years ago

Also @joaquimrocha that solution doesn't work for me. When I quit headlamp, there are no processes with headlamp or Headlamp showing when I ps.

marians commented 3 years ago

Just want to mention that the problem still persists in v0.1.3

ashu8912 commented 3 years ago

Hi @marians thanks for reporting this, I might be asking too much but can you please give a brief details on the specific steps you followed while running headlamp (also can you paste the output of ps aux|grep Headlamp). Coz we tried it on Mac OS catalina and the app seems to work fine.

marians commented 3 years ago

It really hasn't changed from the initial comment, only that I tried headlamp v0.1.3 now.

OS: macOS Big Sur 11.1 (20C69)

$ pwd
/Applications/Headlamp.app/Contents/MacOS

$ ./Headlamp --enable-logging
09:55:28.353 › App starting...
09:55:28.471 › Checking for update
09:55:28.471 › Sending status to window: Checking for update...
[75378:0107/095529.032073:INFO:CONSOLE(1)] "[object Object]", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095529.061476:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095529.061624:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095529.061866:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095529.062125:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095529.062296:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095529.085540:INFO:CONSOLE(0)] "Uncaught (in promise) TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/index.html#/ (0)
09:55:30.120 › Update for version 0.1.3 is not available (latest version: 0.1.3, downgrade is disallowed).
09:55:30.121 › Sending status to window: Update not available.
09:55:30.121 › checkForUpdatesAndNotify called, downloadPromise is null
[75378:0107/095546.776378:VERBOSE1:CONSOLE(31)] "Main._createAppUI: 23.35009765625 ms", source: devtools://devtools/bundled/main/main.js (31)
[75378:0107/095546.786152:VERBOSE1:CONSOLE(31)] "Main._showAppUI: 9.378173828125 ms", source: devtools://devtools/bundled/main/main.js (31)
[75378:0107/095546.820768:VERBOSE1:CONSOLE(31)] "Main._initializeTarget: 5.876953125 ms", source: devtools://devtools/bundled/main/main.js (31)
[75378:0107/095546.953201:VERBOSE1:CONSOLE(31)] "Main._lateInitialization: 0.56298828125 ms", source: devtools://devtools/bundled/main/main.js (31)
2021-01-07 09:55:47.086 Headlamp[75378:1640539] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x7f9f40aea1f0>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
[75378:0107/095629.079740:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095629.084842:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095629.085725:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095629.086158:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
[75378:0107/095629.086782:INFO:CONSOLE(1)] "TypeError: Failed to fetch", source: file:///Applications/Headlamp.app/Contents/Resources/app.asar/build/static/js/main.d0a4d88d.chunk.js (1)
2021-01-07 09:56:49.587 Headlamp[75378:1640539] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x7f9f3aff2b20>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
[75379:0107/095649.594547:ERROR:gles2_cmd_decoder.cc(7062)] [.RendererMainThread-0x7fc8d6063c00]GL ERROR :GL_INVALID_OPERATION : glGetIntegerv: incomplete framebuffer
[75379:0107/095649.594896:ERROR:gles2_cmd_decoder.cc(7062)] [.RendererMainThread-0x7fc8d6063c00]GL ERROR :GL_INVALID_OPERATION : glGetIntegerv: incomplete framebuffer
[75379:0107/095649.595278:ERROR:gles2_cmd_decoder.cc(7062)] [.RendererMainThread-0x7fc8d6063c00]GL ERROR :GL_INVALID_OPERATION : glGetIntegerv: incomplete framebuffer
[75379:0107/095649.595411:ERROR:gles2_cmd_decoder.cc(7062)] [.RendererMainThread-0x7fc8d6063c00]GL ERROR :GL_INVALID_OPERATION : glGetIntegerv: incomplete framebuffer
[75379:0107/095649.600886:ERROR:gles2_cmd_decoder.cc(4968)] [.RendererMainThread-0x7fc8d6063c00]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glDrawArrays: framebuffer incomplete

ps aux|grep Headlamp yields nothing, not before I start and not after I quit the app.

Screenshot

image

joaquimrocha commented 3 years ago

Thanks a lot @marians . We are currently looking into this. We'll get back to you soon.

illume commented 3 years ago

Hi @marians,

I tried, but failed so far to reproduce in Catalina and Big Sur 11.1.

Looking at the connection refused tracebacks, I wonder if you can help me with these questions?

1) is there perhaps a firewall/IDS blocking these? 2) what are the localhost details? Maybe it's some sort of ipv4/v6 related thing.

dscacheutil -q host -a name localhost
ifconfig lo0
$ dscacheutil -q host -a name localhost
name: localhost
ipv6_address: ::1
ipv6_address: fe80:1::1

name: localhost
ip_address: 127.0.0.1

$ ifconfig lo0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    nd6 options=201<PERFORMNUD,DAD>
marians commented 3 years ago

I am not aware of any firewall running.

image

$ dscacheutil -q host -a name localhost
name: localhost
ipv6_address: ::1

name: localhost
ip_address: 127.0.0.1

$ ifconfig lo0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
    inet 127.0.0.1 netmask 0xff000000
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    nd6 options=201<PERFORMNUD,DAD>
illume commented 3 years ago

Thanks @marians for the info.

We added some extra logging for the server errors in the new v0.2.0 release - so we should see the reason why the server process is not working. This release should give us nice stack traces in the dev console, rather than showing minimized js in the dev console too.

marians commented 3 years ago

Maybe the new release sheds some light on my problems.

11:21:02.761 › server process stderr: panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xd0 pc=0x16287a5]

goroutine 1 [running]:
main.GetContextsFromKubeConfigFile(0xc0000cb0e0, 0x1a, 0x169c9c0, 0xc000238dd8, 0xc000213c38, 0xc000238dd0, 0x4c000000010651b4)
    /Users/joaquim/work/headlamp/backend/cmd/kubeconfig.go:52 +0x1c5
main.StartHeadlampServer(0xc000202700)
    /Users/joaquim/work/headlamp/backend/cmd/headlamp.go:105 +0x118b
main.main()
    /Users/joaquim/work/headlamp/backend/cmd/server.go:30 +0x4d7

11:21:02.769 › server process process exited with code:2 signal:null
marians commented 3 years ago

I identified another reason that caused headlamp to exit. In my kubeconfig I had cluster entries with relative path in certificate-authority. The path was relative from my ~/.kube directory. For kubectl that seems to work, but the headlamp backend exits with this error:

*** Headlamp Server ***
  API Routers:
2021/01/19 17:15:57 Failed to add certificate:open certs/gs-gollum/k8s-ca.crt: no such file or directory

After I change this to an absolute path, the backend seems to come up.

illume commented 3 years ago

I added a relative path issue https://github.com/kinvolk/headlamp/issues/180

illume commented 3 years ago

The relative path issue was fixed and merged in #181

@marians it seems like it's working for you now :) Thanks for all your help.

Can we close this issue now, or is there something else?

marians commented 3 years ago

Sure, do what suits you. If I run into problems again (with a new release), I'll let you know.

joaquimrocha commented 3 years ago

@marians Hi, if you have the bandwidth, I'd love you to know if everything is working fine for you with the latest 0.3.0-beta now.

joaquimrocha commented 3 years ago

Let's close this as it seems to be running well on Macs now.