镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Detect unintentional multiple *.config.php files to catch weird config problems  #46665

Description

@joshtrichards

Sometimes an administrator makes a manual backup of their existing config before making an adjustment. If they name it {anything}.config.php this results in them unintentionally having overlapping config files. And it also means the backup takes precedence. This creates all sorts of unexpected behaviors that can be difficult to isolate (and may give the appearance of bugs)1.

Multiple config.php file support is valid so this problem is difficult to detect automatically without creating lots of false positives. I think we can take a pragmatic approach by focusing on two areas of improvement:

  • logging / indicating when multiple config files are in-use in a few spots (where it won't be overly noisy/intrusive in the environments where it's perfectly valid)
  • detect the most common yet least likely to be a false positive situation: multiple config files with overlapping version field values

Specifically:

  • during the upgrade we log that multiple config files were detected (not an error, just notes it so it'll be obvious when logs are reviewed or provided for troubleshooting)
  • create a setup check that detects obvious signs of a probable unintentional multi-config file situation.2
  • possibly we give an indication that multiple config files are in-use somewhere in the UI
  • possibly we give an indication that multiple config files are in-use when running some occ commands3

Footnotes

  1. e.g. https://help.nextcloud.com/t/nextcloud-failed-after-update-to-29-0-4-from-28-0-2/198547/12 ↩

  2. I think we could check for two things occurring and warn only if they occur simultaneously: multiple config.php files detected and differing version field values across them. This avoids false positives (while likely catching probably the most common unintentional scenario). ↩

  3. Relevant to "Upgrader" (occ upgrade), but less so - at least directly - to the non-multi aware Updater4 (updater[phar]) ↩

  4. (yeah I know...) ↩

Activity

  1. changed the title [-]Detect unintentional multiple `*.config.php` files[/-] [+]Detect unintentional multiple `*.config.php` files to catch weird config problems [/+] on Jul 27, 2024
  2. added
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions