Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

_contains_display_name evaluator barfs on events with no body #7700

@richvdh

Description

@richvdh

given an incoming event with no content.body:

2020-06-15 19:00:06,270 - synapse.federation.federation_server - 290 - ERROR - PUT-1359406-$1592244001432863GBGGz:matrix.org- Failed to handle PDU $1592244001432863GBGGz:matrix.org
...
Traceback (most recent call last):
  File "/opt/synapse/synapse/synapse/federation/federation_server.py", line 279, in process_pdus_for_room
    await self._handle_received_pdu(origin, pdu)
  File "/opt/synapse/synapse/synapse/federation/federation_server.py", line 658, in _handle_received_pdu
    await self.handler.on_receive_pdu(origin, pdu, sent_to_us_directly=True)
  File "/opt/synapse/synapse/synapse/handlers/federation.py", line 412, in on_receive_pdu
    await self._process_received_pdu(origin, pdu, state=state)
  File "/opt/synapse/synapse/synapse/handlers/federation.py", line 690, in _process_received_pdu
    context = await self._handle_new_event(origin, event, state=state)
  File "/opt/synapse/synapse/synapse/handlers/federation.py", line 1841, in _handle_new_event
    event, context
  File "/opt/synapse/synapse/synapse/push/action_generator.py", line 43, in handle_push_actions_for_event
    yield self.bulk_evaluator.action_for_event_by_user(event, context)
  File "/opt/synapse/env3/lib/python3.5/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/opt/synapse/synapse/synapse/push/bulk_push_rule_evaluator.py", line 190, in action_for_event_by_user
    evaluator, rule["conditions"], uid, display_name, condition_cache
  File "/opt/synapse/synapse/synapse/push/bulk_push_rule_evaluator.py", line 215, in _condition_checker
    res = evaluator.matches(cond, uid, display_name)
  File "/opt/synapse/synapse/synapse/push/push_rule_evaluator.py", line 107, in matches
    return self._contains_display_name(display_name)
  File "/opt/synapse/synapse/synapse/push/push_rule_evaluator.py", line 161, in _contains_display_name
    return r.search(body)
TypeError: expected string or bytes-like object
2020-06-15 19:00:06,285 - synapse.logging.context - 396 - WARNING - PUT-1359406-$1592244001432863GBGGz:matrix.org- Re-starting finished log context PUT-1359406-$1592244001432863GBGGz:matrix.org

Metadata

Metadata

Assignees

Labels

z-bug(Deprecated Label)z-p2(Deprecated Label)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions