Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joshtrichards opened this issue Jul 21, 2024 · 0 comments · May be fixed by #49956
Open

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

joshtrichards opened this issue Jul 21, 2024 · 0 comments · May be fixed by #49956
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: settings

Comments

@joshtrichards
Copy link
Member

joshtrichards commented Jul 21, 2024

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...)

@joshtrichards joshtrichards changed the title Detect unintentional multiple *.config.php files Detect unintentional multiple *.config.php files to catch weird config problems Jul 27, 2024
@skjnldsv skjnldsv added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: settings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants