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 E79BF1FF183 for ; Wed, 10 Sep 2025 12:20:21 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CC89F1DEA9; Wed, 10 Sep 2025 12:20:25 +0200 (CEST) Date: Wed, 10 Sep 2025 12:19:51 +0200 From: Wolfgang Bumiller To: Dominik Csapak Message-ID: <77fqpefbjxlf6lqfx4fbutbinlwpcgttplu7tvch6rw3opdes7@2itxjkmiklzk> References: <20250909082608.1018103-1-d.csapak@proxmox.com> <5e6jb7tq2pmmmfnyucinmkch2c2o55u34c73wxqpelcjjcbmmd@ed2z44jgrve7> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1757499567133 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.547 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_BADIPHTTP 2 Due to the Storm Bot Network, IPs in emails is bad KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_SHORT 0.001 Use of a URL Shortener for very short URL NORMAL_HTTP_TO_IP 0.001 URI host has a public dotted-decimal IPv4 address NUMERIC_HTTP_ADDR 1.242 Uses a numeric IP address in URL RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [0.0.0.0] WEIRD_PORT 0.001 Uses non-standard port number for HTTP Subject: Re: [pdm-devel] [RFC PATCH datacenter-manager] server: api: resources: use root cause for errors for remote fetching 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 Cc: pdm-devel@lists.proxmox.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" On Wed, Sep 10, 2025 at 10:31:52AM +0200, Dominik Csapak wrote: > > > On 9/10/25 10:15 AM, Wolfgang Bumiller wrote: > > On Tue, Sep 09, 2025 at 10:25:51AM +0200, Dominik Csapak wrote: > > > when we can't reach a remote for any reason, we want to return the error > > > as a string here over the API. Since most errors that can occur here are > > > client/network related (wrong credentials, no route to host, timeout, > > > etc.) converting this error directly to a string gives us > > > errors like: > > > > > > `client error (Connect)` > > > > > > which is not really helpful most of the time. > > > Instead if we use the `root_cause()`, we get the most underlying error > > > > > > e.g. > > > > > > `error connecting to https://0.0.0.0:8006/ - tcp connect error: No route to host (os error 113)` > > > > > > which is much more helpful. > > > > > > We could also think about printing the whole error chain, but in my test > > > cases here this was not more helpful, e.g. i got two times the above > > > `client error (Connect)` and once the root cause from above. > > > > Curious, because from a quick grep, `client error (*)` comes from hyper. > > Otherwise I'd say it may have been one our own error types or > > one-too-many same `.context()` calls. > > > > I'm still not sure this is a good idea though, as we may still lose some > > useful contest. I wish anyhow had an easy method to just shave off a > > single layer. > > > > What if we do this, but first throw in a: > > > > tracing::debug!("{error:?}"); > > > > just so we still have the option to see everything if we need to? > > just to clarify: you want me to use root_cause and additionally log the > error into the debug tracing? (not returning the whole `chain()` here) Yes. Log the complete error at debug-level but only return the root cause. _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel