Describe the bug
Sometimes, when switching the cluster I get the following error
Uncaught exception:
Error: EPERM: operation not permitted, open
.../kubectl.exe

I've installed lens successfully on my windows machine and I also could successfully add clusters. I also can see cluster details, seems all fine. However sometimes, when I switch the cluster, I get the error mentioned above. After clicking ok, I can continue working
To Reproduce
Steps to reproduce the behavior:
TBD
It usually happens when I switch to another cluster, but not always
Expected behavior
I do not expect any error when switching the cluster
Screenshots
See above
Environment (please complete the following information):
Windows Server 2016Logs:
When you run the application executable from command line you will see some logging output. Please paste them here:
鈫怺31merror鈫怺39m: Failed to get a lock for 1.18.0
鈫怺31merror鈫怺39m: Lock file is already being held {"code":"ELOCKED","file":"C:\\Users\\sc146082as\\AppData\\Roaming\\Lens\\binaries\\kubectl\\1.18.0"}
鈫怺31merror鈫怺39m: Failed to get a lock for 1.18.0
鈫怺31merror鈫怺39m: Lock file is already being held {"code":"ELOCKED","file":"C:\\Users\\sc146082as\\AppData\\Roaming\\Lens\\binaries\\kubectl\\1.18.0"}
Having the same problem. It also "deletes" (0KB) the kubectl.exe after that happens.

I experienced the same issue:
Environment
Windows 7
Lens 3.5.3
I resolved it (work around) by manually downloading kubectl for the given version and placing it in the above mentioned folder before starting up Lens.
Thanks @nevalla I will check with 3.6.0
Hi, Lens update itself this morning to 3.6.0
Got this error now, on 1.18.8 kubectl.exe
Windows 10
Lens 3.6.0
Lens is not usable, trying to downgrade to 3.5.3
EDIT
Downgrade not working neither, the message dialog is less frequent but still broken :(
But workaround, manual download, works also in 3.6.0 with kubectl.exe 1.18.8
With 3.6.3 it's even worse. Getting the error every few seconds (2-10 seconds). Totally bad experience as you need to click it away ervery time.
With 3.6 you can define Download directory in preferences? Does that help? Also it's possible to disable downloading kubectl binaries and define path to your own kubectl binary.
Setting the path to my own kubectl binary works! Setting a different path, for example the desktop does not work.
Setting the path to my own kubectl binary works! Setting a different path, for example the desktop does not work.
when you defined desktop, did you see any binaries downloaded? Trying to figure out what is the actual problem here. I thought that app will release the lock on all situations, but apparently I am wrong.
when you defined desktop, did you see any binaries downloaded? Trying to figure out what is the actual problem here. I thought that app will release the lock on all situations, but apparently I am wrong.
It created the directory Desktop\binaries\1.18.8 and the kubectl.exe is just 0kb in size.
Hi, still happens in 3.6.7 on win10 :(
Are there any workarounds?
The problem is with the 0KB kubectl.exe file. Download kubectl manually from Kubernetes stores e.g. in my case https://storage.googleapis.com/kubernetes-release/release/v1.16.14/bin/windows/amd64/kubectl.exe and replace 0KB file.

This works for me!
The problem is with the 0KB
kubectl.exefile. Download kubectl manually from Kubernetes stores e.g. in my casehttps://storage.googleapis.com/kubernetes-release/release/v1.16.14/bin/windows/amd64/kubectl.exeand replace 0KB file.This works for me!
That worked also for me sometime. But not always and you need to override it way too often.
Thanks @Ghebrehiywet : it works for me, seems to be a good workaround.
Most helpful comment
The problem is with the 0KB
kubectl.exefile. Download kubectl manually from Kubernetes stores e.g. in my casehttps://storage.googleapis.com/kubernetes-release/release/v1.16.14/bin/windows/amd64/kubectl.exeand replace 0KB file.This works for me!