Please tick all applicable boxes.
python --version on the command line)update scriptWhich version are you using?
master version (1.9.8)review versionWhat type of issue are you creating?
Bug occurs when starting the bot.
[29.974222183] 2018-10-18 14:39:07,842 - INFO - launcher: Starting sanity checks
[30.389070511] 2018-10-18 14:39:07,842 - INFO - launcher: Checking for Python 3.5+
[30.684471130] 2018-10-18 14:39:07,843 - INFO - launcher: Checking console encoding
[30.932426453] 2018-10-18 14:39:07,843 - INFO - launcher: Ensuring we're in the right environment
[37393.874406815] 2018-10-18 14:39:45,206 - INFO - launcher: Required checks passed.
[37394.431352615] 2018-10-18 14:39:45,206 - INFO - launcher: Optional checks passed.
[37394.753694534] 2018-10-18 14:39:45,207 - INFO - launcher: Moving old musicbot log
######################### PRE-RUN SANITY CHECKS PASSED #########################
[37.8026421070098877] 2018-10-18 14:39:45,615 - WARNING - musicbot.config | In config.py::MainThread(140622347941184), line 115 in run_checks: i18n file does not exist. Trying to fallback to config/i18n/en.json.
[37.8028473854064941] 2018-10-18 14:39:45,615 - INFO - musicbot.config | In config.py::MainThread(140622347941184), line 126 in run_checks: Using i18n: config/i18n/en.json
[37.806980610] launcher-ERROR: Error starting bot
Traceback (most recent call last):
File "run.py", line 368, in main
m = MusicBot()
File "/home/discord/MusicBot-NH/musicbot/bot.py", line 72, in __init__
self.permissions = Permissions(perms_file, grant_all=[self.config.owner_id])
File "/home/discord/MusicBot-NH/musicbot/permissions.py", line 79, in __init__
owner_group = PermissionGroup('Owner (auto)', self.config['Owner (auto)'], fallback=Permissive)
File "/usr/lib64/python3.6/configparser.py", line 959, in __getitem__
raise KeyError(key)
KeyError: 'Owner (auto)'
[37.809793234] launcher-INFO: All done.
1.9.8_2-rc1 requires owner section in permissions.ini. Copy the Owner (auto) section from the example permission file (example_permissions.ini) into your permission file and it should work. This is a side effect of implementing a suggested behavior in #1740.
@TheerapakG that did it, thanks. I glossed over it due to it coming straight after a giant comment block that just explains the permissions. Maybe move the owner part of the config below the default one, to prevent this from happening when review becomes master again?
I am considering adding a warning on launch then falling back to the old behavior
That鈥檚 how all missing permissions are handled, and why there are defaults. This is technically a bug, by not handling the error case
I've added a check and fall back to old behavior on the PR #1767. This error's cause is similar to the error when the default permissions section is deleted. We can't simply assign the owner to the defaults (like how you suggested) because there are owner-only commands. Nevertheless, I currently make the bot falling back to the defaults like you said it should.
The aforementioned PR was merged.