Skip to content

fix(manager): RedisStorage expects a client instance, not a URL string - #81

Merged
PenguinzTech merged 1 commit into
v2.1.xfrom
fix/manager-redis-storage-client-api
Aug 7, 2026
Merged

fix(manager): RedisStorage expects a client instance, not a URL string#81
PenguinzTech merged 1 commit into
v2.1.xfrom
fix/manager-redis-storage-client-api

Conversation

@PenguinzTech

Copy link
Copy Markdown
Contributor

Summary

Verifying manager's Dockerfile end-to-end now that penguin-limiter is published on PyPI (was previously missing entirely, blocking any build). The image now builds cleanly, but create_app() crashed at boot:

TypeError: RedisStorage.__init__() got an unexpected keyword argument 'url'

penguin_limiter.storage.redis_store.RedisStorage.__init__(self, client, key_prefix=...) takes an already-constructed redis-py client (it calls client.register_script(...) internally) — not a connection URL string. Manager called RedisStorage(url=_storage_url). This is the first time this code path has ever actually run, since the package didn't exist until this week.

Fix

Construct the redis-py client first, pass that:

_storage = RedisStorage(client=redis.Redis.from_url(_storage_url))

Verification

  • Built the real manager/backend/Dockerfile end-to-end (no stripped dependencies)
  • Confirmed penguin-limiter resolves and installs from PyPI
  • Ran the container via its actual entrypoint (gunicorn, not just an import check) against a live Valkey instance
  • All 4 gunicorn workers boot; curl /health returns {"status":"healthy"} with HTTP 200; container stays up

Test plan

  • docker build succeeds
  • Container runs via real entrypoint against live Valkey
  • /health returns 200
  • Pre-commit hooks (gitleaks, flake8, Dockerfile lint) pass

penguin-limiter's RedisStorage.__init__(self, client, key_prefix=...)
takes an already-constructed redis-py client (it calls
client.register_script(...) internally) — not a connection URL. Manager
called RedisStorage(url=_storage_url), which crashed create_app() with
TypeError: RedisStorage.__init__() got an unexpected keyword argument
'url', discovered now that penguin-limiter is actually published and
this code path runs for the first time end-to-end.

Verified: built the real Dockerfile, ran the container against a live
Valkey instance via gunicorn (not just an import check) — all 4 workers
boot, /health returns 200, container stays up.
@PenguinzTech PenguinzTech self-assigned this Aug 7, 2026
@PenguinzTech
PenguinzTech merged commit 98eeca7 into v2.1.x Aug 7, 2026
12 of 13 checks passed
@PenguinzTech
PenguinzTech deleted the fix/manager-redis-storage-client-api branch August 7, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant