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

Error on macos #52

Closed
uhlhosting opened this issue Apr 9, 2020 · 14 comments · Fixed by #75
Closed

Error on macos #52

uhlhosting opened this issue Apr 9, 2020 · 14 comments · Fixed by #75
Labels
enhancement New feature or request

Comments

@uhlhosting
Copy link

Uncaught Exception: Error: Object has been destroyed at click (/Applications/kubenav.app/Contents/Resources/app.asar/index.js:20:20) at MenuItem.click (electron/js2c/browser_init.js:1501:9) at Function.executeCommand (electron/js2c/browser_init.js:1762:13)

@uhlhosting
Copy link
Author

Uncaught Exception: TypeError: Cannot read property 'clusters' of undefined at KubeConfig.loadFromString (/Applications/kubenav.app/Contents/Resources/app.asar/node_modules/@kubernetes/client-node/dist/config.js:105:56) at KubeConfig.loadFromFile (/Applications/kubenav.app/Contents/Resources/app.asar/node_modules/@kubernetes/client-node/dist/config.js:75:14) at KubeConfig.loadFromDefault (/Applications/kubenav.app/Contents/Resources/app.asar/node_modules/@kubernetes/client-node/dist/config.js:231:22) at Object.<anonymous> (/Applications/kubenav.app/Contents/Resources/app.asar/server.js:8:4) at Module._compile (internal/modules/cjs/loader.js:968:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10) at Module.load (internal/modules/cjs/loader.js:816:32) at Module._load (internal/modules/cjs/loader.js:728:14) at Module._load (electron/js2c/asar.js:717:26) at Function.Module._load (electron/js2c/asar.js:717:26)

@ricoberger
Copy link
Member

Hi and thanks for reporting. I'm not able to reproduce the error, but it looks like the structure of your Kubeconfig file is different from what kubenav expects.

kubenav will look for a Kubeconfig at ~/.kube/config. Can you share the structure of this Kubeconfig file please?

@ricoberger ricoberger added the bug Something isn't working label Apr 9, 2020
@uhlhosting
Copy link
Author

@ricoberger that file was used by minikube, i removed it and before had the namespace mannually removed from default into ... this could had made the issue.

Would be great to have the feature of https://github.com/sbstp/kubie
to detect by itself token files on ~/.kube/cluster1/config ~/.kube/cluster2/config .

example:

Configure where to look for kubernetes config files.

configs:

# Include these globs.
# Default: values listed below.
include:
    - ~/.kube/config
    - ~/.kube/*/config
    - ~/.kube/*.yml
    - ~/.kube/*.yaml
    - ~/.kube/configs/*.yml
    - ~/.kube/configs/*.yaml
    - ~/.kube/kubie/*.yml
    - ~/.kube/kubie/*.yaml

# Exclude these globs.
# Default: values listed below.
# Note: kubie's own config file is always excluded.
exclude:
    - ~/.kube/kubie.yaml
    - ~/.kube/config

@uhlhosting
Copy link
Author

Also when would you plan to add multi cluster support in desktop app, i did not seem to find a way to add more clusters.

@ricoberger
Copy link
Member

Hi @uhlhosting, thanks for the fast update.

  1. I heard for the first time from kubie this week and this would also be a really cool feature if kubenav can support it in a similar way. I will look deeper into this.
  2. kubenav supports multiple clusters in the desktop app, when all clusters are defined in the ~/.kube/config file. They feature of adding a cluster manually in the desktop app, was removed in favour of using the Kubeconfig file. I haven't figured out how to support both ways in a proper way yet.

@ricoberger ricoberger added enhancement New feature or request and removed bug Something isn't working labels Apr 13, 2020
@uhlhosting
Copy link
Author

Uncaught Exception:
Error: Object has been destroyed
    at click (/Applications/kubenav.app/Contents/Resources/app.asar/index.js:20:20)
    at MenuItem.click (electron/js2c/browser_init.js:1501:9)
    at Function.executeCommand (electron/js2c/browser_init.js:1762:13)

This one is very repeating. Once the cluster is minimized or something else can do this?

@ricoberger
Copy link
Member

Hi, the error shouldn't occur in the latest nightly build anymore: https://github.com/kubenav/kubenav/actions?query=workflow%3ABuild+event%3Aschedule

@uhlhosting
Copy link
Author

Uncaught Exception:
TypeError: Cannot read property 'clusters' of undefined
    at KubeConfig.loadFromString (/Applications/kubenav.app/Contents/Resources/app.asar/node_modules/@kubernetes/client-node/dist/config.js:105:56)
    at KubeConfig.loadFromFile (/Applications/kubenav.app/Contents/Resources/app.asar/node_modules/@kubernetes/client-node/dist/config.js:75:14)
    at KubeConfig.loadFromDefault (/Applications/kubenav.app/Contents/Resources/app.asar/node_modules/@kubernetes/client-node/dist/config.js:231:22)
    at Object.<anonymous> (/Applications/kubenav.app/Contents/Resources/app.asar/server.js:10:4)
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)

This is the last error I get, any idea what could cause this?

@uhlhosting
Copy link
Author

Just noticed the new build, already downloading it, will give a try.

@uhlhosting
Copy link
Author

I am using the latest build, the issue now is that no cluster is now visible whatsoever in my kubenav.

@uhlhosting
Copy link
Author

7:43:58 [cosmic:~/.kube] % ls cache/ config http-cache/ kube_config_cluster.yml

@ricoberger
Copy link
Member

Mh this looks good. Have you set the KUBECONFIG environment variable? I changed the logic so it should take the kubeconfig from the --kubeconfig flag, the KUBECONFIG environment variable or ~/.kube/config?

https://github.com/kubenav/kubenav/blob/master/pkg/kube/kube.go#L60

@uhlhosting
Copy link
Author

It works in the end guess the KUBECONFIG got some issues with the current .yml file, and then I moved the settings from .yml into config thus resulting in it working.

@ricoberger
Copy link
Member

Hi, since the errors on macOS should be fixed with the new architecture and the support for multiple Kubeconfig files was implemented in #75 I closed this issue.

To try out the support for multiple Kubeconfigs you can download the binaries from here: https://github.com/kubenav/kubenav/actions/runs/114060878

If you have problems with this feature feel free to reopen the issue. If you have further suggestions, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants