From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9598D8389; Tue, 15 Nov 2022 13:27:48 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7F0CE2594; Tue, 15 Nov 2022 13:27:48 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS; Tue, 15 Nov 2022 13:27:48 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id C543F44BF4; Tue, 15 Nov 2022 13:27:47 +0100 (CET) Message-ID: <7ba55d71-8511-9016-6705-e0065023ae9c@proxmox.com> Date: Tue, 15 Nov 2022 13:27:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Thunderbird/107.0 Content-Language: en-GB To: Proxmox VE development discussion , Dominik Csapak , pbs-devel@lists.proxmox.com References: <20221110103634.2177856-1-d.csapak@proxmox.com> <20221110103634.2177856-5-d.csapak@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20221110103634.2177856-5-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: =?UTF-8?Q?0=0A=09?=AWL -0.032 Adjusted score from AWL reputation of From: =?UTF-8?Q?address=0A=09?=BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict =?UTF-8?Q?Alignment=0A=09?=SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF =?UTF-8?Q?Record=0A=09?=SPF_PASS -0.001 SPF: sender matches SPF =?UTF-8?Q?record=0A=09?=URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [filerestore.pm] Subject: [pve-devel] applied: [PATCH storage v4 1/3] api: FileRestore: decode and return proper error of file-restore listing X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2022 12:27:48 -0000 Am 10/11/2022 um 11:36 schrieb Dominik Csapak: > since commit > ba690c40 ("file-restore: remove 'json-error' parameter from list_files") > > in proxmox-backup, the file-restore binary will return the error as json > when called with '--output-format json' (which we do in PVE::PBSClient) > > here, we assume that 'file-restore' will fail in that case, and we try > to use the return value as an array ref which fails, and the user never > sees the real error message. > > To fix that, check the ref type of the return value and act accordingly > > Signed-off-by: Dominik Csapak > --- > no changes from v3 > does not depend on rest of series > fixes error output > > PVE/API2/Storage/FileRestore.pm | 21 ++++++++++++++++----- > 1 file changed, 16 insertions(+), 5 deletions(-) > > applied, thanks!