Gitea not accepting "redis-cluster" as cache adapter/session provider #12862

Closed
opened 2025-11-02 10:23:16 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @SomanathThilak on GitHub (Apr 17, 2024).

Description

Gitea is not accepting Cache ADAPTER or Session PROVIDER as "redis-cluster".

In the documentation it is mentioned to use string "redis-cluster" when redis cluster instance is used for cache/session. But when Gitea is installed with ADAPTER/PROVIDER set to redis-cluster, it is instead configuring it to memory.

On analysis of code, it seems string "redis-cluster" is not supported for ADAPTER/PROVIDER.

Cache :
58b204b813/modules/setting/cache.go (L53)

Session:
58b204b813/modules/setting/session.go (L44)
58b204b813/modules/setting/session.go (L45)

Documentation Reference
Cache - https://docs.gitea.com/1.20/administration/config-cheat-sheet#cache-cache
Session - https://docs.gitea.com/1.20/administration/config-cheat-sheet#session-session

When it is set to "redis" both cache/session seems to be working fine even for redis cluster instances.

Gitea Version

1.21.7

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

When redis-cluster is used for ADAPTER/SESSION
tempsnip2

When using redis as ADAPTER
tempsnip

Git Version

No response

Operating System

No response

How are you running Gitea?

Gitea installed in a K8s environment with charts taken from https://dl.gitea.com/charts/

Database

PostgreSQL

Originally created by @SomanathThilak on GitHub (Apr 17, 2024). ### Description Gitea is not accepting Cache ADAPTER or Session PROVIDER as "redis-cluster". In the documentation it is mentioned to use string "redis-cluster" when redis cluster instance is used for cache/session. But when Gitea is installed with ADAPTER/PROVIDER set to redis-cluster, it is instead configuring it to memory. On analysis of code, it seems string "redis-cluster" is not supported for ADAPTER/PROVIDER. Cache : https://github.com/go-gitea/gitea/blob/58b204b813cd3a97db904d889d552e64a7e398ff/modules/setting/cache.go#L53 Session: https://github.com/go-gitea/gitea/blob/58b204b813cd3a97db904d889d552e64a7e398ff/modules/setting/session.go#L44 https://github.com/go-gitea/gitea/blob/58b204b813cd3a97db904d889d552e64a7e398ff/modules/setting/session.go#L45 Documentation Reference Cache - https://docs.gitea.com/1.20/administration/config-cheat-sheet#cache-cache Session - https://docs.gitea.com/1.20/administration/config-cheat-sheet#session-session When it is set to "redis" both cache/session seems to be working fine even for redis cluster instances. ### Gitea Version 1.21.7 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots When redis-cluster is used for ADAPTER/SESSION ![tempsnip2](https://github.com/go-gitea/gitea/assets/17761038/2cd7e0bd-c02c-4eb1-99c2-e98f17afa9f7) When using redis as ADAPTER ![tempsnip](https://github.com/go-gitea/gitea/assets/17761038/5f9daf7a-468e-4632-b422-df4297ba7c1d) ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Gitea installed in a K8s environment with charts taken from https://dl.gitea.com/charts/ ### Database PostgreSQL
GiteaMirror added the type/docstype/bug labels 2025-11-02 10:23:16 -06:00
Author
Owner

@lunny commented on GitHub (Apr 18, 2024):

The documentation was updated by #24717 . Maybe you can use redis directly even if it's a redis cluster?

@lunny commented on GitHub (Apr 18, 2024): The documentation was updated by #24717 . Maybe you can use `redis` directly even if it's a redis cluster?
Author
Owner

@SomanathThilak commented on GitHub (Apr 26, 2024):

Yes as mentioned in the issue , I had tried using redis instead of redis-cluster and it works fine. But since the documentation is different it should be updated.

@SomanathThilak commented on GitHub (Apr 26, 2024): Yes as mentioned in the issue , I had tried using redis instead of redis-cluster and it works fine. But since the documentation is different it should be updated.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12862