Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

[FIXED] kubectl-tunnel cannot bind: Cannot assign requested address #20

Closed
rimusz opened this issue Oct 2, 2017 · 13 comments
Closed

[FIXED] kubectl-tunnel cannot bind: Cannot assign requested address #20

rimusz opened this issue Oct 2, 2017 · 13 comments
Assignees
Labels

Comments

@rimusz
Copy link
Contributor

rimusz commented Oct 2, 2017

make kubectl-tunnel
ssh -i .id_key -f -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o "ServerAliveInterval=120" \
	 -N -L 9000:apiserver-insecure.kubernetes.l4lb.thisdcos.directory:9000 \
	core@1.2.3.4
Warning: Permanently added '1.2.3.4' (ECDSA) to the list of known hosts.
bind: Cannot assign requested address
channel_setup_fwd_listener_tcpip: cannot listen to port: 9000
Could not request local forwarding.
@pires
Copy link
Contributor

pires commented Oct 2, 2017

Is your host TCP 9000 already bound?

@rimusz
Copy link
Contributor Author

rimusz commented Oct 2, 2017

nope, as that was running commands for the docker container

@pires
Copy link
Contributor

pires commented Oct 2, 2017

There's definitely a problem with forwarding:

bind: Address already in use channel_setup_fwd_listener: cannot listen to port: Could not request local forwarding. then someone is already listening on that port number. You won't be able to listen on that port until the other person has finished with it.

@rimusz
Copy link
Contributor Author

rimusz commented Oct 2, 2017

already destroyed the cluster, might give it a go tomorrow

@hectorj2f
Copy link

@rimusz @pires You get that error if you try to setup the tunnel when you already did it before.

@rimusz
Copy link
Contributor Author

rimusz commented Oct 2, 2017

ok, fetched the first error:

 make kubectl-tunnel
cat cluster_info.json | jq '{ssh_private_key} | .ssh_private_key' | sed 's/\\n/\n/g' | sed 's/"//g' > .id_key
chmod 400 .id_key
ssh -i .id_key -f -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o "ServerAliveInterval=120" \
	 -N -L 9000:apiserver-insecure.kubernetes.l4lb.thisdcos.directory:9000 \
	core@1.2.3.4
Warning: Permanently added '1.2.3.4' (ECDSA) to the list of known hosts.
bind: Cannot assign requested address

@pires
Copy link
Contributor

pires commented Oct 3, 2017

Ah, do you have IPv6 enabled on your machine?

@rimusz
Copy link
Contributor Author

rimusz commented Oct 3, 2017

on my Mac I have IPv6 as Link-local only set

@pires
Copy link
Contributor

pires commented Oct 3, 2017

Can you edit your Makefile and add -4 flag to the ssh command, i.e. ssh -i .id_key -4 -f -o (...) and try again?

@rimusz
Copy link
Contributor Author

rimusz commented Oct 3, 2017

-4 (IPv4) did the trick

@pires
Copy link
Contributor

pires commented Oct 3, 2017

Cool! We are working on a bug-fix release that will update the public docs and include this. I'll close when it's released.

@pires pires changed the title GCE - kubectl-tunnel cannot bind: Cannot assign requested address [FIXED] kubectl-tunnel cannot bind: Cannot assign requested address Oct 3, 2017
@pires pires added the bug label Oct 3, 2017
@pires pires self-assigned this Oct 3, 2017
@pires
Copy link
Contributor

pires commented Oct 3, 2017

The 0.2.1-1.7.7-beta release already provides updated documentation. Will still need to fix this repo. Will do it tomorrow.

@pires
Copy link
Contributor

pires commented Oct 19, 2017

Fixed in ec5ba64.

@pires pires closed this as completed Oct 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants