-
Notifications
You must be signed in to change notification settings - Fork 295
snap panics on empty config sections #874
Comments
We should handle this better, but with YAML, if nothing will be in a config section, it can be commented out completely or removed from the file. Also, there is no need to specify .yaml or .json behind the default configuration file. snapd will automatically pick up a configuration file located with the name |
I don't think any config file should be able to make us panic, valid or invalid. |
Agreed, @IRCody. I am currently looking into this issue; I think it's the fact that those "empty" sections map to |
The problem is in how JSON unmarhalling happens (yes, JSON is used for the YAML file). Even if a section is labeled as |
Yeah, that was my assumption as well, @geauxvirtual; I'll dig into it a bit more and see what it would take to check for empty fields after the configuration file is parsed (skipping those in the merge process?). As @IRCody said I really don't think that a valid YAML (or JSON) file should cause a panic, so even though we can get around it by commenting that section out we should fix this issue. |
Fixes #874 (snap panics on empty config sections; take 2)
If you have an empty section in snapd.conf.yaml, snapd will panic:
such as:
--- scheduler:
Error:
The text was updated successfully, but these errors were encountered: