forked-synapse/synapse
Eric Eastwood 1bf2832714
Indicate what endpoint came back with a JSON response we were unable to parse (#14097)
**Before:**
```
WARNING - POST-11 - Unable to parse JSON: Expecting value: line 1 column 1 (char 0) (b'')
```

**After:**
```
WARNING - POST-11 - Unable to parse JSON from POST /_matrix/client/v3/join/%21ZlmJtelqFroDRJYZaq:hs1?server_name=hs1 response: Expecting value: line 1 column 1 (char 0) (b'')
```

---

It's possible to figure out which endpoint these warnings were coming from before but you had to follow the request ID `POST-11` to the log line that says `Completed request [...]`. Including this key information next to the JSON parsing error makes it much easier to reason whether it matters or not.

```
2022-09-29T08:23:25.7875506Z synapse_main | 2022-09-29 08:21:10,336 - synapse.http.matrixfederationclient - 299 - INFO - POST-11 - {GET-O-13} [hs1] Completed request: 200 OK in 0.53 secs, got 450 bytes - GET matrix://hs1/_matrix/federation/v1/make_join/%21ohtKoQiXlPePSycXwp%3Ahs1/%40charlie%3Ahs2?ver=1&ver=2&ver=3&ver=4&ver=5&ver=6&ver=org.matrix.msc2176&ver=7&ver=8&ver=9&ver=org.matrix.msc3787&ver=10&ver=org.matrix.msc2716v4
```


---

As a note, having no `body` is normal for the `/join` endpoint and it can handle it.

0c853e0970/synapse/rest/client/room.py (L398-L403)

Alternatively we could remove these extra logs but they are probably more usually helpful to figure out what went wrong.
2022-10-07 11:39:45 -05:00
..
_scripts Allow admins to require a manual approval process before new accounts can be used (using MSC3866) (#13556) 2022-09-29 15:23:24 +02:00
api Use stable identifiers for MSC3771 & MSC3773. (#14050) 2022-10-07 09:26:40 -04:00
app Update mypy and mypy-zope, attempt 3 (#13993) 2022-09-30 17:36:28 +01:00
appservice Send the appservice access token as a header. (#13996) 2022-10-04 07:06:41 -04:00
config Remove support for the unstable dir flag on relations. (#14106) 2022-10-07 12:38:46 -04:00
crypto Instrument _check_sigs_and_hash_and_fetch to trace time spent in child concurrent calls (#13588) 2022-08-23 21:53:37 -05:00
events fix: Push notifications for invite over federation (#13719) 2022-09-28 12:31:53 +00:00
federation Always close _all_ ijson coroutines, even if doing so raises Exceptions (#14065) 2022-10-06 18:17:50 +00:00
handlers Remove support for the unstable dir flag on relations. (#14106) 2022-10-07 12:38:46 -04:00
http Indicate what endpoint came back with a JSON response we were unable to parse (#14097) 2022-10-07 11:39:45 -05:00
logging Update mypy and mypy-zope, attempt 3 (#13993) 2022-09-30 17:36:28 +01:00
metrics Catch BrokenPipeError from metrics server, and log as a warning (#14072) 2022-10-07 13:35:44 +01:00
module_api Deprecate the generate_short_term_login_token method in favor of an async create_login_token method in the Module API. (#13842) 2022-10-06 10:22:36 +00:00
push Synapse 1.69.0rc2 (2022-10-06) 2022-10-06 18:48:47 +01:00
replication Batch up notifications after event persistence (#14033) 2022-10-05 10:12:48 -07:00
res Add viewport directive to HTML templates to optimise for mobile (#13493) 2022-08-11 14:04:20 +01:00
rest Remove support for the unstable dir flag on relations. (#14106) 2022-10-07 12:38:46 -04:00
server_notices Directly lookup local membership instead of getting all members in a room first (get_users_in_room mis-use) (#13608) 2022-08-24 14:13:12 -05:00
spam_checker_api Fix import in module_api module and docs on the new check_event_for_spam signature (#12918) 2022-05-31 12:04:53 +02:00
state Prepatory work for batching events to send (#13487) 2022-09-28 10:39:03 +01:00
static Add viewport directive to HTML templates to optimise for mobile (#13493) 2022-08-11 14:04:20 +01:00
storage Apply & bundle edits for non-message events. (#14034) 2022-10-07 15:27:50 +00:00
streams Remove support for the unstable dir flag on relations. (#14106) 2022-10-07 12:38:46 -04:00
util Always close _all_ ijson coroutines, even if doing so raises Exceptions (#14065) 2022-10-06 18:17:50 +00:00
__init__.py Parse SYNAPSE_ASYNC_IO_REACTOR env variable & log the reactor on startup (#14092) 2022-10-07 15:19:59 +01:00
event_auth.py Rename the EventFormatVersions enum values so that they line up with room version numbers. (#13706) 2022-09-07 11:08:20 +01:00
notifier.py Batch up notifications after event persistence (#14033) 2022-10-05 10:12:48 -07:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Fix error in is_mine_id when encountering a malformed ID (#13746) 2022-09-08 15:54:36 +01:00
types.py Accept & store thread IDs for receipts (implement MSC3771). (#13782) 2022-09-23 14:33:28 +00:00
visibility.py Skip filtering during push if there are no push actions (#13992) 2022-09-30 17:40:33 +01:00