From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 418441FF16B for ; Fri, 24 Oct 2025 15:00:35 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5BD7020F99; Fri, 24 Oct 2025 15:01:03 +0200 (CEST) From: Maximiliano Sandoval To: pdm-devel@lists.proxmox.com Date: Fri, 24 Oct 2025 15:00:26 +0200 Message-ID: <20251024130028.1311135-1-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761310819896 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.096 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [PATCH proxmox-datacenter-manager v2 1/2] connection: log which API request failed X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" The word API was removed in an attempt to make the line as short as possible while remaining legible. Additionally, there is already a `api` in the journal since the process reporting this would be proxmox-datacenter-api[$pid]. Signed-off-by: Maximiliano Sandoval --- This was added while debugging an error message which lacked enough context to debug. The error messages now would look like: ``` client error on request /api2/extjs/cluster/resources, trying another remote - client error (SendRequest) Caused by: connection closed before message completed ``` server/src/connection.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) Differences from v1: - Fix compile time error due to extra {err} on the new error message being logged diff --git a/server/src/connection.rs b/server/src/connection.rs index 2eda452..cf8f788 100644 --- a/server/src/connection.rs +++ b/server/src/connection.rs @@ -718,11 +718,13 @@ macro_rules! try_request { } in $self.try_clients() { if let Some(err) = last_err.take() { - log::error!("API client error, trying another remote - {err:?}"); + let path = $path_and_query; + log::error!("client error on request {path}, trying another remote - {err:?}"); } if timed_out { timed_out = false; - log::error!("API client timed out, trying another remote"); + let path = $path_and_query; + log::error!("client timed out on request {path}, trying another remote"); } let request = client.$how($method.clone(), $path_and_query, params.as_ref()); @@ -748,10 +750,12 @@ macro_rules! try_request { } if let Some(err) = last_err { - log::error!("API client error (giving up) - {err:?}"); + let path = $path_and_query; + log::error!("client error on request {path}, giving up - {err:?}"); Err(proxmox_client::Error::Client(err)) } else if timed_out { - log::error!("API client timed out, no remotes reachable, giving up"); + let path = $path_and_query; + log::error!("client timed out on request {path}, no remotes reachable, giving up"); Err(proxmox_client::Error::Other( "failed to perform API request: timed out", )) -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel