Skip to content

Duplicate startup warnings in admin panel #36630

@silverwind

Description

@silverwind

Description

StartupProblems warnings (from deprecatedSetting and other LogStartupProblem calls) appear twice in the admin panel at /-/admin/self_check and other places.

Image

Cause

LoadCommonSettings() is called twice during web server startup:

  1. Early init via cmd/main.go:79InitWorkPathAndCommonConfigLoadCommonSettings()
  2. Web server startup via cmd/web.go:167LoadCommonSettings()

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

  1. Add a deprecated setting to app.ini, e.g. [oauth2]ENABLE = true (deprecated in favor of ENABLED)
  2. Start Gitea
  3. Go to Site Administration → the warnings section shows each warning duplicated

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions