From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UBVADzziVWOhTQAAbAwnHQ (envelope-from ) for ; Mon, 24 Oct 2022 02:54:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id IKl8DzziVWPPyAAA9RJhRA (envelope-from ) for ; Mon, 24 Oct 2022 02:54:20 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BDE501466F for ; Mon, 24 Oct 2022 02:54:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjW0-0004IZ-BU for larch@yhetil.org; Sun, 23 Oct 2022 18:32:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omLDu-0005AH-AZ for bug-guix@gnu.org; Sat, 22 Oct 2022 16:36:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omLDt-0001PW-Ob for bug-guix@gnu.org; Sat, 22 Oct 2022 16:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omLDt-0005VY-JY for bug-guix@gnu.org; Sat, 22 Oct 2022 16:36:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#53541: [installer] backtrace during fresh Guix System install after during formatting Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 22 Oct 2022 20:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53541 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: "bdju" Cc: Josselin Poiret , 53541@debbugs.gnu.org, Leo Famulari Received: via spool by 53541-submit@debbugs.gnu.org id=B53541.166647091321113 (code B ref 53541); Sat, 22 Oct 2022 20:36:01 +0000 Received: (at 53541) by debbugs.gnu.org; 22 Oct 2022 20:35:13 +0000 Received: from localhost ([127.0.0.1]:42450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omLD7-0005UT-GJ for submit@debbugs.gnu.org; Sat, 22 Oct 2022 16:35:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omLD3-0005UC-BG for 53541@debbugs.gnu.org; Sat, 22 Oct 2022 16:35:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omLCx-00019W-7C; Sat, 22 Oct 2022 16:35:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=d34VqnqCsQa4jhn/c1jt5esX6mb91b/jfUxf2EsQRys=; b=rUm/Yefij6/ot1YLEa7M 0Icgf0iT+y6yOfnY5sc9JaaKe3sRM+JhMEWuNGRaRScL5gqHUU6GCgiTzLrMSqRmtlwxqsuq3pkpE OEX1EdDHs2okfQAAyGxEdp1Rf60u4CNYbnNC5Mp2JWGa3SYJYsbDX6/pjrIZ3YMMiDUkKyRpgYu61 PZKK5HhrvxvWuSw7kyoTXjdJ0u3prL93S45x99p9Bnw3JDFVhQA79l1HrX9Qz1zn2XkDDDYiRAfP+ 8tWCAET8hb+LBMLYAJhIqazx9zb/H8PviPSl8lphZkeJ4NMq2pnDrOrImCMvyvoefJvc0KcFmOi5V bWl3wNBJYloSCg==; Received: from 2a02-8429-81d2-3d01-94c9-8097-ea5c-2775.rev.sfr.net ([2a02:8429:81d2:3d01:94c9:8097:ea5c:2775] helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omLCw-0007TV-PL; Sat, 22 Oct 2022 16:35:02 -0400 From: Mathieu Othacehe References: <877d0uebt9.fsf_-_@gnu.org> <871qqzpzd4.fsf@gnu.org> Date: Sat, 22 Oct 2022 22:34:59 +0200 In-Reply-To: <871qqzpzd4.fsf@gnu.org> (Mathieu Othacehe's message of "Sat, 22 Oct 2022 19:00:39 +0200") Message-ID: <87czajiolo.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666572860; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=NCSlflnGmUJGwfOTuDzkfm/LTjkejDug+55N8VkmjvA=; b=O0KDMkP5Mha2kcbLY0aX7WVMIg3OnOE/qZFeB5VVRonIXfeU+CF68BNWWVz3hyekVAtS3X QYRdd9wZxrCMkSu6XxJxzFsLbxLUMgZyzUknhoY0bBLfLJbfndt6tuTjEXMfQTFuP/vI9k 7stIg3wHzRlcC5hR0kBXFGj159H5OxH3nggdnqcqPsd0Ng7fpCyIre8UBx3ugdkfAjgwbq PXU0mQQlOj5Yz/vPY63lY2KNAG3iMmMDXcL96NrLhUxnvcZVye3WWJEpWxcljI5+0L2yE7 OoeWeV2LPjnlWeZd5/NG0FoT6GcvZNiq2MgC03oqOhyJ+8vJm7DKZqrulDKbRw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666572860; a=rsa-sha256; cv=none; b=j4vHvYwhc3FiBSvA8oIOH7OKI0EJCGWa9i8Dqrqtzqhq63bbq3edju8J75JlsuptKQoU1v z5+plpsv61bkHeoRoGbrEbFQI8lAVRlOSHGWdF7eL9TQUN/bdzQk/Bz0Tyt/1CbAeqZq9I mpIxr1V+Qt1hjwuCtuPfmWLUF/qB+2PKbz55FALiTJkj8pMcBb9DAXiXTPvK/P+vdmCdu0 AIZaS4D57Bf1xWkzfTel4fCe5jJ9xTIk07Pb8w/3VbGbb/V4gyjI9oGQLNFcrUCRJMI4H4 KCWRCE+XpNlQl+axgCZptczEozG+Jonb/xz1yAywYBEtG8CCxOauv+lAN9cVww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b="rUm/Yefi"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.61 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b="rUm/Yefi"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BDE501466F X-Spam-Score: -1.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5qGVBHljtTfE --=-=-= Content-Type: text/plain Hey, > so the disk partition table is updated because we move from 4 to 2 > partitions. Could it be possible that during a brief period of time the > /dev/nvme0n1p1 file disappears then re-appears? Looks like that's what happening. I'm not able to reproduce it on a VM. I guess that's because my hardware is slower. Anyway having a few retries of read-partition-uuid fixes it for me. This is a bit dirty but that's how we usually deal with that kind of problems. A patch is attached. Running those tests I experienced a segmentation fault in libparted and then in libblkid, but that's another story. I'll open a ticket about that later on. Thanks, Mathieu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-installer-parted-Retry-failing-read-partition-uuid-c.patch >From 4407374ff4087772bd8226824cf4883537752f01 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sat, 22 Oct 2022 22:27:57 +0200 Subject: [PATCH 1/1] installer: parted: Retry failing read-partition-uuid call. Fixes: . * gnu/installer/parted.scm (read-partition-uuid/retry): New procedure. (check-user-partitions): Use it. --- gnu/installer/parted.scm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index fcc936a391..82375d29e3 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -319,6 +319,25 @@ (define (find-user-partition-by-parted-object user-partitions partition)) user-partitions)) +(define (read-partition-uuid/retry file-name) + "Call READ-PARTITION-UUID with 5 retries spaced by 1 second. This is useful +if the partition table is updated by the kernel at the time this function is +called, causing the underlying /dev to be absent." + (define max-retries 5) + + (let loop ((retry max-retries)) + (catch #t + (lambda () + (read-partition-uuid file-name)) + (lambda _ + (if (> retry 0) + (begin + (sleep 1) + (loop (- retry 1))) + (error + (format #f (G_ "Could not open ~a after ~a retries~%.") + file-name max-retries))))))) + ;; ;; Devices @@ -1108,7 +1127,7 @@ (define (check-uuid) (need-formatting? (user-partition-need-formatting? user-partition))) (or need-formatting? - (read-partition-uuid file-name) + (read-partition-uuid/retry file-name) (raise (condition (&cannot-read-uuid -- 2.38.0 --=-=-=--