payload: {"action":"created","issue":{"url":"https://api.github.com/repos/matrix-org/synapse/issues/2641","repository_url":"https://api.github.com/repos/matrix-org/synapse","labels_url":"https://api.github.com/repos/matrix-org/synapse/issues/2641/labels{/name}","comments_url":"https://api.github.com/repos/matrix-org/synapse/issues/2641/comments","events_url":"https://api.github.com/repos/matrix-org/synapse/issues/2641/events","html_url":"https://github.com/matrix-org/synapse/issues/2641","id":271204822,"node_id":"MDU6SXNzdWUyNzEyMDQ4MjI=","number":2641,"title":"DNS problems can unexpectedly cause synapse to try to federate with itself","user":{"login":"ara4n","id":1294269,"node_id":"MDQ6VXNlcjEyOTQyNjk=","avatar_url":"https://avatars2.githubusercontent.com/u/1294269?v=4","gravatar_id":"","url":"https://api.github.com/users/ara4n","html_url":"https://github.com/ara4n","followers_url":"https://api.github.com/users/ara4n/followers","following_url":"https://api.github.com/users/ara4n/following{/other_user}","gists_url":"https://api.github.com/users/ara4n/gists{/gist_id}","starred_url":"https://api.github.com/users/ara4n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ara4n/subscriptions","organizations_url":"https://api.github.com/users/ara4n/orgs","repos_url":"https://api.github.com/users/ara4n/repos","events_url":"https://api.github.com/users/ara4n/events{/privacy}","received_events_url":"https://api.github.com/users/ara4n/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-04T16:33:01Z","updated_at":"2019-02-08T21:46:49Z","closed_at":"2019-02-08T21:46:49Z","author_association":"MEMBER","body":"I've seen this on and off over the years but not got a good example until now:\r\n\r\njcgruenhage.xyz tries to send a PDU to charity.az, but charity.az fails to resolve for unknown reasons (it has no SRV, but the A record seems fine, and even has valid TLS via LetsEncrypt on port 8448):\r\n\r\n```\r\n2017-11-04 12:52:41,071 - synapse.http.matrixfederationclient - 212 - WARNING - - {PUT-O-182552} Sending request failed to charity.az: PUT matrix://charity.az/_matrix/federation/v1/send/1509694103843/: TimeoutError([Query('_matrix._tcp.charity.az', 33, 1)],)\r\n2017-11-04 12:53:14,113 - synapse.http.outbound - 236 - INFO - - {PUT-O-182552} [charity.az] Result: 401 Unauthorized\r\n```\r\n\r\nHowever, the reason this ends up being a `401 Unauthorized` seems to be because the synapse ends up connecting to itself rather than charity.az:8448:\r\n\r\n```\r\n2017-11-04 12:53:14,087 - synapse.access.https.8448 - 59 - INFO - PUT-227888- 46.5.14.151 - 8448 - Received request: PUT /_matrix/federation/v1/send/1509694103843/\r\n2017-11-04 12:53:14,088 - synapse.crypto.keyring - 122 - DEBUG - PUT-227888- Verifying for gruenhage.xyz with key_ids ['ed25519:a_FcsH']\r\n2017-11-04 12:53:14,088 - synapse.crypto.keyring - 758 - DEBUG - PUT-227888- Got key ed25519:a_FcsH ed25519:a_FcsH for server gruenhage.xyz, verifying\r\n2017-11-04 12:53:14,089 - synapse.federation.transport.server - 181 - ERROR - PUT-227888- authenticate_request failed\r\n2017-11-04 12:53:14,089 - synapse.http.server - 123 - INFO - PUT-227888- <SynapseRequest at 0x7fae3f97c7a0 method=PUT uri=/_matrix/federation/v1/send/1509694103843/ clientproto=HTTP/1.1 site=8448> SynapseError: 401 - Invalid signature for server gruenhage.xyz with key ed25519:a_FcsH\r\n2017-11-04 12:53:14,089 - synapse.access.https.8448 - 91 - INFO - PUT-227888- 46.5.14.151 - 8448 - {None} Processed request: 1ms (1ms, 0ms) (0ms/0) 105B 401 \"PUT /_matrix/federation/v1/send/1509694103843/ HTTP/1.1\" \"Synapse/0.24.1\"\r\n```\r\n\r\nThis ends up with the 'authenticate_request' error in the log, and some extreme confusion as to why synapse would be trying to connect to itself (and be unable to authenticate its own cert)."},"comment":{"url":"https://api.github.com/repos/matrix-org/synapse/issues/comments/461957927","html_url":"https://github.com/matrix-org/synapse/issues/2641#issuecomment-461957927","issue_url":"https://api.github.com/repos/matrix-org/synapse/issues/2641","id":461957927,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2MTk1NzkyNw==","user":{"login":"richvdh","id":1389908,"node_id":"MDQ6VXNlcjEzODk5MDg=","avatar_url":"https://avatars1.githubusercontent.com/u/1389908?v=4","gravatar_id":"","url":"https://api.github.com/users/richvdh","html_url":"https://github.com/richvdh","followers_url":"https://api.github.com/users/richvdh/followers","following_url":"https://api.github.com/users/richvdh/following{/other_user}","gists_url":"https://api.github.com/users/richvdh/gists{/gist_id}","starred_url":"https://api.github.com/users/richvdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richvdh/subscriptions","organizations_url":"https://api.github.com/users/richvdh/orgs","repos_url":"https://api.github.com/users/richvdh/repos","events_url":"https://api.github.com/users/richvdh/events{/privacy}","received_events_url":"https://api.github.com/users/richvdh/received_events","type":"User","site_admin":false},"created_at":"2019-02-08T21:46:49Z","updated_at":"2019-02-08T21:46:49Z","author_association":"MEMBER","body":"I'd be very surprised if this is still an issue now that we've rewritten the federation agent"}}
other: {"actor":{"display_login":"richvdh"}}