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

concurrent skaffold dev processes fail with RPC port conflicts #4253

Closed
matti opened this issue May 23, 2020 · 2 comments · Fixed by #4407
Closed

concurrent skaffold dev processes fail with RPC port conflicts #4253

matti opened this issue May 23, 2020 · 2 comments · Fixed by #4407
Assignees
Labels
area/cli area/dev area/eventing area/ux kind/bug Something isn't working priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@matti
Copy link
Contributor

matti commented May 23, 2020

start two skaffold dev processes concurrently:

skaffold dev -f first.yaml & 
skaffold dev -f second.yaml &
process1: WARN[0000] port 50051 for gRPC server already in use: using 50052 instead
process2: WARN[0000] port 50051 for gRPC server already in use: using 50052 instead
initializing api server: starting gRPC server: creating listener: listen tcp 127.0.0.1:50052: bind: address already in use

the other one will exit because it fails to bind.

workaround:

for yaml in first.yaml second.yaml; do
  (
    while true; do
      skaffold dev -f $yaml || true
      echo "don't give up, skaffold!"
    done
  ) &
done
@briandealwis briandealwis added area/cli area/dev area/eventing area/ux kind/bug Something isn't working priority/p3 agreed that this would be good to have, but no one is available at the moment. labels May 26, 2020
@briandealwis
Copy link
Member

@matti you can specify a port with the --rpc-port and --rpc-http-port command-line options.

We try to select a port near the default port, but there is a race condition between checking for the availability of a port vs actually binding to that port. We should probably have some retry logic that will bind to a random port via port 0 if the original attempt fails.

@dgageot dgageot self-assigned this Jun 29, 2020
dgageot added a commit to dgageot/skaffold that referenced this issue Jun 29, 2020
Fixes GoogleContainerTools#4253

Signed-off-by: David Gageot <david@gageot.net>
@mecampbellsoup
Copy link

Still experiencing this issue with v1.22.0:

(⎈ minikube:tenant-ad02d6c1b)➜  dev git:(develop) ✗ skaffold dev -f skaffold-k8s-billing.yaml
initializing api server: starting gRPC server: creating listener: listen tcp 127.0.0.1:50060: bind: address already in use
(⎈ minikube:tenant-ad02d6c1b)➜  dev git:(develop) ✗ skaffold version
v1.22.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli area/dev area/eventing area/ux kind/bug Something isn't working priority/p3 agreed that this would be good to have, but no one is available at the moment.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants