-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Internal error (FOREIGN KEY when testing locally) when sending m.notice with html payload #9096
Comments
I used a differnet client (matrixcli with some local modifications) to send the same notice, and it does not cause the 500. So it seems that something in send_glitch is causing the internal error. Here is a tcpdump from matrixcli:
|
One difference that stands out is that matrixcli is producing a User-Agent and glitch-in-the-matrix is not. I will investigate more tomorrow |
It seems like that table has foreign keys to For your local Synapse -- I assume it is running in monolith since you're running SQLite? This somewhat sounds like a race, but I would be surprised by that without workers being used. Does that |
Hi @clokep Thanks for the response. I managed to find the logger config in Regarding private information: I stood up this home server and user account specifically for purposes of investigating this bug, so not to worry.
I don't know. I am using mostly default configuration and I don't see the phrase
HTTP itself has retries due to TCP, but there are no application-level retries, no. If you take a look at the tcpdump above, you can see that the body ("google") is only written once, so I don't think that's the issue here. One thing that may not be fully clear from my diags above: this does work sometimes and fails other times. This time while testing with DEBUG-level diags, it succeeded the first time and failed the second time. Here are logs:
|
Huh it seems that the request is only received once and failed in |
Hey @clokep I haven't managed to reproduce a successful send using
|
I took a diff of the two pcaps:
A few differences jump out:
|
Hi @clokep have you seen my notes above? I have not investigated further, but I think this should be useful information for debugging synapse I wonder if there is some foreign key on user-agent? Or something expecting one/both of content-type/bearer token header? |
@blakehawkins I have seen it, but I do not know what is causing this issue. Unfortunately since it seems related to that specific client it is somewhat low priority to debug. I don't think this is related to a user agent being part of the request. I suspect that the glitch client is doing something weird with retries (or maybe transaction IDs?) |
maybe it's a race related to how quickly the various HTTP requests happen? |
@clokep just a couple notes here:
As mentioned by @richvdh, low-latency HTTP seems potentially problematic. Do you have a test harness where you can confirm that user-agent, accept-encoding, Connection: keep-alive, content-type, and authorization: bearer headers are all not needed? (As a reminder, this code used to work, so something has definitely changed) |
These should not be needed and I don't believe they get set in our unit tests. Unfortunately I'm not sure what other help we can offer here. I'd suggest you try to make a small reproducible test-case. It seems like it might be related to immediately making additional queries after login. Additionally it is likely worth asking in #synapse:matrix.org if anyone has had issues with this client before. |
Without a useful way to reproduce this, I'm not sure there's much we can do here, so I'm going to go ahead and close this. Let us know if you manage to pin it down any more. |
Description
When sending m.notice with html payload, encountering M_UNKNOWN Internal Server Error ~99% of the time.
Steps to reproduce
Send an m.notice with the following html payload:
<a href=\"https://google.com\">My google link</a>
. I am using https://github.com/blakehawkins/send_glitch likeecho '{ "html": "<a href=\"https://google.com\">My google link</a>" }' | cargo run
. This worked flawlessly in February 2020. I will provide a tcpdump of the entire auth + event flow below.When running against matrix.org, this normally produces 500 Internal Error. When testing against local synapse instance, produces this stacktrace
Copy-pasted for posterity:
Expected: synapse should never 500 internal error.
Version information
Version: matrix.org and also {"server_version":"1.24.0","python_version":"3.7.3"}
Install method:
backports
ARM + sqlite
$ sudo tcpdump -nnvvXSs 1514 'tcp port 8008' -v > tcpdump
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 1514 bytes
^C26 packets captured
26 packets received by filter
0 packets dropped by kernel
The text was updated successfully, but these errors were encountered: