GNU bug report logs - #52831
[installer] Locale problems with nss-certs

Previous Next

Package: guix;

Reported by: Leo Famulari <leo <at> famulari.name>

Date: Mon, 27 Dec 2021 19:53:02 UTC

Severity: normal

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52831 in the body.
You can then email your comments to 52831 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#52831; Package guix. (Mon, 27 Dec 2021 19:53:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Famulari <leo <at> famulari.name>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 27 Dec 2021 19:53:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: bug-guix <at> gnu.org
Subject: [installer] Locale problems with nss-certs
Date: Mon, 27 Dec 2021 14:52:31 -0500
[Message part 1 (text/plain, inline)]
While testing the Guix System installer, I noticed that installation of
nss-certs has some problems that seem related to locales.

Some of the certificate's filenames are encoded in a way that isn't
supported by the environment in which they are being handled, and so
these certificates are not installed into the new system.

I've attached a screenshot of the error messages in the installer. The
problematic certificates are listed there.
[installer.png (image/png, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#52831; Package guix. (Wed, 29 Dec 2021 17:27:01 GMT) Full text and rfc822 format available.

Message #8 received at 52831 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Leo Famulari <leo <at> famulari.name>
Cc: 52831 <at> debbugs.gnu.org
Subject: Re: bug#52831: [installer] Locale problems with nss-certs
Date: Wed, 29 Dec 2021 18:26:05 +0100
Hello Leo,

> While testing the Guix System installer, I noticed that installation of
> nss-certs has some problems that seem related to locales.

What locale did you pick in the installer?

I think the issue lies in the (gnu installer utils) module, run-command
procedure:

--8<---------------cut here---------------start------------->8---
  (when locale
    (let ((supported? (false-if-exception
                       (setlocale LC_ALL locale))))
      ;; If LOCALE is not supported, then set LANGUAGE, which might at
      ;; least give us translated messages.
      (if supported?
          (setenv "LC_ALL" locale)
          (setenv "LANGUAGE"
                  (string-take locale
                               (or (string-index locale #\_)
                                   (string-length locale)))))))
--8<---------------cut here---------------end--------------->8---

If you pick a locale such as en_AG.utf8 which is not supported by the
glibc-utf8-locales package, then supported? is #f, which means that
LC_ALL is never set.

The following patch fixes it for me.

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm
index bb97bc5560..d745996a3a 100644
--- a/gnu/installer/utils.scm
+++ b/gnu/installer/utils.scm
@@ -97,10 +97,12 @@ (define (pause)
       ;; least give us translated messages.
       (if supported?
           (setenv "LC_ALL" locale)
-          (setenv "LANGUAGE"
-                  (string-take locale
-                               (or (string-index locale #\_)
-                                   (string-length locale)))))))
+          (begin
+            (setlocale LC_ALL "en_US.utf8")
+            (setenv "LANGUAGE"
+                    (string-take locale
+                                 (or (string-index locale #\_)
+                                     (string-length locale))))))))
 
   (guard (c ((invoke-error? c)
              (newline)
--8<---------------cut here---------------end--------------->8---

WDYT?

Thanks,

Mathieu




Information forwarded to bug-guix <at> gnu.org:
bug#52831; Package guix. (Wed, 29 Dec 2021 18:48:01 GMT) Full text and rfc822 format available.

Message #11 received at 52831 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 52831 <at> debbugs.gnu.org
Subject: Re: bug#52831: [installer] Locale problems with nss-certs
Date: Wed, 29 Dec 2021 13:47:47 -0500
On Wed, Dec 29, 2021 at 06:26:05PM +0100, Mathieu Othacehe wrote:
> > While testing the Guix System installer, I noticed that installation of
> > nss-certs has some problems that seem related to locales.
> 
> What locale did you pick in the installer?

I chose the first items in the lists, which are "English" of the
territory "Antigua and Barbuda". That's "en_AG.utf8"

When I use "en_US.utf8", the problem does not occur.

> The following patch fixes it for me.
> 
> --8<---------------cut here---------------start------------->8---
> diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm
> index bb97bc5560..d745996a3a 100644
> --- a/gnu/installer/utils.scm
> +++ b/gnu/installer/utils.scm
> @@ -97,10 +97,12 @@ (define (pause)
>        ;; least give us translated messages.
>        (if supported?
>            (setenv "LC_ALL" locale)
> -          (setenv "LANGUAGE"
> -                  (string-take locale
> -                               (or (string-index locale #\_)
> -                                   (string-length locale)))))))
> +          (begin
> +            (setlocale LC_ALL "en_US.utf8")
> +            (setenv "LANGUAGE"
> +                    (string-take locale
> +                                 (or (string-index locale #\_)
> +                                     (string-length locale))))))))
>  
>    (guard (c ((invoke-error? c)
>               (newline)
> --8<---------------cut here---------------end--------------->8---
> 
> WDYT?

I applied this patch to my Git repo and built a new installer like this:

`./pre-inst-env guix system image -t uncompressed-iso9660 --label="GUIX_x86_64-linux-leo" --system=x86_64-linux gnu/system/install.scm`

Then I copied the image out of the store and booted it in QEMU.

But, I still had the problem during installation. Did I miss a step?




Information forwarded to bug-guix <at> gnu.org:
bug#52831; Package guix. (Wed, 29 Dec 2021 22:03:01 GMT) Full text and rfc822 format available.

Message #14 received at 52831 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Leo Famulari <leo <at> famulari.name>
Cc: 52831 <at> debbugs.gnu.org
Subject: Re: bug#52831: [installer] Locale problems with nss-certs
Date: Wed, 29 Dec 2021 23:02:45 +0100
Hello Leo,

> Then I copied the image out of the store and booted it in QEMU.
>
> But, I still had the problem during installation. Did I miss a step?

No, I just sent you a wrong version of my patch, sorry about
that. LC_ALL needs to be set as an environment variable and with a
setlocale call.

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm
index bb97bc5560..24c16e7e12 100644
--- a/gnu/installer/utils.scm
+++ b/gnu/installer/utils.scm
@@ -97,10 +97,13 @@ (define (pause)
       ;; least give us translated messages.
       (if supported?
           (setenv "LC_ALL" locale)
-          (setenv "LANGUAGE"
-                  (string-take locale
-                               (or (string-index locale #\_)
-                                   (string-length locale)))))))
+          (begin
+            (setlocale LC_ALL "en_US.utf8")
+            (setenv "LC_ALL" "en_US.utf8")
+            (setenv "LANGUAGE"
+                    (string-take locale
+                                 (or (string-index locale #\_)
+                                     (string-length locale))))))))
--8<---------------cut here---------------end--------------->8---

Thanks,

Mathieu




Information forwarded to bug-guix <at> gnu.org:
bug#52831; Package guix. (Thu, 30 Dec 2021 00:12:01 GMT) Full text and rfc822 format available.

Message #17 received at 52831 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 52831 <at> debbugs.gnu.org
Subject: Re: bug#52831: [installer] Locale problems with nss-certs
Date: Wed, 29 Dec 2021 19:11:21 -0500
[Message part 1 (text/plain, inline)]
On Wed, Dec 29, 2021 at 11:02:45PM +0100, Mathieu Othacehe wrote:
> No, I just sent you a wrong version of my patch, sorry about
> that. LC_ALL needs to be set as an environment variable and with a
> setlocale call.
> 
> --8<---------------cut here---------------start------------->8---
> diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm
> index bb97bc5560..24c16e7e12 100644
> --- a/gnu/installer/utils.scm
> +++ b/gnu/installer/utils.scm
> @@ -97,10 +97,13 @@ (define (pause)
>        ;; least give us translated messages.
>        (if supported?
>            (setenv "LC_ALL" locale)
> -          (setenv "LANGUAGE"
> -                  (string-take locale
> -                               (or (string-index locale #\_)
> -                                   (string-length locale)))))))
> +          (begin
> +            (setlocale LC_ALL "en_US.utf8")
> +            (setenv "LC_ALL" "en_US.utf8")
> +            (setenv "LANGUAGE"
> +                    (string-take locale
> +                                 (or (string-index locale #\_)
> +                                     (string-length locale))))))))
> --8<---------------cut here---------------end--------------->8---

Thanks, that does fix the issue with installing nss-certs.

But, now the installer always crashes at the end, after initializing the
system on /mnt, when I "Press Enter to continue". A screenshot of the
error message is attached. I can't scroll down to view more of it.
[installer-crash.png (image/png, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#52831; Package guix. (Thu, 30 Dec 2021 09:38:01 GMT) Full text and rfc822 format available.

Message #20 received at 52831 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Leo Famulari <leo <at> famulari.name>
Cc: 52831 <at> debbugs.gnu.org
Subject: Re: bug#52831: [installer] Locale problems with nss-certs
Date: Thu, 30 Dec 2021 10:37:45 +0100
Hey,

> But, now the installer always crashes at the end, after initializing the
> system on /mnt, when I "Press Enter to continue". A screenshot of the
> error message is attached. I can't scroll down to view more of it.

Oh right, system tests are failing here:
https://ci.guix.gnu.org/eval/19842. Looks like the final umount fails,
that's strange.

Mathieu




Information forwarded to bug-guix <at> gnu.org:
bug#52831; Package guix. (Thu, 30 Dec 2021 11:23:01 GMT) Full text and rfc822 format available.

Message #23 received at 52831 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Leo Famulari <leo <at> famulari.name>
Cc: 52831 <at> debbugs.gnu.org
Subject: Re: bug#52831: [installer] Locale problems with nss-certs
Date: Thu, 30 Dec 2021 12:21:55 +0100
> Oh right, system tests are failing here:
> https://ci.guix.gnu.org/eval/19842. Looks like the final umount fails,
> that's strange.

Found why. Turns out installing the locale was preventing the cow-store
umount. This is now fixed in the wip-harden-installer branch. The
installer tests are passing, and I can use supported (fr_FR.utf8) and
unsupported (en_AG.utf8) locales without hitting the nss-certs copy
issue.

Thanks,

Mathieu




Information forwarded to bug-guix <at> gnu.org:
bug#52831; Package guix. (Thu, 30 Dec 2021 18:13:01 GMT) Full text and rfc822 format available.

Message #26 received at 52831 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 52831 <at> debbugs.gnu.org
Subject: Re: bug#52831: [installer] Locale problems with nss-certs
Date: Thu, 30 Dec 2021 13:11:58 -0500
On Thu, Dec 30, 2021 at 12:21:55PM +0100, Mathieu Othacehe wrote:
> Found why. Turns out installing the locale was preventing the cow-store
> umount. This is now fixed in the wip-harden-installer branch. The
> installer tests are passing, and I can use supported (fr_FR.utf8) and
> unsupported (en_AG.utf8) locales without hitting the nss-certs copy
> issue.

Great, with your latest patch all seems to work well.

The plan is to use wip-harden-installer for the release, right?




Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Thu, 30 Dec 2021 19:35:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Famulari <leo <at> famulari.name>:
bug acknowledged by developer. (Thu, 30 Dec 2021 19:35:02 GMT) Full text and rfc822 format available.

Message #31 received at 52831-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Leo Famulari <leo <at> famulari.name>
Cc: 52831-done <at> debbugs.gnu.org
Subject: Re: bug#52831: [installer] Locale problems with nss-certs
Date: Thu, 30 Dec 2021 20:34:13 +0100
> Great, with your latest patch all seems to work well.
>
> The plan is to use wip-harden-installer for the release, right?

Yup, that's the plan :) In the meantime, I think we can close this one.

Thanks,

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 28 Jan 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.