unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: "bdju" <bdju@tilde.team>
Cc: Josselin Poiret <dev@jpoiret.xyz>,
	53541@debbugs.gnu.org, Leo Famulari <leo@famulari.name>
Subject: bug#53541: [installer] backtrace during fresh Guix System install after during formatting
Date: Sat, 22 Oct 2022 22:34:59 +0200	[thread overview]
Message-ID: <87czajiolo.fsf@gnu.org> (raw)
In-Reply-To: <871qqzpzd4.fsf@gnu.org> (Mathieu Othacehe's message of "Sat, 22 Oct 2022 19:00:39 +0200")

[-- Attachment #1: Type: text/plain, Size: 663 bytes --]


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-installer-parted-Retry-failing-read-partition-uuid-c.patch --]
[-- Type: text/x-patch, Size: 1854 bytes --]

From 4407374ff4087772bd8226824cf4883537752f01 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Sat, 22 Oct 2022 22:27:57 +0200
Subject: [PATCH 1/1] installer: parted: Retry failing read-partition-uuid
 call.

Fixes: <https://issues.guix.gnu.org/53541>.

* 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)))))))
+
 \f
 ;;
 ;; 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


  reply	other threads:[~2022-10-24  0:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  3:21 bug#53541: backtrace during fresh Guix System install after during formatting bdju via Bug reports for GNU Guix
2022-01-26  3:42 ` bug#53541: backtrace during fresh Guix System install " bdju via Bug reports for GNU Guix
2022-01-26  4:08   ` bdju via Bug reports for GNU Guix
2022-01-26  4:14     ` bdju via Bug reports for GNU Guix
2022-02-03 18:34 ` bug#53541: backtrace during fresh Guix System install after " Leo Famulari
2022-02-04  3:34   ` bdju via Bug reports for GNU Guix
2022-02-04  4:15     ` Leo Famulari
     [not found]     ` <877d0uebt9.fsf_-_@gnu.org>
2022-10-22 17:00       ` bug#53541: [installer] " Mathieu Othacehe
2022-10-22 20:34         ` Mathieu Othacehe [this message]
2022-10-31  8:35           ` Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czajiolo.fsf@gnu.org \
    --to=othacehe@gnu.org \
    --cc=53541@debbugs.gnu.org \
    --cc=bdju@tilde.team \
    --cc=dev@jpoiret.xyz \
    --cc=leo@famulari.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).