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

Warn on unrecognised config section #1878

Closed
darkphoenix opened this issue Feb 2, 2020 · 2 comments · Fixed by #1890
Closed

Warn on unrecognised config section #1878

darkphoenix opened this issue Feb 2, 2020 · 2 comments · Fixed by #1890
Labels
A-config C-enhancement good first issue
Milestone

Comments

@darkphoenix
Copy link

@darkphoenix darkphoenix commented Feb 2, 2020

I've recently (apparently without realising) been updated to Mopidy 3.0, which, as I now know, doesn't include the MPD frontend in the core anymore and apparently didn't pull it in as a dependency, so I was left trying to troubleshoot why my Mopidy server was suddenly not listening on port 6600 anymore.
A feature that would've been very helpful would be a warning of some kind if there is a section in the configuration that has no corresponding extension - for example: "configuration for missing extension mpd - do you need to install mopidy-mpd?" (with the latter part left out for any configuration section that doesn't match the well-known first-party extensions, or rewritten in a more generic way).
As of now, the only sign you get the mpd extensions is gone is that it disappears from the listed extensions and enabled frontends, and I feel like a warning like that would be very helpful for future troubleshooting.

@kingosticks
Copy link
Member

@kingosticks kingosticks commented Feb 2, 2020

We currently emit debug messages reporting config sections that don't exist e.g

MainThread DEBUG    2020-02-02 23:42:31,718 Ignoring unknown config section: foo

Upgrading this to a warning sounds reasonable.

@kingosticks kingosticks added A-config good first issue C-enhancement labels Feb 2, 2020
@jodal
Copy link
Member

@jodal jodal commented Feb 10, 2020

I guess the original thought behind this being only on debug level might be to cater for new "extensions" or hacks storing their configuration in mopidy.conf without there necessarily being a matching proper extension installed. I don't believe that to be an important use case, and logging a warning won't break the use case either.

I see advantages to increasing this to warning level:

  • Typos in config section names are easier detected
  • Config sections for uninstalled extensions are warned about so that the config file can be cleaned up.

I suggest the following wording: Ignoring config section {ext_name!r}: A matching extension was not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config C-enhancement good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants