Current latest docker image fails with sessions stored in Redis #1425

Closed
opened 2025-11-02 04:00:22 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @chriscowley on GitHub (Jan 5, 2018).

  • Gitea version (or commit ref): gitea/gitea:latest
  • Operating system: Docker (alpine?)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

Running the current latest image with sessions stored in Redis results in the error below and Gitea fails to run:

gitea.1.09uxp4aim9qv@swarm02    | panic: session/redis: unsupported option '/app/gitea/network'
gitea.1.09uxp4aim9qv@swarm02    | 
gitea.1.09uxp4aim9qv@swarm02    | goroutine 1 [running]:
gitea.1.09uxp4aim9qv@swarm02    | code.gitea.io/gitea/vendor/github.com/go-macaron/session.Sessioner(0xc420952000, 0x1, 0x1, 0x7f1c09f1d3a0, 0xc42071c340)
gitea.1.09uxp4aim9qv@swarm02    | 	/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/session/session.go:149 +0x285
gitea.1.09uxp4aim9qv@swarm02    | code.gitea.io/gitea/routers/routes.NewMacaron(0xc4200ca3c0)
gitea.1.09uxp4aim9qv@swarm02    | 	/srv/app/src/code.gitea.io/gitea/routers/routes/routes.go:109 +0x996
gitea.1.09uxp4aim9qv@swarm02    | code.gitea.io/gitea/cmd.runWeb(0xc4200ca3c0, 0x0, 0x0)
gitea.1.09uxp4aim9qv@swarm02    | 	/srv/app/src/code.gitea.io/gitea/cmd/web.go:65 +0xc1
gitea.1.09uxp4aim9qv@swarm02    | code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x7f1c09f1cf80, 0x7f1c0a08d4c8, 0xc4200ca3c0, 0xc42034aa00, 0x0)
gitea.1.09uxp4aim9qv@swarm02    | 	/srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xb9
gitea.1.09uxp4aim9qv@swarm02    | code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x7f1c0985eb0f, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f1c09882e02, 0x16, 0x0, ...)
gitea.1.09uxp4aim9qv@swarm02    | 	/srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xa74
gitea.1.09uxp4aim9qv@swarm02    | code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc4200731e0, 0xc42000c060, 0x2, 0x2, 0x0, 0x0)
gitea.1.09uxp4aim9qv@swarm02    | 	/srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x601
gitea.1.09uxp4aim9qv@swarm02    | main.main()
gitea.1.09uxp4aim9qv@swarm02    | 	/srv/app/src/code.gitea.io/gitea/main.go:48 +0x3a7

Reverting to gitea/gitea:1.3.2 fixes the problem.

Originally created by @chriscowley on GitHub (Jan 5, 2018). - Gitea version (or commit ref): gitea/gitea:latest - Operating system: Docker (alpine?) - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant ## Description Running the current latest image with sessions stored in Redis results in the error below and Gitea fails to run: ``` gitea.1.09uxp4aim9qv@swarm02 | panic: session/redis: unsupported option '/app/gitea/network' gitea.1.09uxp4aim9qv@swarm02 | gitea.1.09uxp4aim9qv@swarm02 | goroutine 1 [running]: gitea.1.09uxp4aim9qv@swarm02 | code.gitea.io/gitea/vendor/github.com/go-macaron/session.Sessioner(0xc420952000, 0x1, 0x1, 0x7f1c09f1d3a0, 0xc42071c340) gitea.1.09uxp4aim9qv@swarm02 | /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/session/session.go:149 +0x285 gitea.1.09uxp4aim9qv@swarm02 | code.gitea.io/gitea/routers/routes.NewMacaron(0xc4200ca3c0) gitea.1.09uxp4aim9qv@swarm02 | /srv/app/src/code.gitea.io/gitea/routers/routes/routes.go:109 +0x996 gitea.1.09uxp4aim9qv@swarm02 | code.gitea.io/gitea/cmd.runWeb(0xc4200ca3c0, 0x0, 0x0) gitea.1.09uxp4aim9qv@swarm02 | /srv/app/src/code.gitea.io/gitea/cmd/web.go:65 +0xc1 gitea.1.09uxp4aim9qv@swarm02 | code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x7f1c09f1cf80, 0x7f1c0a08d4c8, 0xc4200ca3c0, 0xc42034aa00, 0x0) gitea.1.09uxp4aim9qv@swarm02 | /srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xb9 gitea.1.09uxp4aim9qv@swarm02 | code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x7f1c0985eb0f, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f1c09882e02, 0x16, 0x0, ...) gitea.1.09uxp4aim9qv@swarm02 | /srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xa74 gitea.1.09uxp4aim9qv@swarm02 | code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc4200731e0, 0xc42000c060, 0x2, 0x2, 0x0, 0x0) gitea.1.09uxp4aim9qv@swarm02 | /srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x601 gitea.1.09uxp4aim9qv@swarm02 | main.main() gitea.1.09uxp4aim9qv@swarm02 | /srv/app/src/code.gitea.io/gitea/main.go:48 +0x3a7 ``` Reverting to `gitea/gitea:1.3.2` fixes the problem.
GiteaMirror added the issue/needs-feedbacktype/bug labels 2025-11-02 04:00:22 -06:00
Author
Owner

@lafriks commented on GitHub (Jan 27, 2018):

Can not seem to reproduce on latest master. Bot cache and session seems to be stored in redis without errors. I'm using such configuration:

[cache]
ADAPTER = redis
HOST = network=tcp,addr=127.0.0.1:6379,db=0,pool_size=100,idle_timeout=180

[session]
PROVIDER = redis
PROVIDER_CONFIG = network=tcp,addr=127.0.0.1:6379,db=0,pool_size=100,idle_timeout=180
@lafriks commented on GitHub (Jan 27, 2018): Can not seem to reproduce on latest master. Bot cache and session seems to be stored in redis without errors. I'm using such configuration: ``` [cache] ADAPTER = redis HOST = network=tcp,addr=127.0.0.1:6379,db=0,pool_size=100,idle_timeout=180 [session] PROVIDER = redis PROVIDER_CONFIG = network=tcp,addr=127.0.0.1:6379,db=0,pool_size=100,idle_timeout=180 ```
Author
Owner

@chriscowley commented on GitHub (Apr 10, 2018):

I am running in docker (gitea/gitea:latest), with redis in a dedicated container (called cache) using redis:alpine

My config is:

[session]
PROVIDER = redis
PROVIDER_CONFIG = network=tcp,addr=cache:6379,db=0,pool_size=100,idle_timeout=180


[cache]
ADAPTER = redis
HOST = network=tcp,addr=cache:6379,db=0,pool_size=100,idle_timeout=180

Cache works perfectly so Redis is accepting the connections, but sessions fail.

Version 1.4.0 fixes the problem ,so it seems to only be on gitea/gitea:latest

@chriscowley commented on GitHub (Apr 10, 2018): I am running in docker (`gitea/gitea:latest`), with redis in a dedicated container (called `cache`) using `redis:alpine` My config is: ``` [session] PROVIDER = redis PROVIDER_CONFIG = network=tcp,addr=cache:6379,db=0,pool_size=100,idle_timeout=180 [cache] ADAPTER = redis HOST = network=tcp,addr=cache:6379,db=0,pool_size=100,idle_timeout=180 ``` Cache works perfectly so Redis is accepting the connections, but sessions fail. Version 1.4.0 fixes the problem ,so it seems to only be on `gitea/gitea:latest`
Author
Owner

@techknowlogick commented on GitHub (May 10, 2018):

I think, per https://github.com/go-gitea/gitea/blob/master/Dockerfile#L8, that redis is not added into Docker image by default.

@techknowlogick commented on GitHub (May 10, 2018): I think, per https://github.com/go-gitea/gitea/blob/master/Dockerfile#L8, that redis is not added into Docker image by default.
Author
Owner

@techknowlogick commented on GitHub (May 10, 2018):

I've created: #3937 which will likely resolve this.

Edit: It does not solve it

@techknowlogick commented on GitHub (May 10, 2018): ~~I've created: #3937 which will likely resolve this.~~ Edit: It does not solve it
Author
Owner

@chriscowley commented on GitHub (May 21, 2018):

@techknowlogick Adding Redis to the container is not a good solution. Best-practise is to have 1 single process per container - exactly what I am doing here with a separate Redis container.

@chriscowley commented on GitHub (May 21, 2018): @techknowlogick Adding Redis to the container is not a good solution. Best-practise is to have 1 single process per container - exactly what I am doing here with a separate Redis container.
Author
Owner

@techknowlogick commented on GitHub (May 21, 2018):

@chriscowley oh I didn't mean add the redis server, but rather adding in the tag to build with capability to work with redis, however as discovered it builds with that by default and docs just weren't updated.

@techknowlogick commented on GitHub (May 21, 2018): @chriscowley oh I didn't mean add the redis server, but rather adding in the tag to build with capability to work with redis, however as discovered it builds with that by default and docs just weren't updated.
Author
Owner

@techknowlogick commented on GitHub (Jan 19, 2019):

Closing issue. Please open a post in the forum if this is still an issue.

@techknowlogick commented on GitHub (Jan 19, 2019): Closing issue. Please open a post in the [forum](https://discourse.gitea.io/) if this is still an issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1425