Redis session broken after upgrade to 1.3.0 #1320

Closed
opened 2025-11-02 03:56:34 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @dh-harald on GitHub (Dec 4, 2017).

  • Gitea version (or commit ref): 1.3.0 (docker image)
  • Git version: 2.13.5
  • Operating system: alpine-linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

After upgrading the docker image to 1.3.0, I can't use redis session...
The application drops this exception:

panic: session/redis: unsupported option '/app/gitea/network'

goroutine 1 [running]:
code.gitea.io/gitea/vendor/github.com/go-macaron/session.Sessioner(0xc420972900, 0x1, 0x1, 0x5619a67efc40, 0xc42086e540)
	/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/session/session.go:149 +0x285
code.gitea.io/gitea/routers/routes.NewMacaron(0xc42028da40)
	/srv/app/src/code.gitea.io/gitea/routers/routes/routes.go:109 +0x996
code.gitea.io/gitea/cmd.runWeb(0xc42028da40, 0x0, 0x0)
	/srv/app/src/code.gitea.io/gitea/cmd/web.go:65 +0xc1
code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x5619a67ef820, 0x5619a695f368, 0xc42028da40, 0xc42012f800, 0x0)
	/srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xb9
code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x5619a6132b0f, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5619a6156d46, 0x16, 0x0, ...)
	/srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xa74
code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc4201b1ba0, 0xc42000c060, 0x2, 0x2, 0x0, 0x0)
	/srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x601
main.main()
	/srv/app/src/code.gitea.io/gitea/main.go:48 +0x3a7

I'm using the usual config in session:

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

After a short investigation I've found this commit:
8798cf4e3b (diff-60f5fca6d29eafbb30eb645a0cd4041fR1347)
I think, this could be a problem, because it's excepting file (instead of redis configuration) and joins it with AppWorkPath

Originally created by @dh-harald on GitHub (Dec 4, 2017). - Gitea version (or commit ref): 1.3.0 (docker image) - Git version: 2.13.5 - Operating system: alpine-linux - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description After upgrading the docker image to 1.3.0, I can't use redis session... The application drops this exception: ``` panic: session/redis: unsupported option '/app/gitea/network' goroutine 1 [running]: code.gitea.io/gitea/vendor/github.com/go-macaron/session.Sessioner(0xc420972900, 0x1, 0x1, 0x5619a67efc40, 0xc42086e540) /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/session/session.go:149 +0x285 code.gitea.io/gitea/routers/routes.NewMacaron(0xc42028da40) /srv/app/src/code.gitea.io/gitea/routers/routes/routes.go:109 +0x996 code.gitea.io/gitea/cmd.runWeb(0xc42028da40, 0x0, 0x0) /srv/app/src/code.gitea.io/gitea/cmd/web.go:65 +0xc1 code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0x5619a67ef820, 0x5619a695f368, 0xc42028da40, 0xc42012f800, 0x0) /srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xb9 code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x5619a6132b0f, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5619a6156d46, 0x16, 0x0, ...) /srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xa74 code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc4201b1ba0, 0xc42000c060, 0x2, 0x2, 0x0, 0x0) /srv/app/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x601 main.main() /srv/app/src/code.gitea.io/gitea/main.go:48 +0x3a7 ``` I'm using the usual config in session: ``` [session] PROVIDER = redis PROVIDER_CONFIG = network=tcp,addr=redis:6379,db=0,pool_size=100,idle_timeout=180 ``` After a short investigation I've found this commit: https://github.com/go-gitea/gitea/commit/8798cf4e3ba30bc0bdea073bf273ac27b71b78ce#diff-60f5fca6d29eafbb30eb645a0cd4041fR1347 I think, this could be a problem, because it's excepting file (instead of redis configuration) and joins it with `AppWorkPath`
GiteaMirror added the type/bug label 2025-11-02 03:56:34 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1320