devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.3k stars 361 forks source link

proxyCommands fails with two container entries #2468

Closed lizardruss closed 1 year ago

lizardruss commented 1 year ago

What happened? The following error occurred when using proxyCommands in multiple containers:

04:34:46 dev:app proxy Start selecting a single container with selector pod name: app-[REDACTED]-devspace-6cff887986-x6tcn
04:34:46 dev:app proxy Port forwarding started on: 10999 <- 10567
04:34:46 dev:app proxy Restarting because: helper error: failed opening listener type TCP on port 10567: listen tcp :10567: bind: address already in use  
04:34:46 dev:app proxy Start selecting a single container with selector pod name: app-[REDACTED]-devspace-6cff887986-x6tcn
04:34:46 dev:app proxy Helper - Streams are closed
04:34:47 debug Wait for dev to finish

What did you expect to happen instead? I expected both containers to start and have their commands proxies correctly

How can we reproduce the bug? (as minimally and precisely as possible)

My devspace.yaml:

dev:
  app:
    labelSelector:
      app.kubernetes.io/name: [REDACTED]
    containers:
      backend:
        devImage: ${BACKEND_IMAGE}
        sync:
          - path: .
            excludePaths:
              - .git/
              - .github/
              - infra/
            uploadExcludePaths:
              - node_modules
              - .devspace
        proxyCommands:
          - gitCredentials: true
      frontend:
        devImage: ${FRONTEND_IMAGE}
        sync:
          - path: .
            excludePaths:
              - .git/
              - .github/
              - infra/
            uploadExcludePaths:
              - node_modules
              - .devspace
        proxyCommands:
          - gitCredentials: true
    terminal:
      command: ./devspace_start.sh

Local Environment:

Anything else we need to know? Originally reported on slack

CodeWithBryan commented 1 year ago

I was the one that originally reported, posting here incase future input or a better repro is needed.