poljar / weechat-matrix

Weechat Matrix protocol script written in python
Other
957 stars 119 forks source link

Error validating response: 'events' is a required property #265

Open imyxh opened 3 years ago

imyxh commented 3 years ago

Hi, just tried to connect to my own server (which runs dendrite) and I ran into these errors (log level = debug):

16:23:46 | nio.http: Got http header server: nginx
16:23:46 | nio.http: Got http header date: Sat, 17 Apr 2021 20:23:46 GMT
16:23:46 | nio.http: Got http header content-type: application/json
16:23:46 | nio.http: Got http header transfer-encoding: chunked
16:23:46 | nio.http: Got http header connection: keep-alive
16:23:46 | nio.http: Got http header access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept,
         | Authorization
16:23:46 | nio.http: Got http header access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS
16:23:46 | nio.http: Got http header access-control-allow-origin: *
16:23:47 | nio.client: Received response of type: <class 'nio.responses.SyncResponse'>
16:23:47 | nio.responses: Validating response schema
16:23:47 | nio.responses: Error validating response: 'events' is a required property
16:23:47 | nio.client: Received new response of type SyncError

I'd appreciate it if you have any suggestions as to how I can debug this further. Element works fine on my server, but it definitely could be an error in my configuration. I see no relevant errors coming from dendrite.

Thanks for all your work on this!

poljar commented 3 years ago

The error is in the schema of nio, it's a bit overzealous, some of the fields should not be marked as required and should have set defaults:

https://github.com/poljar/matrix-nio/blob/master/nio/schemas.py#L323.

Somebody was working on a patch for this but it never turned up as a PR.