From 358efa33858beab766cafa48e8ba1996389e52c6 Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Mon, 30 Nov 2020 17:02:10 +0100 Subject: [PATCH] fix(core): fix failing port forwards on Windows in certain scenarios Relates to #2129 --- core/src/proxy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/proxy.ts b/core/src/proxy.ts index 396ff52a34..a3d48c227a 100644 --- a/core/src/proxy.ts +++ b/core/src/proxy.ts @@ -77,7 +77,7 @@ async function createProxy(garden: Garden, log: LogEntry, service: Service, spec try { localPort = await getPort({ host: localIp, port: spec.targetPort }) } catch (err) { - if (err.errno === "EADDRNOTAVAIL") { + if (err.errno === "EADDRNOTAVAIL" || err.errno === "EADDRINUSE") { // If we're not allowed to bind to other 127.x.x.x addresses, we fall back to localhost. This will almost always // be the case on Mac, until we come up with something more clever (that doesn't require sudo). localIp = "127.0.0.1"