azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

'az aks browse' doesn't work. Error listening on port 8001

Open yantang-msft opened this issue 8 years ago • 11 comments

Describe the bug This command used to work for me, but not recently even after I restarted the machine. This is the error message:

Proxy running on http://127.0.0.1:8001/
Press CTRL+C to close the tunnel...
Unable to listen on port 8001: All listeners failed to create with the following errors: Unable to create listener: Error listen tcp4 127.0.0.1:8001: bind: An attempt was made to access a socket in a
way forbidden by its access permissions., Unable to create listener: Error listen tcp6: address [[::1]]:8001: missing port in address
error: Unable to listen on any of the requested ports: [{8001 9090}]

The 8001 port seems to be occupied by the "System" process with process id 4. But I can't kill the process or close the connection.

To Reproduce Simply run the command and it gives me the error.

Expected behavior There are other available ports among [{8001 9090}], it should choose an available port or let me specify the port to use.

Environment summary I'm using azure-cli (2.0.25) on Windows 10 Version 1709

yantang-msft avatar Jul 16 '18 23:07 yantang-msft

same problem here. would be nice to have a way to choose an alternate local port.

rigerosa avatar Jul 17 '18 20:07 rigerosa

Found a workaround, instead of az aks browse run: kubectl proxy --port 8002 then navigate to: http://127.0.0.1:8002/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/

rigerosa avatar Jul 17 '18 20:07 rigerosa

Also have the same issue.

mattmazzola avatar Jul 23 '18 17:07 mattmazzola

Might be the same issue with #6794

yugangw-msft avatar Jul 26 '18 16:07 yugangw-msft

Use "--listen-port" to specify a customized port other than the default 8001.

fangfei avatar Oct 11 '18 23:10 fangfei

It would be great if one could also override the host/ip that the browse command binds to. In some scenarios (e.g. in a docker container), it would be preferable to bind to 0.0.0.0 instead of 127.0.0.1.

alcohol avatar Nov 26 '18 08:11 alcohol

I have the same problem in my cluster

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.2", GitCommit:"cff46ab41ff0bb44d8584413b598ad8360ec1def", GitTreeState:"clean", BuildDate:"2019-01-13T23:15:13Z", GoVersion:"go1.11.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.4", GitCommit:"bf9a868e8ea3d3a8fa53cbb22f566771b3f8068b", GitTreeState:"clean", BuildDate:"2018-10-25T19:06:30Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

I have found that there was two kubernetes-dashboard pods in the cluster one of them is Not related to kubernetes-dashboard deployment, So I simply delete this pod and az aks browse back to work again.

AliYusuf95 avatar Jan 21 '19 07:01 AliYusuf95

Found a workaround, instead of az aks browse run: kubectl proxy --port 8002 then navigate to: http://127.0.0.1:8002/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/

How would I use this workaround with the Azure Cloud Shell, seeing as how this would not result in it running locally?

OmpahDev avatar Mar 14 '19 19:03 OmpahDev

Found a workaround, instead of az aks browse run: kubectl proxy --port 8002 then navigate to: http://127.0.0.1:8002/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/

How would I use this workaround with the Azure Cloud Shell, seeing as how this would not result in it running locally?

I tried but still not work with still the same permission error, what I did was on Cloud shell, I run 'kubectl proxy --port 8002'. And on my laptop, I run 'az aks browse --resource-group AKSK8ClusterRG --name K8Cluster --listen-port 8002'

wtam avatar Apr 09 '19 17:04 wtam

You can now specify the listen-port for the browse command:

az aks browse -n cluster-name -g resource-group-name --listen-port 8002

seanmck avatar Dec 14 '19 01:12 seanmck

Found a workaround, instead of az aks browse run: kubectl proxy --port 8002 then navigate to: http://127.0.0.1:8002/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/

this will not work in case you are trying from cloudshell, recommend - Use "--listen-port"

CloudA2Z-Code avatar Apr 07 '20 14:04 CloudA2Z-Code