Skip to content
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

While creating tunnel using az cli, getting below error #30821

Open
sunilangane74 opened this issue Feb 13, 2025 · 6 comments
Open

While creating tunnel using az cli, getting below error #30821

sunilangane74 opened this issue Feb 13, 2025 · 6 comments
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Network - Bastion Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue

Comments

@sunilangane74
Copy link

Describe the bug

az network bastion tunnel --name vnet-adec-access-bastion --resource-group rg-adec-access --target-resource-id /subscriptions/025a356c-1868-4a48-90ef-47f999a99c53/resourceGroups/rg-adec-opslab/providers/Microsoft.Compute/virtualMachines/vm-adec-ops-t01 --resource-port 22 --port 22
Preview version of extension is disabled by default for extension installation, enabled for modules without stable versions.
Please run 'az config set extension.dynamic_install_allow_preview=true or false' to config it specifically.
The command requires the extension bastion. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y
Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt.
The command failed with an unexpected error. Here is the traceback:
[Errno 13] Permission denied
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 666, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 336, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/custom.py", line 470, in create_bastion_tunnel
tunnel_server = _get_tunnel(cmd, bastion, bastion_endpoint, target_resource_id, resource_port, port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/custom.py", line 429, in _get_tunnel
tunnel_server = TunnelServer(cmd.cli_ctx, "localhost", port, bastion, bastion_endpoint, vm_id, resource_port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/tunnel.py", line 64, in init
self.sock.bind((self.local_addr, self.local_port))
PermissionError: [Errno 13] Permission denied
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Related command

az network bastion tunnel --name vnet-adec-access-bastion --resource-group rg-adec-access --target-resource-id /subscriptions/025a356c-1868-4a48-90ef-47f999a99c53/resourceGroups/rg-adec-opslab/providers/Microsoft.Compute/virtualMachines/vm-adec-ops-t01 --resource-port 22 --port 22

Errors

az network bastion tunnel --name vnet-adec-access-bastion --resource-group rg-adec-access --target-resource-id /subscriptions/025a356c-1868-4a48-90ef-47f999a99c53/resourceGroups/rg-adec-opslab/providers/Microsoft.Compute/virtualMachines/vm-adec-ops-t01 --resource-port 22 --port 22
Preview version of extension is disabled by default for extension installation, enabled for modules without stable versions.
Please run 'az config set extension.dynamic_install_allow_preview=true or false' to config it specifically.
The command requires the extension bastion. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y
Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt.
The command failed with an unexpected error. Here is the traceback:
[Errno 13] Permission denied
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 666, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 336, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.69.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/custom.py", line 470, in create_bastion_tunnel
tunnel_server = _get_tunnel(cmd, bastion, bastion_endpoint, target_resource_id, resource_port, port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/custom.py", line 429, in _get_tunnel
tunnel_server = TunnelServer(cmd.cli_ctx, "localhost", port, bastion, bastion_endpoint, vm_id, resource_port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sunilangane/.azure/cliextensions/bastion/azext_bastion/tunnel.py", line 64, in init
self.sock.bind((self.local_addr, self.local_port))
PermissionError: [Errno 13] Permission denied
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

az network bastion tunnel --name vnet-adec-access-bastion --resource-group rg-adec-access --target-resource-id /subscriptions/025a356c-1868-4a48-90ef-47f999a99c53/resourceGroups/rg-adec-opslab/providers/Microsoft.Compute/virtualMachines/vm-adec-ops-t01 --resource-port 22 --port 22

Expected behavior

Tunnel should create

Environment Summary

azure-cli 2.69.0

Additional context

Please help

@sunilangane74 sunilangane74 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Feb 13, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 13, 2025

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Configure az configure/config labels Feb 13, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. Network - Bastion labels Feb 13, 2025
Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Could you please let me know if you have any proxy in your corporate network? If Yes, could you try to bypass it and check if that helps? Also could you please test the same command using the Azure Cloud Shell TryIt option and check if that works?

Reference:

Powered by issue-sentinel

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @isamorris, @bastionsuppgithub.

1 similar comment
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @isamorris, @bastionsuppgithub.

@yonzhan yonzhan removed Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 13, 2025
@yonzhan yonzhan removed the Configure az configure/config label Feb 13, 2025
@sunilangane74
Copy link
Author

When tried with Azure Cloud Shell, gives below error.

sunil [ ~ ]$ az network bastion tunnel --name vnet-adec-access-bastion --resource-group rg-adec-access --target-resource-id /subscriptions/025a356c-1868-4a48-90ef-47f999a99c53/resourceGroups/rg-adec-opslab/providers/Microsoft.Compute/virtualMachines/vm-adec-ops-t01 --resource-port 22 --port 22
Preview version of extension is disabled by default for extension installation, enabled for modules without stable versions.
Please run 'az config set extension.dynamic_install_allow_preview=true or false' to config it specifically.
The command requires the extension bastion. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y
Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt.
(ResourceGroupNotFound) Resource group 'rg-adec-access' could not be found.
Code: ResourceGroupNotFound
Message: Resource group 'rg-adec-access' could not be found.
sunil [ ~ ]$

@sunilangane74
Copy link
Author

Other team members from my team are able to connect through their Windows but members who are using MacBook facing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Network - Bastion Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue
Projects
None yet
Development

No branches or pull requests

3 participants