From 067ed37a909b9f2b4a6302c5853917e8b49b51c3 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 4 May 2026 08:29:30 -0500 Subject: [PATCH] fix(pubsub): pass VALKEY_URL as bare string to redis_opts, not [url: ...] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit phoenix_pubsub_redis 3.1's deprecation message ('Move :url inside the :redis_opts option') is misleading — wrapping the URL as `redis_opts: [url: url]` forwards the keyword list to Redix, which rejects `:url` with `unknown options [:url], valid options are: [:host, :port, :password, ...]`. New pods on commit b4d6b04 onward crashed at startup with that NimbleOptions.ValidationError; old pods running e53a34d (top-level :url) coasted on already-established connections so the breakage only surfaced when fresh pods rolled. The library accepts `redis_opts` as either a URL binary OR a keyword list. Pass the URL as a bare string so it takes the binary-clause path that hands it directly to Redix.PubSub.start_link/1. --- lib/microwaveprop/application.ex | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/microwaveprop/application.ex b/lib/microwaveprop/application.ex index 06a241bd..1e3f3948 100644 --- a/lib/microwaveprop/application.ex +++ b/lib/microwaveprop/application.ex @@ -127,8 +127,14 @@ defmodule Microwaveprop.Application do # Erlang's node() name in non-K8s environments. node_name = System.get_env("POD_IP") || to_string(node()) - {Phoenix.PubSub, - name: Microwaveprop.PubSub, adapter: Phoenix.PubSub.Redis, redis_opts: [url: url], node_name: node_name} + # phoenix_pubsub_redis 3.x: `redis_opts` accepts either a URL + # binary OR a keyword list of host/port/password/etc. The + # 3.1's deprecation warning ("Move :url inside the :redis_opts + # option instead") is misleading — `[url: url]` gets forwarded + # to Redix which rejects it as an unknown option (the valid + # keys are :host, :port, :password, …, NOT :url). The bare URL + # form takes the binary-clause and works correctly. + {Phoenix.PubSub, name: Microwaveprop.PubSub, adapter: Phoenix.PubSub.Redis, redis_opts: url, node_name: node_name} end end