Bug #44029
logging des erreurs de cron
Début:
12 juin 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
là ça fait un mail par ligne de la trace, exemple :
33 ( 1) jun 12 root@passerelle ( 0) ERROR: TypeError: super(type, obj): obj must be an instance or subtype of type 34 ( 1) jun 12 root@passerelle ( 0) ERROR: Thread.__init__(self) 35 ( 1) jun 12 root@passerelle ( 0) ERROR: File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 1731, in run 36 ( 1) jun 12 root@passerelle ( 0) ERROR: File "/usr/lib/python3.5/threading.py", line 1166, in __init__ 37 ( 1) jun 12 root@passerelle ( 0) ERROR: super(TenantAwareThread, self).__init__(*args, **kwargs) 38 ( 1) jun 12 root@passerelle ( 0) ERROR: self.packetizer.start_handshake(self.handshake_timeout) 39 ( 1) jun 12 root@passerelle ( 0) ERROR: 40 ( 1) jun 12 root@passerelle ( 0) ERROR: File "/usr/lib/python3/dist-packages/paramiko/packet.py", line 201, in start_handshake 41 ( 1) jun 12 root@passerelle ( 0) ERROR: File "/usr/lib/python3/dist-packages/hobo/multitenant/threads.py", line 34, in __init__ 42 ( 1) jun 12 root@passerelle ( 0) ERROR: self.__timer = threading.Timer(float(timeout), self.read_timer) 43 ( 1) jun 12 root@passerelle ( 0) ERROR: Traceback (most recent call last): 44 ( 1) jun 12 root@passerelle ( 0) ERROR: Unknown exception: super(type, obj): obj must be an instance or subtype of type
Fichiers
Révisions associées
Historique
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
J'ai du mal à voir d'où vient ce comportement, on a un seul connector.logger.error par exception, ou alors c'est les print à la fin ?
for app in get_all_apps(): for connector in app.objects.all(): if options.get('connector') and connector.get_connector_slug() != options.get('connector'): continue if options.get('slug') and connector.slug != options.get('slug'): continue try: getattr(connector, frequency)() except Exception as e: connector.logger.error('error running %s job (%r)' % (frequency, e)) errors.append({'connector': connector, 'exception': e, 'traceback': traceback.format_exc()}) if errors: for error in errors: if options['verbosity'] >= 1: print(repr(error['connector']),) print(' url:', getattr(settings, 'SITE_BASE_URL', '') + error['connector'].get_absolute_url()) print(' error:', error['exception']) if options['verbosity'] >= 2: print(' traceback:') print(error['traceback']) print() raise CommandError('error running jobs')
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
Ça vient de paramiko, on ne peut pas faire grand chose à la source :
- _log() prend des listes et produit autant de ligne de logs : https://github.com/paramiko/paramiko/blob/master/paramiko/transport.py#L1814
- il trouve malin de logger les traceback en filant un formatage sous forme de liste : https://github.com/paramiko/paramiko/blob/master/paramiko/transport.py#L2130
Faut juste désactiver le logger paramiko.transport et/ou utiliser le filtre qui rabaisse le niveau à DEBUG.
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
- Priorité changé de Normal à Bas
Si ça revient l'idée c'est ça :
diff --git a/debian/debian_config.py b/debian/debian_config.py index 88bb4bac..a70197ce 100644 --- a/debian/debian_config.py +++ b/debian/debian_config.py @@ -21,6 +21,11 @@ LOGGING['loggers']['suds'] = { 'filters': ['require_debug_true'], 'propagate': True, } +LOGGING['loggers']['paramiko.transport'] = { + 'level': 'DEBUG', + 'filters': ['force_debug'], + 'propagate': True, +} exec(open('/etc/%s/settings.py' % PROJECT_NAME).read())
Mis à jour par Serghei Mihai il y a environ 3 ans
- Fichier 0001-debian-log-paramiko.transports-errors-as-debug-44029.patch 0001-debian-log-paramiko.transports-errors-as-debug-44029.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Testé le paramètrage sur la prod, recette de Grenoble et Lille, ça fonctionne.
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Serghei Mihai il y a environ 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
- Assigné à mis à Serghei Mihai
commit 650e807fd2bdd4875d5c1bcc25eb556a88cba6b3 (origin/main) Author: Serghei Mihai <smihai@entrouvert.com> Date: Sun Mar 21 17:42:09 2021 +0100 debian: log paramiko.transports errors as debug (#44029)
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
debian: log paramiko.transports errors as debug (#44029)