Closed jainmnsh closed 7 years ago
In case someone got stuck on this issue: workaround is to use version 2.0.18
@OlegRakovitch did you mean the version 2.0.15 as I dont see 2.0.18. I must be missing something.
@jainmnsh I am using azure-cli-python https://hub.docker.com/r/azuresdk/azure-cli-python/tags/
I've got the same problem on Windows: ERROR: [Errno 2] No such file or directory: 'C:\Users\myName/.ssh/config'
My version of azure-cli is 2.0.19
Just tried to create the folder and the error little bit changed: az : ERROR: [Errno 13] Permission denied: 'C:\Users\myName/.ssh/config'
Commands are executed under Administrator's privileges.
I got the same error with missing ssh-config on WSL with the latest azure-cli installed, but created the config manually with the Host FQDN of the master node. Now, I have the proxycommand error as in https://github.com/Azure/azure-cli/issues/4582
Worked, thanks!
@troydai , we should be able to close this as well.
I am having this issue currently when creating ACS cluster from cloud shell, azure-cli (2.0.19):
lena@Azure:~$ az acs kubernetes get-credentials --name name --resource-group group --ssh-key-file keyfile
[Errno 2] No such file or directory: '/home/lena/.ssh/config'
Any ideas? @troydai @OlegRakovitch @rjtsdl
Tried it with azire-cli 2.0.18 on my machine as well, same error.
@lenadroid could you try append --debug
to the command for more information?.
have the same error when running the command within the cloud shell. below is the output with the --debug flag on
qixiao@Azure:/$ az acs kubernetes get-credentials --resource-group=myResourceGroup2 --name=myK8sCluster --debug
Command arguments ['acs', 'kubernetes', 'get-credentials', '--resource-group=myResourceGroup2', '--name=myK8sCluster']
Current cloud config: ure/0.4.14 containerserviceclient/1.0.0 Azure-SDK-{'endpoints': {'active_directory': 'https://login.microsoftonline.com',
'active_directory_data_lake_resource_id': 'https://datalake.azure.net/',
'active_directory_graph_resource_id': 'https://graph.windows.net/',
'active_directory_resource_id': 'https://management.core.windows.net/',
'batch_resource_id': 'https://batch.core.windows.net/',
'gallery': 'https://gallery.azure.com/',
'management': 'https://management.core.windows.net/',
'resource_manager': 'https://management.azure.com/',
'sql_management': 'https://management.core.windows.net:8443/',
'vm_image_alias_doc': 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.j
son'},
'is_active': True,
'name': 'AzureCloud',
'profile': 'latest',
'suffixes': {'azure_datalake_analytics_catalog_and_job_endpoint': 'azuredatalakeanalytics.net',
'azure_datalake_store_file_system_endpoint': 'azuredatalakestore.net',
'keyvault_dns': '.vault.azure.net',
'sql_server_hostname': '.database.windows.net',
'storage_endpoint': 'core.windows.net'}}
Registered application event handler 'CommandTableParams.Loaded' at <function add_id_parameters at 0x7fb8662531e0>
Registered application event handler 'CommandTable.Loaded' at <function add_id_parameters at 0x7fb8662531e0>
Successfully loaded command table from module 'acs'.
Extensions directory: '/home/qixiao/.azure/cliextensions'
Application event 'CommandTable.Loaded' with event data {'command_table': {'acs kubernetes get-credentials': <azure.cli.core.commands.CliCommand obj
ect at 0x7fb86624aba8>}}
Application event 'CommandParser.Loaded' with event data {'parser': AzCliCommandParser(prog='az', usage=None, description=None, formatter_class=<cla
ss 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)}
Registered application event handler 'CommandParser.Parsed' at <function _handle_container_ssh_file at 0x7fb863b7b598>
Application event 'CommandTableParams.Loaded' with event data {'command_table': {'acs kubernetes get-credentials': <azure.cli.core.commands.CliComma
nd object at 0x7fb86624aba8>}} -ad0d-4283-9267-e8ce1915aec2/resourceGroups/myResoApplication event 'CommandParser.Parsing' with event data {'argv': ['acs', 'kubernetes', 'get-credentials', '--resource-group=myResourceGroup2', '--ingState": "Succeeded",\r\n "orchestratorProfilname=myK8sCluster']} eGroup2-e5ad7emgmt",\r\n "fqdn": "myk8sclust-Application event 'CommandParser.Parsed' with event data {'command': 'acs kubernetes get-credentials', 'args': Namespace(_command_package='acs', _jm "count": 3,\r\n "vmSize": "Standard_D2_v2espath_query=None, _log_verbosity_debug=False, _log_verbosity_verbose=False, _output_format='json', _parser=AzCliCommandParser(prog='az acs kubernet "linuxProfile": {\r\n "ssh": {\r\n "es get-credentials', usage=None, description='Download and install kubectl credentials from the cluster master', formatter_class=<class 'argparse.Hez3Ifh18gDvTmCctqWr3Y6E3ggpWWh/71hY82YnUooACs98OKtQlpFormatter'>, conflict_handler='error', add_help=True), _validators=[], command='acs kubernetes get-creden [...] C5b8gSU6vOU1DAidSXn4ckXzpgzAeh4kbQ2IF7mErklvpPmiY6Getting management service client client_type=ContainerServiceClient incipalProfile": {\r\n "clientId": "ff2bd83f-attempting to read file /home/qixiao/.azure/accessTokens.json as utf-8-sig n }\r\n}'
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - Authority:Performing instance discovery: https://login.microsoftonline.com/72f988bf-86f1-41af-9
1ab-2d7cd011db47
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - Authority:Performing static instance discovery
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - Authority:Authority validated via static instance discovery
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - OAuth2Client:finding with query: {"_clientId": "04b07795-8ddb-461a-bbee-02f9e1bf7b46", "userId"
: "qixwang@microsoft.com"}
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - OAuth2Client:Looking for potential cache entries:
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - OAuth2Client:{"_clientId": "04b07795-8ddb-461a-bbee-02f9e1bf7b46", "userId": "qixwang@microsoft
.com"}
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - OAuth2Client:Found 3 potential entries.
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - OAuth2Client:Resource specific token found.
adal-python : 6dc91881-ec2a-4eb9-b835-9594f7d52adf - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'+D7nd15sfgf/MNbo0vx5zNK+9wzofI
UBkYaV8nBERbw='
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/e5ad7e3e-ad0d-4283-9267-e8ce1915aec2/resourceGroups/myResourceGroup2/p
roviders/Microsoft.ContainerService/containerServices/myK8sCluster?api-version=2017-01-31 HTTP/1.1" 200 None
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/e5ad7e3e-ad0d-4283-9267-e8ce1915aec2/resourceGroups/myResourceGroup2/providers/Microsoft.ContainerService/containerServices/myK8sCluster?api-version=2017-01-31'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger : 'User-Agent': 'python/3.6.1 (Linux-4.4.0-97-generic-x86_64-with-debian-stretch-sid) requests/2.18.4 msrest/0.4.16 msrest_azure/0.4.14 containerserviceclient/1.0.0 Azure-SDK-For-Python AZURECLI/2.0.18 cloud-shell/1.0'
msrest.http_logger : 'Accept-Encoding': 'gzip, deflate'
msrest.http_logger : 'Accept': 'application/json'
msrest.http_logger : 'Connection': 'keep-alive'
msrest.http_logger : 'Authorization': '*****'
msrest.http_logger : 'x-ms-client-request-id': '4f6baf16-b25c-11e7-bcf4-0a580af47b04'
msrest.http_logger : 'CommandName': 'acs kubernetes get-credentials'
msrest.http_logger : 'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger : 'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger : 'Cache-Control': 'no-cache'
msrest.http_logger : 'Pragma': 'no-cache'
msrest.http_logger : 'Transfer-Encoding': 'chunked'
msrest.http_logger : 'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger : 'Content-Encoding': 'gzip'
msrest.http_logger : 'Expires': '-1'
msrest.http_logger : 'Vary': 'Accept-Encoding'
msrest.http_logger : 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger : 'x-ms-served-by': '05597a5a-2f25-4281-aa5b-c7af881f4c20_131454739445335693'
msrest.http_logger : 'x-ms-request-id': '291092ef-0eeb-4265-b637-a41230809c18'
msrest.http_logger : 'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger : 'x-ms-ratelimit-remaining-subscription-reads': '14979'
msrest.http_logger : 'x-ms-correlation-request-id': '9772024a-21bd-4f38-8c67-a12a1aee52d2'
msrest.http_logger : 'x-ms-routing-request-id': 'WESTUS:20171016T102520Z:9772024a-21bd-4f38-8c67-a12a1aee52d2'
msrest.http_logger : 'Date': 'Mon, 16 Oct 2017 10:25:19 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n "type": "Microsoft.ContainerService/ContainerServices",\r\n "location": "westus",\r\n "id": "/subscriptions/e5ad7e3e-ad0d-4283-9267-e8ce1915aec2/resourceGroups/myResourceGroup2/providers/Microsoft.ContainerService/containerServices/myK8sCluster",\r\n "name": "myK8sCluster",\r\n "properties": {\r\n "provisioningState": "Succeeded",\r\n "orchestratorProfile": {\r\n "orchestratorType": "Kubernetes"\r\n },\r\n "masterProfile": {\r\n "count": 1,\r\n "dnsPrefix": "myK8sClust-myResourceGroup2-e5ad7emgmt",\r\n "fqdn": "myk8sclust-myresourcegroup2-e5ad7emgmt.westus.cloudapp.azure.com"\r\n },\r\n "agentPoolProfiles": [\r\n {\r\n "name": "agentpool0",\r\n "count": 3,\r\n "vmSize": "Standard_D2_v2",\r\n "dnsPrefix": "myK8sClust-myResourceGroup2-e5ad7eagent",\r\n "fqdn": "",\r\n "osType": "Linux"\r\n }\r\n ],\r\n "linuxProfile": {\r\n "ssh": {\r\n "publicKeys": [\r\n {\r\n "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMEPGYv6ifgRBtJ1mbUhprK03ui0gKTN0yZBdZsQEBuk0s75ePd6Uz3Ifh18gDvTmCctqWr3Y6E3ggpWWh/71hY82YnUooACs98OKtQMFuiWlGTpDryWAuCRa0a/F4fAFnykYrgnddJ1a9cT6pAHuNzJBZpT66QK1mWkLW3Y6TT0iNL7rLqmkw3/68OLNfh2/BRu9sN5oM7Kgn1OT3ZoDnydudlGeCTKfLIyBMPn+coy15pVWb1RoO6faAsC5b8gSU6vOU1DAidSXn4ckXzpgzAeh4kbQ2IF7mErklvpPmiY6UdgkYzlBlsHeMnr+rahcnaYCq3N5wgsV62BnQyfpn"\r\n }\r\n ]\r\n },\r\n "adminUsername": "azureuser"\r\n },\r\n "servicePrincipalProfile": {\r\n "clientId": "ff2bd83f-68fe-4fde-be5b-b8eb563788b5"\r\n },\r\n "diagnosticsProfile": {\r\n "vmDiagnostics": {\r\n "enabled": false\r\n }\r\n }\r\n }\r\n}'
[Errno 2] No such file or directory: '/home/qixiao/.ssh/config'
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/azure/cli/main.py", line 36, in main
cmd_result = APPLICATION.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/application.py", line 212, in execute
result = expanded_arg.func(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 377, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 620, in _execute_command
reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 602, in _execute_command
result = op(client, **kwargs) if client else op(**kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 814, in k8s_get_credentials
_k8s_get_credentials_internal(name, acs_info, path, ssh_key_file)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 835, in _k8s_get_credentials_internal
'.kube/config', path_candidate, key_filename=ssh_key_file)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/acs/acs_client.py", line 63, in secure_copy
conf.parse(open(ssh_config_file))
FileNotFoundError: [Errno 2] No such file or directory: '/home/qixiao/.ssh/config'
Assuming one has installed with pip i.e.
pip install azure-cli
You can workaround by installing the last good release of the acs libraries afterwards:
pip install azure-cli-acs==2.0.16
sudo as required.
@lenadroid , can you check the acs module version? We have known the issue in acs module 2.0.17. And It should be fixed just after that.
@qx-will cloud shell is using 2.0.17, it is supposed to NOT work.
@IainColledge 's workaround is right, it give you acs module 2.0.16, which is still good.
@rjtsdl just to confirm the previous version installed was 2.0.17 which is known bad, hence the downgrade.
Waiting for 2.0.18 which hopefully has the fix ;)
Yeah, I'm also experiencing this with cloud shell :)
@IainColledge @lenadroid
Thanks for checking. The fix is already in code. I guess, it is in the next release, which is 2.0.18 acs module.
@lenadroid @qx-will
The cloud shell still contains the 2.0.18 ACS module. It will be upgraded in the coming week.
Hi, I have installed azure-cli (2.0.24) and acs (2.0.23) in Mac OS and still has this problem, any hints
My error is slightly different:IOError: [Errno 21] Is a directory: '/Users/xxx/.ssh/config'
Here is my trace back information
Traceback (most recent call last): File "/Users/ruizhang/y/lib/python2.7/site-packages/knack/cli.py", line 193, in invoke cmd_result = self.invocation.execute(args) File "/Users/ruizhang/y/lib/python2.7/site-packages/azure/cli/core/commands/init.py", line 319, in execute six.reraise(sys.exc_info()) File "/Users/ruizhang/y/lib/python2.7/site-packages/azure/cli/core/commands/init.py", line 292, in execute result = cmd(params) File "/Users/ruizhang/y/lib/python2.7/site-packages/azure/cli/core/commands/init.py", line 169, in call return super(AzCliCommand, self).call(args, *kwargs) File "/Users/ruizhang/y/lib/python2.7/site-packages/knack/commands.py", line 109, in call return self.handler(args, kwargs) File "/Users/ruizhang/y/lib/python2.7/site-packages/azure/cli/core/init.py", line 328, in default_command_handler result = op(command_args) File "/Users/ruizhang/y/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 882, in k8s_get_credentials _k8s_get_credentials_internal(name, acs_info, path, ssh_key_file) File "/Users/ruizhang/y/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 903, in _k8s_get_credentials_internal '.kube/config', path_candidate, key_filename=ssh_key_file) File "/Users/ruizhang/y/lib/python2.7/site-packages/azure/cli/command_modules/acs/acs_client.py", line 65, in secure_copy with open(ssh_config_file) as f: IOError: [Errno 21] Is a directory: '/Users/ruizhang/.ssh/config'
@zhangruiskyline , so /Users/ruizhang/.ssh/config
is really a directory?
We didn't check it is a file, we were only checking if it is a legit path.
Thanks @rjtsdl , I think I intentionally made that folder before to mitigate the same problem happened for older versions, now I have remove it and it works with latest version
@zhangruiskyline , ah, i see. I also made a PR to check if it is really a file. Happy to know you are unblocked. :)
I didn't find /Users/ruizhang/.ssh/config
but I found config.save
and just renamed it to config
and it worked
Description
I have setup kubenetes cluster in Azure using az acs command, it all worked until when I tried to connect
az acs kubernetes get-credentials --name= --resource-group
[Errno 2] No such file or directory: '/root/.ssh/config' Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/azure/cli/main.py", line 36, in main cmd_result = APPLICATION.execute(args) File "/usr/local/lib/python3.5/site-packages/azure/cli/core/application.py", line 212, in execute result = expanded_arg.func(params) File "/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/init.py", line 377, in call return self.handler(*args, *kwargs) File "/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/init.py", line 626, in _execute_command reraise(sys.exc_info()) File "/usr/local/lib/python3.5/site-packages/six.py", line 693, in reraise raise value File "/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/init.py", line 603, in _execute_command result = op(client, kwargs) if client else op(kwargs) File "/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acs/custom.py", line 814, in k8s_get_credentials _k8s_get_credentials_internal(name, acs_info, path, ssh_key_file) File "/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acs/custom.py", line 835, in _k8s_get_credentials_internal '.kube/config', path_candidate, key_filename=ssh_key_file) File "/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acs/acs_client.py", line 63, in secure_copy conf.parse(open(ssh_config_file)) FileNotFoundError: [Errno 2] No such file or directory: '/root/.ssh/config'
When I tried to use below then it shows my cluster information az acs show --resource-group --name
Environment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
i am using AZ, docker
CLI Version: What version of the CLI and modules are installed? (Use
az --version
)Answer here: ash-4.3# az --version azure-cli (2.0.18+dev)
acr (2.0.12+dev) acs (2.0.16+dev) appservice (0.1.17+dev) backup (1.0.1+dev) batch (3.1.4+dev) billing (0.1.5+dev) cdn (0.0.9+dev) cloud (2.0.8+dev) cognitiveservices (0.1.8+dev) command-modules-nspkg (2.0.1+dev) component (2.0.7+dev) configure (2.0.11+dev) consumption (0.1.5+dev) container (0.1.11+dev) core (2.0.17+dev) cosmosdb (0.1.13+dev) dla (0.0.12+dev) dls (0.0.14+dev) eventgrid (0.1.4+dev) extension (0.0.3+dev) feedback (2.0.6+dev) find (0.2.7+dev) interactive (0.3.10+dev) iot (0.1.12+dev) keyvault (2.0.11+dev) lab (0.0.11+dev) monitor (0.0.10+dev) network (2.0.15+dev) nspkg (3.0.1+dev) profile (2.0.13+dev) rdbms (0.0.7+dev) redis (0.2.9+dev) resource (2.0.15+dev) role (2.0.12+dev) servicefabric (0.0.4+dev) sql (2.0.12+dev) storage (2.0.16+dev) taskhelp (0.1.7+dev) vm (2.0.15+dev)
Python location '/usr/local/bin/python' Extensions directory '/root/.azure/cliextensions' OS Version: What OS and version are you using?
Answer here: MAC os 10.12.6 Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: bash