-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[WinError 2] The system cannot find the file specified on connectedk8s\azext_connectedk8s\custom.py #26965
Comments
Thank you for opening this issue, we will look into it. |
Thank you for your feedback. This has been routed to the support team for assistance. |
@mahomedalid Thanks for reaching out to us and reporting this issue. You should set the environment variables for the kubectl.exe and your kube config file. If you are on Windows box, then add Also by default, kubectl looks for a file named config in the $HOME/.kube directory. You can specify other kubeconfig files by setting the |
Hello @navba-MSFT I am experiencing the same issue and I followed what you've shared and it does not fix the exception. I installed kubectl via chocolatey so the path is: Get-Command kubectl CommandType Name Version Source Application kubectl.exe 1.0.0.0 C:\ProgramData\chocolatey\bin\kubectl.exe I have added that to my path environment variable: $env:Path As well as I have set the KUBECONFIG environment variable: $env:KUBECONFIG I still hit the issue: This operation might take a while... Downloading kubectl client for first time. This can take few minutes... An exception has occured while saving the cluster diagnostic checks pod description in the local machine. Exception: [WinError 2] The system cannot find the file specified The required pre-checks for onboarding have succeeded. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @akashkeshari. Issue DetailsDescribe the bugWhile 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 outputThe required pre-checks for onboarding have succeeded. Expected behaviorNo errors Environment Summaryazure-cli 2.50.0 core 2.50.0 Dependencies: WindowsServer sku= 2022-datacenter-g2 Additional contextNo response
|
Adding Service team to look into this. @akashkeshari Please look into this and assist once you get a chance. Thanks in advance. |
Hello @navba-MSFT, Indeed, I can confirm @lanicolas post cause I'm having the same issue, testing azure_arc_jumpstart (AKS Edge Essentials) scenario: An exception has occurred while saving the cluster diagnostic checks pod description in the local machine. Exception: [WinError 2] The system cannot find the file specified The required pre-checks for onboarding have succeeded. |
@lanicolas I don't have access to that VM anymore but I think it was /.azure/kubectl-client @navba-MSFT @akashkeshari I do see a difference in the custom.py between
On the other hand |
Exact same issue. Setting environment variable doesn't seem to help.
Fallowing the docs from here: |
Similar issue here: Azure/azure-cli-extensions#6637 The following resolved it for me: Invoke-WebRequest -Uri https://secure.globalsign.net/cacert/Root-R1.crt -OutFile c:\globalsignR1.crt'
Import-Certificate -FilePath c:\globalsignR1.crt -CertStoreLocation Cert:\LocalMachine\Root'
# insert az command here |
For my solution, the end result was just to remove k8s altogether and then allow the installer.ps1 file to install it where it expects to have it. It seems to need to install Kubernetes every time regardless so just let it be in charge. When you consider that this is an edge iot solution that shouldn't have a lot of other applications on it I think this is a fair way to go. |
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
The text was updated successfully, but these errors were encountered: