Staging instance, all changes can be removed at any time

Skip to content

celery_backend.listener: Fix debug output format string

Stumbled across this stack trace when setting log level to DEBUG for the scheduler listener:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/__init__.py", line 981, in emit
    msg = self.format(record)
  File "/usr/lib/python3.5/logging/__init__.py", line 831, in format
    return fmt.format(record)
  File "/usr/lib/python3.5/logging/__init__.py", line 568, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.5/logging/__init__.py", line 331, in getMessage
    msg = msg % self.args
TypeError: not enough arguments for format string
Call stack:
  File "/home/antoine/.local/bin/swh-scheduler", line 11, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/antoine/swh/swh-environment/swh-scheduler/swh/scheduler/cli.py", line 613, in listener
    event_monitor(app, backend=scheduler)
  File "/home/antoine/swh/swh-environment/swh-scheduler/swh/scheduler/celery_backend/listener.py", line 178, in event_monitor
    recv.capture(limit=None, timeout=None, wakeup=True)
  File "/usr/lib/python3/dist-packages/celery/events/receiver.py", line 92, in capture
    return list(self.consume(limit=limit, timeout=timeout, wakeup=wakeup))
  File "/usr/lib/python3/dist-packages/kombu/mixins.py", line 192, in consume
    conn.drain_events(timeout=safety_interval)
  File "/usr/lib/python3/dist-packages/kombu/connection.py", line 301, in drain_events
    return self.transport.drain_events(self.connection, **kwargs)
  File "/usr/lib/python3/dist-packages/kombu/transport/pyamqp.py", line 103, in drain_events
    return connection.drain_events(**kwargs)
  File "/usr/lib/python3/dist-packages/amqp/connection.py", line 500, in drain_events
    while not self.blocking_read(timeout):
  File "/usr/lib/python3/dist-packages/amqp/connection.py", line 506, in blocking_read
    return self.on_inbound_frame(frame)
  File "/usr/lib/python3/dist-packages/amqp/method_framing.py", line 79, in on_frame
    callback(channel, msg.frame_method, msg.frame_args, msg)
  File "/usr/lib/python3/dist-packages/amqp/connection.py", line 510, in on_inbound_method
    method_sig, payload, content,
  File "/usr/lib/python3/dist-packages/amqp/abstract_channel.py", line 126, in dispatch_method
    listener(*args)
  File "/usr/lib/python3/dist-packages/amqp/channel.py", line 1616, in _on_basic_deliver
    fun(msg)
  File "/usr/lib/python3/dist-packages/kombu/messaging.py", line 624, in _receive_callback
    return on_m(message) if on_m else self.receive(decoded, message)
  File "/usr/lib/python3/dist-packages/kombu/messaging.py", line 590, in receive
    [callback(body, message) for callback in callbacks]
  File "/usr/lib/python3/dist-packages/kombu/messaging.py", line 590, in <listcomp>
    [callback(body, message) for callback in callbacks]
  File "/home/antoine/swh/swh-environment/swh-scheduler/swh/scheduler/celery_backend/listener.py", line 43, in _receive
    self.process(type, body, message)
  File "/home/antoine/swh/swh-environment/swh-scheduler/swh/scheduler/celery_backend/listener.py", line 49, in process
    handler and handler(event, message)
  File "/home/antoine/swh/swh-environment/swh-scheduler/swh/scheduler/celery_backend/listener.py", line 111, in task_started
    event.get('name', 'N/A'))
Message: 'task_started: %s %s %s'
Arguments: ('task-started', 'N/A')

Migrated from D1208 (view on Phabricator)

Merge request reports

Loading