Azure / Azure/azure-cli

[WinError 2] The system cannot find the file specified on connectedk8s\azext_connectedk8s\custom.py

Open
#26,965 12 comments 3 reactions 0 assignees View on GitHub
bug Connected Kubernetes needs-team-attention Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

While following the tutorial https://azurearcjumpstart.io/azure_arc_jumpstart/azure_arc_k8s/aks_hybrid/aks_edge_essentials_single/ we got the error " [WinError 2] The system cannot find the file specified " File "C:\Users\akseeadmin\.azure\cliextensions\connectedk8s\azext_connectedk8s\custom.py", line 2434

After some troubleshooting we found out the extension was looking for the kubectl client in a folder inside .azure/cliextensions/connectedk8s/kubectl_client but kubectl was not there, but in other location installed by chocolatey. The helm binary on the other hand was there, so my wild guess is that kubectl was not downloaded because it was already detecte, but when trying to use it, the extension accessed the wrong location.

### Related command

.azure\cliextensions\connectedk8s\azext_connectedk8s\custom.py

### Errors

"[WinError 2] The system cannot find the file specified " File "C:\Users\akseeadmin\.azure\cliextensions\connectedk8s\azext_connectedk8s\custom.py", line 2434

### Issue script & Debug output

The required pre-checks for onboarding have succeeded.
The command failed with an unexpected error. Here is the traceback:
[WinError 2] The system cannot find the file specified
Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line
663, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line
726, in _run_jobs_serially
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line
697, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line
333, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.p
y", line 121, in handler
File "C:\Users\akseeadmin\.azure\cliextensions\connectedk8s\azext_connectedk8s\custom.py", line 336, in create_connect
edk8s
crd_cleanup_force_delete(kubectl_client_location, kube_config, kube_context)
File "C:\Users\akseeadmin\.azure\cliextensions\connectedk8s\azext_connectedk8s\custom.py", line 2434, in crd_cleanup_f
orce_delete
response_helm_delete = Popen(cmd_helm_delete, stdout=PIPE, stderr=PIPE)
File "subprocess.py", line 971, in __init__
File "subprocess.py", line 1440, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

### Expected behavior

No errors

### Environment Summary

azure-cli 2.50.0

core 2.50.0
telemetry 1.0.8

Dependencies:
msal 1.22.0
azure-mgmt-resource 23.1.0b2

WindowsServer sku= 2022-datacenter-g2
Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]
AksEdge version : 1.2.414.0

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.