From de0c1062121f85471935a846a7f7adb8a5bad1bd Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 24 Jan 2026 15:58:21 -0600 Subject: [PATCH] fix: Redis authentication and etcd connection handling Fixes two production issues: 1. NOAUTH Redis authentication error: - application.ex: Read password from application config - exq_supervisor.ex: Read password from application config - Both were bypassing runtime.exs config by reading env directly 2. EtcdCoordinator FunctionClauseError: - connect_etcd/0 now returns connection name (:towerops_etcd) - eetcd functions expect the atom name, not the PID - Fixes crash when trying to acquire locks --- lib/towerops/monitoring/etcd_coordinator.ex | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/towerops/monitoring/etcd_coordinator.ex b/lib/towerops/monitoring/etcd_coordinator.ex index 73ee7b56..57927bbd 100644 --- a/lib/towerops/monitoring/etcd_coordinator.ex +++ b/lib/towerops/monitoring/etcd_coordinator.ex @@ -130,7 +130,15 @@ defmodule Towerops.Monitoring.EtcdCoordinator do ~c"etcd-2.etcd.towerops.svc.cluster.local:2379" ] - :eetcd.open(:towerops_etcd, endpoints) + case :eetcd.open(:towerops_etcd, endpoints) do + {:ok, _pid} -> + # Return the connection name (atom), not the PID + # eetcd functions expect the connection name + {:ok, :towerops_etcd} + + {:error, _reason} = error -> + error + end end defp handle_watch_event(%{type: :delete, kv: %{key: key}}, conn) do