question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Orphaned kubectl.exe processes on Windows

See original GitHub issue

Description

For each VS Code window, the first time you open a YAML file, a bunch of kubectl processes spawn; most of them quickly exit again, but one (invoked as "C:\ProgramData\chocolatey\lib\kubernetes-cli\tools\kubernetes\client\bin\kubectl.exe" proxy --port=0") persists. In fact, it persists even after the associated VS Code window has been closed, and indeed after all vscode processes have exited.

If the VSCode windows were project windows (rather than directly opened to individual files), then additionally each kubectl process is run from the project directory of the window it was spawned from, which on Windows prevents various operations like renaming or deleting said directory until the kubectl process is killed.

Steps to reproduce:

  1. Install the Kubernetes extension in Visual Studio Code
  2. Open any YAML file
  3. Open a new window
  4. In the new window, open another YAML file
  5. Close all Visual Studio Code windows and processes
  6. Observe that two running instances of kubectl proxy --port=0 remain

Environment:

Visual Studio Code

Version: 1.46.0 (user setup) Commit: a5d1cc28bb5da32ec67e86cc50f84c67cc690321 Date: 2020-06-10T09:03:20.462Z Electron: 7.3.1 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.19041

Kubernetes Extension

1.2.1

Kubectl

Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:18:23Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.8-eks-e16311", GitCommit:"e163110a04dcb2f39c3325af96d019b4925419eb", GitTreeState:"clean", BuildDate:"2020-03-27T22:37:12Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

2reactions
SayakMukhopadhyaycommented, Sep 8, 2020

I am seeing this issue too. It has an additional side effect of locking the folders in which the kubectl is spawned which means I can’t delete it anymore. Right now, deleting all kubectl processes manually fixes these issues.

1reaction
knoxicommented, Mar 3, 2022

Same problem here. And since the process is running in the scope of the loaded workspace folder, the folder cannot be removed after closing VS Code because the process locks the folder. You need to kill the process to remove the folder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Orphaned kubectl.exe processes on Windows #769 - GitHub
Install the Kubernetes extension in Visual Studio Code; Open any YAML file; Open a new window; In the new window, open another YAML...
Read more >
Windows debugging tips - Kubernetes
My Pods are stuck at "Container Creating" or restarting over and over. Ensure that your pause image is compatible with your Windows OS...
Read more >
Git index.lock file - Azure Repos - Microsoft Learn
The index.lock file indicates to other Git processes that the repository is locked for editing. Orphaned index.lock file. Generally, if you have ...
Read more >
Killing tasks in Windows using the command line and Process ...
For those times when some insufferable running task in Windows refuses to stop, when it keeps coming back, it's time to find out...
Read more >
Finding Zombie Processes - Guy Leech's Blog - WordPress.com
There's the school of thought here that they are processes which have ... Files\sysinternals\livekd.exe' -k 'C:\Program Files (x86)\Windows ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found