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

Failing to sync: attr._funcs.evolve() argument after ** must be a mapping, not RoomStreamToken #9936

Closed
Half-Shot opened this issue May 6, 2021 · 9 comments
Assignees
Labels
S-Critical Blocks development, potential data loss, more than 25% of users possibly affected, no workarounds. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Release-Blocker Must be resolved before making a release

Comments

@Half-Shot
Copy link
Collaborator

Half-Shot commented May 6, 2021

Seeing these errors on latest develop (merged with #9379 -- so far that branch has worked consistently).

2021-05-06 10:37:24,144 - synapse.http.server - 93 - ERROR - GET-282- Failed handle request via 'SyncRestServlet': <XForwardedForRequest at 0x7fa7e5691910 method='GET' uri='/_matrix/client/r0/sync?filter=183&timeout=0&since=s45567119_293425298_1_29910218_595864_1764_1018470_21679023_52' clientproto='HTTP/1.0' site=8018>
Traceback (most recent call last):
  File "/opt/synapse/lib/python3.9/site-packages/twisted/internet/defer.py", line 1445, in _inlineCallbacks
    result = current_context.run(g.send, result)
StopIteration: ([<FrozenEventV3 event_id='$b1vB74hFd4li3crjazdhqyhysvEk6sr_dB85hCuWzK4', type='m.room.member', state_key='@freenode_Kryptron_:matrix.org'>, <FrozenEventV3 event_id='$4fSNY9DWOo8XOOR1TrLbev_S4OWjXFGGtkYlbFs9GWs', type='m.room.member', state_key='@greatudini:matrix.org'>, <FrozenEventV3 event_id='$XXjQ2trh4wxhW7BQ15UsTtgNRerkrSw5A7OTWM4OVTY', type='m.room.message', state_key=None>, <FrozenEventV3 event_id='$1ci12KD7g0aQowO7a7NbUM8ixYNt_NunMELTBUvau_k', type='m.room.message', state_key=None>, <FrozenEventV3 event_id='$Ux9DERofhO04Smj3PcVDAPw6w7s5ihNS0xrm1qpVY3w', type='m.room.message', state_key=None>, <FrozenEventV3 event_id='$bpVth3vcA6IMHZS2GnoVxhCMywgld9I-G0sIOsHIJdc', type='m.room.message', state_key=None>], RoomStreamToken(topological=None, stream=45567154, instance_map={}))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/synapse/lib/python3.9/site-packages/twisted/internet/defer.py", line 1445, in _inlineCallbacks
    result = current_context.run(g.send, result)
  File "/opt/synapse/lib/python3.9/site-packages/synapse/handlers/sync.py", line 321, in _wait_for_sync_for_user
    result = await self.current_sync_for_user(
  File "/opt/synapse/lib/python3.9/site-packages/synapse/handlers/sync.py", line 354, in current_sync_for_user
    sync_result = await self.generate_sync_result(
  File "/opt/synapse/lib/python3.9/site-packages/synapse/handlers/sync.py", line 1020, in generate_sync_result
    res = await self._generate_sync_entry_for_rooms(
  File "/opt/synapse/lib/python3.9/site-packages/synapse/handlers/sync.py", line 1441, in _generate_sync_entry_for_rooms
    room_changes = await self._get_rooms_changed(
  File "/opt/synapse/lib/python3.9/site-packages/synapse/handlers/sync.py", line 1709, in _get_rooms_changed
    prev_batch_token = now_token.copy_and_replace("room_key", start_key)
  File "/opt/synapse/lib/python3.9/site-packages/synapse/types.py", line 657, in copy_and_replace
    return attr.evolve(self, **{key: new_value})
  File "/opt/synapse/lib/python3.9/site-packages/attr/_funcs.py", line 347, in evolve
    changes[init_name] = evolve(value, **changes[init_name])
TypeError: attr._funcs.evolve() argument after ** must be a mapping, not RoomStreamToken

Looks like it could be related to #9919 ? See Erik's comment

@Half-Shot Half-Shot added the T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. label May 6, 2021
@erikjohnston
Copy link
Member

This looks to be due to the new release of attrs

@erikjohnston
Copy link
Member

python-attrs/attrs#759 i think is the change

@erikjohnston
Copy link
Member

Upstream issue python-attrs/attrs#804

@Half-Shot
Copy link
Collaborator Author

Is there a way to pin this for now, I'm totally dead in the water :(

@erikjohnston
Copy link
Member

pip install attrs==20.3.0 should revert to the previous version

@callahad callahad added X-Release-Blocker Must be resolved before making a release P1 S-Critical Blocks development, potential data loss, more than 25% of users possibly affected, no workarounds. labels May 6, 2021
@callahad
Copy link
Contributor

callahad commented May 6, 2021

Priority is to set an upper bound on the dep and roll a point release so that pip installs work as expected

@hannojg
Copy link

hannojg commented May 6, 2021

this seems super critical, i am on tag v1.33.0 and can't join any rooms 🤔
//Edit: okay, i guess that seems so due to the fact that all sync requests fail

@callahad
Copy link
Contributor

callahad commented May 6, 2021

Per Erik's comment above, running pip install attrs==20.3.0 should get things working again for you

@hynek
Copy link

hynek commented May 7, 2021

hi sorry about this, 21.2 with the fix is on PyPI.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Critical Blocks development, potential data loss, more than 25% of users possibly affected, no workarounds. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Release-Blocker Must be resolved before making a release
Projects
None yet
Development

No branches or pull requests

6 participants