From bf30d9ec7eefc9fa12ef7a2da991432af3bb6f62 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 27 Mar 2026 17:59:47 -0500 Subject: [PATCH] fix: remove duplicate sync_connect from Phoenix.PubSub.Redis config (#198) Phoenix.PubSub.Redis 3.1.0 automatically appends sync_connect: true to the redis_opts before passing to Redix.PubSub.start_link. Our configuration was also passing sync_connect: false, creating a duplicate key that NimbleOptions rejected with a confusing error message. The error showed: NimbleOptions.ValidationError: unknown options [:sync_connect], valid options are: [..., :sync_connect, ...] This happened because sync_connect appeared twice in the keyword list, and NimbleOptions rejects duplicate keys. The fix removes our sync_connect option entirely, letting phoenix_pubsub_redis control the sync_connect behavior. This completes the phoenix_pubsub_redis 3.1.0 migration started in cd660387. Fixes production pod crash on startup. Reviewed-on: https://git.mcintire.me/graham/towerops-web/pulls/198 --- CHANGELOG.txt | 10 ++++++++++ lib/towerops/application.ex | 5 ++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1eb12268..30e09672 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,13 @@ +2026-03-27 +fix: remove duplicate sync_connect option from Phoenix.PubSub.Redis configuration + - Phoenix.PubSub.Redis 3.1.0 automatically appends sync_connect: true to redis_opts + - Our configuration also passed sync_connect: false, creating a duplicate key + - NimbleOptions rejects duplicate keys, causing ValidationError crash on startup + - Removed sync_connect from our config - let phoenix_pubsub_redis control it + - Fixes production pod crash: "unknown options [:sync_connect], valid options are: [...]" + - This completes the phoenix_pubsub_redis 3.1.0 migration started in previous commit + Files: lib/towerops/application.ex (redis_pubsub_config/0) + 2026-03-27 fix: update Phoenix.PubSub.Redis configuration for 3.1.0 compatibility - Fixed NimbleOptions.ValidationError crash on production pod startup diff --git a/lib/towerops/application.ex b/lib/towerops/application.ex index c05a076a..3380c02a 100644 --- a/lib/towerops/application.ex +++ b/lib/towerops/application.ex @@ -257,9 +257,8 @@ defmodule Towerops.Application do backoff_initial: 500, backoff_max: 30_000, # Don't exit process on disconnection - let PubSub handle it - exit_on_disconnection: false, - # Sync connect to fail fast if Redis unavailable at startup - sync_connect: false + exit_on_disconnection: false + # Note: sync_connect is automatically set to true by phoenix_pubsub_redis 3.1.0 ] # Add password if configured (read from application config set by runtime.exs)