MatrixSynapse/synapse/handlers
Eric Eastwood 187ab28611 Messy: Fix undefined state_group for federated historical events
```
2021-07-13 02:27:57,810 - synapse.handlers.federation - 1248 - ERROR - GET-4 - Failed to backfill from hs1 because NOT NULL constraint failed: event_to_state_groups.state_group
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 1216, in try_backfill
    await self.backfill(
  File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 1035, in backfill
    await self._auth_and_persist_event(dest, event, context, backfilled=True)
  File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 2222, in _auth_and_persist_event
    await self._run_push_actions_and_persist_event(event, context, backfilled)
  File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 2244, in _run_push_actions_and_persist_event
    await self.persist_events_and_notify(
  File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 3290, in persist_events_and_notify
    events, max_stream_token = await self.storage.persistence.persist_events(
  File "/usr/local/lib/python3.8/site-packages/synapse/logging/opentracing.py", line 774, in _trace_inner
    return await func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/persist_events.py", line 320, in persist_events
    ret_vals = await yieldable_gather_results(enqueue, partitioned.items())
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/persist_events.py", line 237, in handle_queue_loop
    ret = await self._per_item_callback(
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/persist_events.py", line 577, in _persist_event_batch
    await self.persist_events_store._persist_events_and_state_updates(
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/databases/main/events.py", line 176, in _persist_events_and_state_updates
    await self.db_pool.runInteraction(
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/database.py", line 681, in runInteraction
    result = await self.runWithConnection(
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/database.py", line 770, in runWithConnection
    return await make_deferred_yieldable(
  File "/usr/local/lib/python3.8/site-packages/twisted/python/threadpool.py", line 238, in inContext
    result = inContext.theWork()  # type: ignore[attr-defined]
  File "/usr/local/lib/python3.8/site-packages/twisted/python/threadpool.py", line 254, in <lambda>
    inContext.theWork = lambda: context.call(  # type: ignore[attr-defined]
  File "/usr/local/lib/python3.8/site-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.8/site-packages/twisted/python/context.py", line 83, in callWithContext
    return func(*args, **kw)
  File "/usr/local/lib/python3.8/site-packages/twisted/enterprise/adbapi.py", line 293, in _runWithConnection
    compat.reraise(excValue, excTraceback)
  File "/usr/local/lib/python3.8/site-packages/twisted/python/deprecate.py", line 298, in deprecatedFunction
    return function(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/twisted/python/compat.py", line 403, in reraise
    raise exception.with_traceback(traceback)
  File "/usr/local/lib/python3.8/site-packages/twisted/enterprise/adbapi.py", line 284, in _runWithConnection
    result = func(conn, *args, **kw)
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/database.py", line 765, in inner_func
    return func(db_conn, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/database.py", line 549, in new_transaction
    r = func(cursor, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/synapse/logging/utils.py", line 69, in wrapped
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/databases/main/events.py", line 385, in _persist_events_txn
    self._store_event_state_mappings_txn(txn, events_and_contexts)
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/databases/main/events.py", line 2065, in _store_event_state_mappings_txn
    self.db_pool.simple_insert_many_txn(
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/database.py", line 923, in simple_insert_many_txn
    txn.execute_batch(sql, vals)
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/database.py", line 280, in execute_batch
    self.executemany(sql, args)
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/database.py", line 300, in executemany
    self._do_execute(self.txn.executemany, sql, *args)
  File "/usr/local/lib/python3.8/site-packages/synapse/storage/database.py", line 330, in _do_execute
    return func(sql, *args)
sqlite3.IntegrityError: NOT NULL constraint failed: event_to_state_groups.state_group
```
2021-07-20 19:56:44 -05:00
..
ui_auth Add missing type hints to handlers and fix a Spam Checker type hint. (#9896) 2021-04-29 07:17:28 -04:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
_base.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
account_data.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
account_validity.py Split multiplart email sending into a dedicated handler (#9977) 2021-05-17 12:33:38 +02:00
admin.py Add SSO `external_ids` to Query User Account admin API (#10261) 2021-07-01 11:26:24 +02:00
appservice.py Always update AS last_pos, even on no events (#10107) 2021-06-07 15:42:05 +01:00
auth.py MSC2918 Refresh tokens implementation (#9450) 2021-06-24 14:33:20 +01:00
cas.py Rename handler and config modules which end in handler/config. (#9816) 2021-04-20 14:55:20 -04:00
deactivate_account.py Port "Allow users to click account renewal links multiple times without hitting an 'Invalid Token' page #74" from synapse-dinsic (#9832) 2021-04-19 19:16:34 +01:00
device.py Clear the resync bit after resyncing device lists (#9867) 2021-04-22 16:53:24 +01:00
devicemessage.py Fix `m.room_key_request` to-device messages (#9961) 2021-05-11 11:02:56 +01:00
directory.py Use get_current_users_in_room from store and not StateHandler (#9910) 2021-05-05 16:49:34 +01:00
e2e_keys.py Limit the number of in-flight /keys/query requests from a single device. (#10144) 2021-06-09 07:05:32 -04:00
e2e_room_keys.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
event_auth.py Move methods involving event authentication to EventAuthHandler. (#10268) 2021-07-01 14:25:37 -04:00
events.py Use get_current_users_in_room from store and not StateHandler (#9910) 2021-05-05 16:49:34 +01:00
federation.py Messy: Fix undefined state_group for federated historical events 2021-07-20 19:56:44 -05:00
groups_local.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
identity.py Add missing type hints to handlers and fix a Spam Checker type hint. (#9896) 2021-04-29 07:17:28 -04:00
initial_sync.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
message.py Make base insertion event float off on its own 2021-07-08 22:22:55 -05:00
oidc.py Allow OIDC cookies to work on non-root public baseurls (#9726) 2021-04-23 18:22:47 +01:00
pagination.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
password_policy.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
presence.py Only send a presence state to a destination once (#10165) 2021-06-11 15:19:42 +01:00
profile.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
read_marker.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
receipts.py Ignore EDUs for rooms we're not in (#10317) 2021-07-06 14:31:13 +01:00
register.py MSC2918 Refresh tokens implementation (#9450) 2021-06-24 14:33:20 +01:00
room.py Add unstable room version to support new historical PL 2021-07-20 01:41:44 -05:00
room_list.py Integrate knock rooms with the public rooms directory (#9359) 2021-06-09 20:31:31 +01:00
room_member.py Add endpoints for backfilling history (MSC2716) (#9247) 2021-06-22 10:02:53 +01:00
room_member_worker.py Implement knock feature (#6739) 2021-06-09 19:39:51 +01:00
saml.py Rename handler and config modules which end in handler/config. (#9816) 2021-04-20 14:55:20 -04:00
search.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
send_email.py Split multiplart email sending into a dedicated handler (#9977) 2021-05-17 12:33:38 +02:00
set_password.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
space_summary.py Show all joinable rooms in the spaces summary. (#10298) 2021-07-13 08:59:27 -04:00
sso.py Implement config option `sso.update_profile_information` (#10108) 2021-06-21 23:48:57 +01:00
state_deltas.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
stats.py Remove functionality associated with unused historical stats tables (#9721) 2021-07-08 16:57:13 +01:00
sync.py Ensure that we do not cache empty sync responses after a timeout (#10158) 2021-06-17 16:23:11 +01:00
typing.py Ignore EDUs for rooms we're not in (#10317) 2021-07-06 14:31:13 +01:00
user_directory.py User directory: use calculated room membership state instead (#9821) 2021-04-16 18:17:18 +01:00