Description
StartupProblems warnings (from deprecatedSetting and other LogStartupProblem calls) appear twice in the admin panel at /-/admin/self_check and other places.
Cause
LoadCommonSettings() is called twice during web server startup:
- Early init via
cmd/main.go:79 → InitWorkPathAndCommonConfig → LoadCommonSettings()
- Web server startup via
cmd/web.go:167 → LoadCommonSettings()
The second call re-initializes the config provider first (InitCfgProvider), but the StartupProblems slice in modules/setting/config_provider.go is never cleared between loads, so every warning gets appended twice.
How to reproduce
- Add a deprecated setting to
app.ini, e.g. [oauth2] → ENABLE = true (deprecated in favor of ENABLED)
- Start Gitea
- Go to Site Administration → the warnings section shows each warning duplicated
Description
StartupProblemswarnings (fromdeprecatedSettingand otherLogStartupProblemcalls) appear twice in the admin panel at/-/admin/self_checkand other places.Cause
LoadCommonSettings()is called twice during web server startup:cmd/main.go:79→InitWorkPathAndCommonConfig→LoadCommonSettings()cmd/web.go:167→LoadCommonSettings()The second call re-initializes the config provider first (
InitCfgProvider), but theStartupProblemsslice inmodules/setting/config_provider.gois never cleared between loads, so every warning gets appended twice.How to reproduce
app.ini, e.g.[oauth2]→ENABLE = true(deprecated in favor ofENABLED)