From 71bdcb958a1cfdd4e009fad0347e49379361329f Mon Sep 17 00:00:00 2001 From: strawberry Date: Thu, 23 May 2024 01:15:05 -0400 Subject: [PATCH] fix: dont drop remote federation error on 4xx responses for a very long time, if a remote server responded to us with a valid but unsuccessful (HTTP 4xx) response and the caller was the `send_federation_request` function, we may find ourselves with a warning message only containing the destination's server name which was very unhelpful. the true error was buried away in trace logs. this would primarily be noticed with server key fetch requests from us. conduit has been throwing away the ruma request error: https://gitlab.com/famedly/conduit/-/blame/next/src/utils/error.rs#L62 before: 2024-05-23T04:45:02.930224Z WARN router:{path=/_matrix/client/v3/publicRooms}:handle: conduit_api::client_server::directory: Failed to return our /publicRooms: matrix.org after: 2024-05-23T05:05:02.435272Z WARN router:{path=/_matrix/client/v3/publicRooms}:handle: conduit_api::client_server::directory: Failed to return our /publicRooms: matrix.org: [401 / M_UNAUTHORIZED] Failed to find any key to satisfy: _FetchKeyRequest(server_name='your.server.name', minimum_valid_until_ts=1716440702337, key_ids=['ed25519:RQB3XPQX']) Signed-off-by: strawberry --- src/core/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/error.rs b/src/core/error.rs index 5a671da4..40ad8ecc 100644 --- a/src/core/error.rs +++ b/src/core/error.rs @@ -37,7 +37,7 @@ pub enum Error { #[from] source: rust_rocksdb::Error, }, - #[error("Could not generate an image.")] + #[error("Could not generate an image: {source}")] Image { #[from] source: image::error::ImageError, @@ -52,14 +52,14 @@ pub enum Error { #[from] source: regex::Error, }, - #[error("{0}")] + #[error("Remote server {0} responded with: {1}")] Federation(OwnedServerName, RumaError), #[error("Could not do this io: {source}")] Io { #[from] source: std::io::Error, }, - #[error("There was a problem with your configuration file: {0}")] + #[error("There was a problem with your configuration: {0}")] BadConfig(String), #[error("{0}")] BadServerResponse(&'static str),