Config should be validated with clearer errors
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 42/100
Piste de recherche
Commencez par mautrix/util/config.py, en particulier _recursive_get, ainsi que par mautrix_telegram/config.py, où bridge.filter.mode est copié lors de la configuration. Reproduisez l’échec au démarrage montré dans le rapport et faites en sorte qu’une configuration imbriquée invalide produise une erreur qui identifie le problème au lieu du traceback de NoneType.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
This doesn't tell me what is wrong:
Feb 3 10:15:20 integrations systemd[1]: Started Telegram Bridge.
Feb 3 10:15:22 integrations python[16389]: Traceback (most recent call last):
Feb 3 10:15:22 integrations python[16389]: File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
Feb 3 10:15:22 integrations python[16389]: "__main__", mod_spec)
Feb 3 10:15:22 integrations python[16389]: File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
Feb 3 10:15:22 integrations python[16389]: exec(code, run_globals)
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix_telegram/__main__.py", line 113, in <module>
Feb 3 10:15:22 integrations python[16389]: TelegramBridge().run()
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/bridge/bridge.py", line 92, in run
Feb 3 10:15:22 integrations python[16389]: self._prepare()
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/bridge/bridge.py", line 99, in _prepare
Feb 3 10:15:22 integrations python[16389]: self.prepare_config(args.config, args.registration, args.base_config)
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/bridge/bridge.py", line 122, in prepare_config
Feb 3 10:15:22 integrations python[16389]: self.config.update()
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/config.py", line 152, in update
Feb 3 10:15:22 integrations python[16389]: self.do_update(ConfigUpdateHelper(base, self))
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix_telegram/config.py", line 146, in do_update
Feb 3 10:15:22 integrations python[16389]: copy("bridge.filter.mode")
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/config.py", line 112, in copy
Feb 3 10:15:22 integrations python[16389]: if from_path in self.source:
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/config.py", line 57, in __contains__
Feb 3 10:15:22 integrations python[16389]: return self.get(key, None) is not None
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/config.py", line 50, in get
Feb 3 10:15:22 integrations python[16389]: return self._recursive_get(self._data, key, default_value)
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/config.py", line 45, in _recursive_get
Feb 3 10:15:22 integrations python[16389]: return self._recursive_get(next_data, next_key, default_value)
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/config.py", line 45, in _recursive_get
Feb 3 10:15:22 integrations python[16389]: return self._recursive_get(next_data, next_key, default_value)
Feb 3 10:15:22 integrations python[16389]: File "/home/telegram/tgenv/lib/python3.6/site-packages/mautrix/util/config.py", line 46, in _recursive_get
Feb 3 10:15:22 integrations python[16389]: return data.get(key, default_value)
Feb 3 10:15:22 integrations python[16389]: AttributeError: 'NoneType' object has no attribute 'get'
Feb 3 10:15:22 integrations systemd[1]: telegram.service: Main process exited, code=exited, status=1/FAILURE
- Langage dominant
- Python
- Étoiles
- 249
- Forks
- 84
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de mautrix/python
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
Toutes les issues de mautrix/python
Issues similaires
-
documentation help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
simonw/sqlite-utils#872 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100