lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.52k stars 1.47k forks source link

Can not connect to k8s cluster after version 3.1.0 #315

Closed Itoktsnhc closed 3 years ago

Itoktsnhc commented 4 years ago

Describe the bug Can not connect to k8s cluster (aks china) after version 3.1.0

Screenshots image

**Environment

Logs: When you run the application executable from command line you will see some logging output. Please paste them here:

info: Checking for update
info: Update for version 3.3.1 is not available (latest version: 3.3.1, downgrade is disallowed).
(node:23352) UnhandledPromiseRejectionWarning: Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:394:11)
    at Object.spawn (child_process.js:548:9)
    at env (C:\Users\XXXX\AppData\Local\Programs\kontena-lens\resources\app.asar\webpack:\src\main\kube-auth-proxy.ts:54:17)
    at C:\Users\XXXX\AppData\Local\Programs\kontena-lens\resources\app.asar\main.js:1:641406
    at Object.next (C:\Users\XXXX\AppData\Local\Programs\kontena-lens\resources\app.asar\main.js:1:641511)
    at a (C:\Users\XXXX\AppData\Local\Programs\kontena-lens\resources\app.asar\main.js:1:640228)
(node:23352) UnhandledPromiseRejectionWarning: Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:394:11)
    at Object.spawn (child_process.js:548:9)
    at env (C:\Users\XXXX\AppData\Local\Programs\kontena-lens\resources\app.asar\webpack:\src\main\kube-auth-proxy.ts:54:17)
    at C:\Users\XXXX\AppData\Local\Programs\kontena-lens\resources\app.asar\main.js:1:641406
    at Object.next (C:\Users\XXXX\AppData\Local\Programs\kontena-lens\resources\app.asar\main.js:1:641511)
    at a (C:\Users\XXXX\AppData\Local\Programs\kontena-lens\resources\app.asar\main.js:1:640228)
(node:23352) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23352) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23352) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:23352) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error: Failed to connect to cluster bwntest: {"name":"RequestError","message":"Error: ESOCKETTIMEDOUT","cause":{"code":"ESOCKETTIMEDOUT","connect":false},"error":{"code":"ESOCKETTIMEDOUT","connect":false},"options":{"json":true,"timeout":10000,"headers":{"host":"4a010d12-a8f4-401b-876f-68165e9a952c.localhost:49153"},"uri":"http://127.0.0.1:49153/api-kube/version","simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false}}

kubectl can connect

mokhos commented 4 years ago

I have the same issue. After the 3.1.0 I cannot connect to the cluster!

chicofranchico commented 4 years ago

I'm also on 3.3.1 but on MacOSX. It seems I cannot connect to any configuration (neither GKE, EKS or OIDC). I also get timeouts.

davydkov commented 4 years ago

I think this is the same https://github.com/lensapp/lens/issues/238 Though, apparently, the fix did not work

Itoktsnhc commented 4 years ago

3.4.0-beta.2 same issue

josephtaylor commented 4 years ago

It'd be nice if there was a way to turn off the auto-update so we could continue to use an actual working version.

alexander-kucherov commented 4 years ago

3.4.0 same problem

jakolehm commented 4 years ago

Do you all see the same error message?

(node:23352) UnhandledPromiseRejectionWarning: Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:394:11)
    at Object.spawn (child_process.js:548:9)
davydkov commented 4 years ago

I fixed issue by removing bundled kubectl and put a symlink to the kubectl from the PATH

Itoktsnhc commented 4 years ago

I fixed issue by removing bundled kubectl and put a symlink to the kubectl from the PATH

@davydkov Thanks your workaround! On windows you can close lens first and delete all files and folders in the target folder: C:\Users[username]\AppData\Roaming\Lens\binaries\kubectl . Then open lens and waiting for the kubectl auto download finish, and hit reconnect.

Nokel81 commented 3 years ago

Is this still a problem in 4.1.4?

Itoktsnhc commented 3 years ago

I haven't encountered it after I cleaned up the binary

Nokel81 commented 3 years ago

Okay thanks for the update. I think I'll close this and if someone encounters this again they can open a new issue.