-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
AttributeError: 'str' object has no attribute 'items' #10376
Comments
This looks to have been caused by receiving a malformed {
"content": {
"!some_room:example.org": {
"m.read": {
"@john:matrix.org": {
"data": {
"ts": 1533358089009
},
"event_ids": [
"$read_this_event:matrix.org"
]
}
}
}
},
"edu_type": "m.presence"
} but the one you received seems to have a something like: {
"content": {
"!some_room:example.org": "some string" // this should be a dict, not a string
},
"edu_type": "m.presence"
} Interestingly, I just noticed that the official example of an {
"content": {
...
"key": "value"
},
...
} That In any case, Synapse should guard against this and check the type of each field (or simply catch the relevant Exception) instead of |
This is both a validation bug in synapse, and a serialisation bug on another server, do you have any idea which server this EDU came from? |
Note that Synapse should simply fail this particular EDU and move on with the rest of the transaction (so it likely won't return a 500 to the remote server). We catch broad synapse/synapse/federation/federation_server.py Lines 1113 to 1123 in c54db67
|
I suspect it's tedomum.net but I have no proof. If you provide me with a patch adding some more logging at >= Warning level (I'm filtering the logs) I can run this for a few days (it happens several times per day). |
When is this (referring to #10376 (comment)) reproduced? What events take place and what's the setup? |
It has not happened to me in the last two weeks. I don't know steps to reproduce. |
matrix.org's Sentry instance has captured a few of these from July 2021. It doesn't seem to be happening anymore. https://sentry.matrix.org/sentry/synapse-matrixorg/issues/118010 The originating server was |
@symphorien, @squahtx: Is this issue still relevant then? Or should it be closed? |
Synapse 1.37.1, nixos 21.05, linux x86_64
The text was updated successfully, but these errors were encountered: