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.

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

Closed

Description

@Half-Shot

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

Activity

  1. added
    T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.
    on May 6, 2021
  2. erikjohnston commented on May 6, 2021

    @erikjohnston
    Member

    This looks to be due to the new release of attrs

  3. erikjohnston commented on May 6, 2021

    @erikjohnston
    Member

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

  4. erikjohnston commented on May 6, 2021

    @erikjohnston
    Member

    Upstream issue python-attrs/attrs#804

  5. Half-Shot commented on May 6, 2021

    @Half-Shot
    CollaboratorAuthor

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

  6. erikjohnston commented on May 6, 2021

    @erikjohnston
    Member

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

  7. added
    X-Release-BlockerMust be resolved before making a release
    S-CriticalBlocks development, potential data loss, more than 25% of users possibly affected, no workarounds.
    on May 6, 2021
  8. callahad commented on May 6, 2021

    @callahad
    Contributor

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

  9. added a commit that references this issue on May 6, 2021
    5db9478
  10. hannojg commented on May 6, 2021

    @hannojg

    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

  11. callahad commented on May 6, 2021

    @callahad
    Contributor

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

  12. added a commit that references this issue on May 6, 2021
    24f07a8
  13. hynek commented on May 7, 2021

    @hynek

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

S-CriticalBlocks development, potential data loss, more than 25% of users possibly affected, no workarounds.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.X-Release-BlockerMust be resolved before making a release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions