From 758aba4c2aea6484badbc917096ce878197f5728 Mon Sep 17 00:00:00 2001 From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:33:01 +0100 Subject: [PATCH] fix(mux): delete server.lock before starting server (#591) ## Summary Remove stale `~/.mux/server.lock` file before starting the mux server to prevent startup failures when a previous server didn't clean up properly. ## Changes - Added `rm -f "${HOME}/.mux/server.lock"` at the start of the `run_mux` function - Bumped version to 1.0.5 ## Testing - All Terraform tests pass - Shellcheck passes with only style warnings (unrelated to this change) --------- Co-authored-by: Atif Ali --- registry/coder/modules/mux/README.md | 12 ++++++------ registry/coder/modules/mux/run.sh | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/registry/coder/modules/mux/README.md b/registry/coder/modules/mux/README.md index 78925ed3..72dc6f78 100644 --- a/registry/coder/modules/mux/README.md +++ b/registry/coder/modules/mux/README.md @@ -14,7 +14,7 @@ Automatically install and run [mux](https://github.com/coder/mux) in a Coder wor module "mux" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/mux/coder" - version = "1.0.4" + version = "1.0.5" agent_id = coder_agent.main.id } ``` @@ -37,7 +37,7 @@ module "mux" { module "mux" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/mux/coder" - version = "1.0.4" + version = "1.0.5" agent_id = coder_agent.main.id } ``` @@ -48,7 +48,7 @@ module "mux" { module "mux" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/mux/coder" - version = "1.0.4" + version = "1.0.5" agent_id = coder_agent.main.id # Default is "latest"; set to a specific version to pin install_version = "0.4.0" @@ -61,7 +61,7 @@ module "mux" { module "mux" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/mux/coder" - version = "1.0.4" + version = "1.0.5" agent_id = coder_agent.main.id port = 8080 } @@ -75,7 +75,7 @@ Run an existing copy of mux if found, otherwise install from npm: module "mux" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/mux/coder" - version = "1.0.3" + version = "1.0.5" agent_id = coder_agent.main.id use_cached = true } @@ -89,7 +89,7 @@ Run without installing from the network (requires mux to be pre-installed): module "mux" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/mux/coder" - version = "1.0.4" + version = "1.0.5" agent_id = coder_agent.main.id install = false } diff --git a/registry/coder/modules/mux/run.sh b/registry/coder/modules/mux/run.sh index 9c4a6d8c..be759a0a 100644 --- a/registry/coder/modules/mux/run.sh +++ b/registry/coder/modules/mux/run.sh @@ -5,6 +5,9 @@ RESET='\033[0m' MUX_BINARY="${INSTALL_PREFIX}/mux" function run_mux() { + # Remove stale server lock if present + rm -f "$HOME/.mux/server.lock" + local port_value port_value="${PORT}" if [ -z "$port_value" ]; then