mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 19:38:46 -05:00
[GH-ISSUE #18073] issue: Redis ReadOnlyError with new Open WebUI Version #18481
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @koflerm on GitHub (Oct 6, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18073
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.32
Ollama Version (if applicable)
No response
Operating System
Red Hat CoreOS
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
The Open WebUI instance should automatically be able to decide with redis node is the master using the configured redis sentinel information.
Actual Behavior
When logging in via SSO / OAuth login, an Internal Server Error is returned. The log of the Open WebUI container shows the following error:
As background information, we are using the bitnami Redis helm chart to setup a 5 node redis cluster with Sentinel configured. The following environment variables are set in the Open WebUI Instance accordingly:
Here is some additional information to the redis setup:
For the SSO login, we have configured the following environment variables:
Important to mention is with the old versions, so basically before the OAuth has been reworked we never got those errors so would be interesting if something changed in the Redis config, or if there is a bug in the redis handling in the new oauth code.
Steps to Reproduce
Logs & Screenshots
Relevant logs provided as part of the actual behavior description.
Additional Information
No response
@rgaricano commented on GitHub (Oct 6, 2025):
The error occurs in the starsessions middleware when it attempts to save session data.
The session middleware is using a direct Redis connection that doesn't have Sentinel failover support, so when it connects to a read-only replica, write operations fail.
Suggested changes:
Modify backend/open_webui/main.py to pass a Sentinel-aware Redis connection to the RedisStore instead of just the URL,
change
3f71fa641f/backend/open_webui/main.py (L1941-L1946)by
By passing the client parameter with a connection from get_redis_connection(), we ensure the session store uses the SentinelRedisProxy wrapper that catches ReadOnlyError and retries operations after Sentinel discovers the new master.
(I can't test it as I'm not using sentinel hosts)
@Ithanil commented on GitHub (Oct 6, 2025):
Sorry for not opening an issue already, but this is discussed herem including a fix: https://github.com/open-webui/open-webui/pull/17223#issuecomment-3355502421
Nevertheless, I can't verify that Starsessions is actually using Redis at all.
@koflerm commented on GitHub (Oct 7, 2025):
Thanks guys for the quick response! If I read the discussion correctly @rgaricano you are still working on trying to get the proposed code running which includes the Redis Sentinel Handling?
@Ithanil commented on GitHub (Oct 7, 2025):
@koflerm If you want a quick fix, just change
4d7fddaf7e/backend/open_webui/main.py (L1912)toif False:to avoid using Starsessions.The proposed code does run per se, the remaining question is how to get Starsessions to actually behave as expected.
@koflerm commented on GitHub (Oct 7, 2025):
@Ithanil this essentially means same as not setting REDIS_URL so with this redis is not used at all for session management, correct?
@Ithanil commented on GitHub (Oct 7, 2025):
No, not setting REDIS_URL at all would have far more effects. This here is just about whether session data is stored in cookie or in Redis. If Open WebUI worked fine for you before this change, just revert to the old system as proposed.
@koflerm commented on GitHub (Oct 7, 2025):
@Ithanil All right thanks for the clarification then I guess we have to wait for this issue to be fixed before upgrading our prod instance. Appreciate the help!
@Alwinator commented on GitHub (Oct 7, 2025):
@Ithanil @rgaricano Could you kindly share if there’s an estimated timeframe for resolving this issue? We seem to be encountering the same challenge and truly appreciate all the hard work being put into this project.
@Ithanil commented on GitHub (Oct 7, 2025):
Just for clarification, I'm just a regular contributor, so I can't comment on this.
But regardless I would always recommend deploying your own image builds of open source projects, so you can actually take advantage of the openness by applying hotfixes yourself. It's a one-line fix.
@rgaricano commented on GitHub (Oct 7, 2025):
same as Ithanil,
by the way, yesterday I was the whole day trying to debug the recent added startsessions with redis, without success. As it is It seems like it could cause more problems than benefits. I think that right now the best solution is revert PR https://github.com/open-webui/open-webui/pull/17223 until it is verified to work correctly in all redis configurations.
@tjbck commented on GitHub (Oct 7, 2025):
Should be addressed in dev with
861953fd2d.@koflerm commented on GitHub (Oct 7, 2025):
Great then with this we should be able to move on as soon as a new release is available. Thanks guys for the quick support!