unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs
@ 2020-08-25 10:43 Adam Griffiths
  2020-08-27  1:21 ` conjaroy
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Adam Griffiths @ 2020-08-25 10:43 UTC (permalink / raw)
  To: 43039

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

After installing GuixSD 1.1.0 into a VirtualBox VM and following the After
System Installation steps (
https://guix.gnu.org/manual/en/html_node/After-System-Installation.html#After-System-Installation),
the update fails when trying to update nss-certs.

Possibly related to  #37662 <https://issues.guix.gnu.org/37662>

Error:

$ guix pull
Migrating profile generations to '/var/guix/profiles/per-user/adam'...
Updating channel 'guix' from Git repository at '
https://git.savannah.gnu.org/git/guix.git'...
<snip>
$ sudo guix system reconfigure /etc/config.scm
<sudo warning snipped>
guile: warning: failed to install locale
hint: Consider installing the `glibc-utf8-locales' or `glibc-locales'
package and defining
`GUIX_LOCPATH', along these lines:

     guix package -i glibc-utf8-locales
     export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"

See the "Application Setup" section in the manual, for more info.

guix system: warning: cannot determine provenance for current system
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%

<snip>

downloading from
https://ci.guix.gnu.org/nar/lzip/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1
...
 nss-certs-3.52.1  133KiB                                    186KiB/s 00:00
[########          ]  48.3%
Backtrace:
           3 (apply-smob/1 #<catch-closure 7f10d4c80120>)
In ice-9/boot-9.scm:
    705:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
In ice-9/eval.scm:
    619:8  1 (_ #(#(#<directory (guile-user) 7f10d490e140>)))
In guix/ui.scm:
  1936:12  0 (run-guix-command _ . _)

guix/ui.scm:1936:12: In procedure run-guix-command:
Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert
wide string to output locale" 84 #f #f)'.
substitution of
/gnu/store/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1 failed
killing process 5266
guix system: error: some substitutes for the outputs of derivation
`/gnu/store/55mphxd7fz9km07s2zy1x26vcljh6yb5-nss-certs-3.52.1.drv' failed
(usually happens due to networking issues); try `--fallback' to build
derivation from source

The error is always when installing nss-certs, is entirely repeatable, and
therefore not to do with a network connection.

I tried this about 4 months previous, and again today, and have been
presented with exactly the same error.

The error always occurs at 48.3%.

A post on Reddit (
https://www.reddit.com/r/GUIX/comments/hxrmzn/guix_system_error/) has the
exact same error as this. The error even occurred at the same 48.3%!

I selected the Australian Locale (en_AU) during this installation. I am
unsure why the locales error is present after installation. I ran the
commands it suggested last time and the warning did not disappear, nor did
the nss-certs error get resolved.

I can run --fallback, but to me this is ignoring an obvious issue with a
vanilla system that should work out of the box.

Steps to reproduce:

* Create new VBox VM
  *   Install GuixSD Graphical
  *   Select Australia locale
  *   Select defaults
  *   boot into the system
  *  $ guix pull
  *  $ sudo guix system reconfigure /etc/config.scm

Original post
https://superuser.com/questions/1580209/vanilla-guix-1-1-0-reconfigure-fails-on-nss-certs

[-- Attachment #2: Type: text/html, Size: 4141 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs
  2020-08-25 10:43 bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs Adam Griffiths
@ 2020-08-27  1:21 ` conjaroy
  2020-08-28 14:05 ` Ludovic Courtès
       [not found] ` <handler.43039.D43039.159906009821340.notifdone@debbugs.gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: conjaroy @ 2020-08-27  1:21 UTC (permalink / raw)
  To: 43039

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

An older bug (https://issues.guix.info/issue/37662) discusses a similar
issue, but for a foreign distro with Guix installed (not a native Guix
distribution).

That bug mentions two things:

- make sure that either ‘glibc-utf8-locales’ or ‘glibc-locales’ is
installed (as root)
- make sure that the GUIX daemon is configured to use a UTF locale so it
can handle the UTF-encoded filenames in the nss-certs package.

I'm not sure whether these issues apply to a native Guix distribution. What
I do know is that when I encountered the error myself (running Guix on
Debian 10) I needed one additional thing: the environment of the user
installing the package had to include a UTF locale. After switching this
environment from LANG=C to LANG=en_US.utf8, the package installed without
issue.

[-- Attachment #2: Type: text/html, Size: 979 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs
  2020-08-25 10:43 bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs Adam Griffiths
  2020-08-27  1:21 ` conjaroy
@ 2020-08-28 14:05 ` Ludovic Courtès
  2020-08-29  3:10   ` Adam Griffiths
       [not found] ` <handler.43039.D43039.159906009821340.notifdone@debbugs.gnu.org>
  2 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2020-08-28 14:05 UTC (permalink / raw)
  To: Adam Griffiths; +Cc: 43039

Hi Adam,

Thanks for taking the time to report the bug here!  It’s more likely to
be seen and addressed than on external fora—much appreciated.

Adam Griffiths <adam.lw.griffiths@gmail.com> skribis:

> After installing GuixSD 1.1.0 into a VirtualBox VM and following the After
> System Installation steps (
> https://guix.gnu.org/manual/en/html_node/After-System-Installation.html#After-System-Installation),
> the update fails when trying to update nss-certs.
>
> Possibly related to  #37662 <https://issues.guix.gnu.org/37662>
>
> Error:
>
> $ guix pull
> Migrating profile generations to '/var/guix/profiles/per-user/adam'...
> Updating channel 'guix' from Git repository at '
> https://git.savannah.gnu.org/git/guix.git'...
> <snip>

I got rid of the “Migrating profile” messages, which was confusing:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=0c9d22c13fef9056413338293747c0d32f0cd5a4

> $ sudo guix system reconfigure /etc/config.scm
> <sudo warning snipped>
> guile: warning: failed to install locale
> hint: Consider installing the `glibc-utf8-locales' or `glibc-locales'
> package and defining
> `GUIX_LOCPATH', along these lines:
>
>      guix package -i glibc-utf8-locales
>      export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
>
> See the "Application Setup" section in the manual, for more info.
>
> guix system: warning: cannot determine provenance for current system
> substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%

That, I don’t understand.  I tried to reproduce it by downloading
<https://ftp.gnu.org/gnu/guix/guix-system-vm-image-1.1.0.x86_64-linux.xz>
(which is essentially the result of installing Guix System from 1.1.0).
I ran ‘guix pull’ (which took a lot of time…) and then ‘guix system
reconfigure’.  ‘guix system reconfigure’ would only emit the one-liner:

  warning: failed to install locale

and not the hint about GUIX_LOCPATH, and then it just went ahead.

What locale does your system use?  You can type “env | grep LC_” to see.

(The ‘guix’ command provided by ‘guix pull’ comes with
‘glibc-utf8-locales’ since commit
ba48895899a117d6ace2209c3f54411a4a989133, but the locale you’re using
could be missing from that.)

> downloading from
> https://ci.guix.gnu.org/nar/lzip/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1
> ...
>  nss-certs-3.52.1  133KiB                                    186KiB/s 00:00
> [########          ]  48.3%
> Backtrace:
>            3 (apply-smob/1 #<catch-closure 7f10d4c80120>)
> In ice-9/boot-9.scm:
>     705:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
> In ice-9/eval.scm:
>     619:8  1 (_ #(#(#<directory (guile-user) 7f10d490e140>)))
> In guix/ui.scm:
>   1936:12  0 (run-guix-command _ . _)
>
> guix/ui.scm:1936:12: In procedure run-guix-command:
> Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert
> wide string to output locale" 84 #f #f)'.
> substitution of
> /gnu/store/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1 failed

This is really puzzling: guix-daemon is always running in a valid UTF-8
locale, as can be seen like this:

--8<---------------cut here---------------start------------->8---
$ sudo herd status guix-daemon
Status of guix-daemon:
  It is started.
  Running value is 29814.
  It is enabled.
  Provides (guix-daemon).
  Requires (user-processes).
  Conflicts with ().
  Will be respawned.
$ sudo cat /proc/29814/environ |tr '\0' '\n' 
GUIX_LOCPATH=/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31/lib/locale
LC_ALL=en_US.utf8
--8<---------------cut here---------------end--------------->8---

However, I just realized that ‘guix substitute’ switches to the client’s
locale:

--8<---------------cut here---------------start------------->8---
  ;; Attempt to install the client's locale, mostly so that messages are
  ;; suitably translated.
  (match (or (find-daemon-option "untrusted-locale")
             (find-daemon-option "locale"))
    (#f     #f)
    (locale (false-if-exception (setlocale LC_ALL locale))))
--8<---------------cut here---------------end--------------->8---

Thus, if the client is running in a non-UTF-8 locale, we can end up with
the error you report.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs
  2020-08-28 14:05 ` Ludovic Courtès
@ 2020-08-29  3:10   ` Adam Griffiths
  2020-09-02 15:21     ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Adam Griffiths @ 2020-08-29  3:10 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 43039

Hey Ludo,

Thanks for getting back to me, responses are inline below.

FYI, I'm planning to format the host (Guix is inside VirtualBox) and
may not be able to assist for a period.
I literally just installed Guix into Virtual Box with the defaults,
selecting Australia / Melbourne where the option presented itself.
The only other change was enabling sshd, but regardless the issue
presents itself.
That should be enough to replicate, otherwise I'll be able to assist
further when I have my system back up.

Cheers,
Adam

> > $ sudo guix system reconfigure /etc/config.scm
> > <sudo warning snipped>
> > guile: warning: failed to install locale
> > hint: Consider installing the `glibc-utf8-locales' or `glibc-locales'
> > package and defining
> > `GUIX_LOCPATH', along these lines:
> >
> >      guix package -i glibc-utf8-locales
> >      export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
> >
> > See the "Application Setup" section in the manual, for more info.
> >
> > guix system: warning: cannot determine provenance for current system
> > substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
>
> That, I don’t understand.  I tried to reproduce it by downloading
> <https://ftp.gnu.org/gnu/guix/guix-system-vm-image-1.1.0.x86_64-linux.xz>
> (which is essentially the result of installing Guix System from 1.1.0).
> I ran ‘guix pull’ (which took a lot of time…) and then ‘guix system
> reconfigure’.  ‘guix system reconfigure’ would only emit the one-liner:
>
>   warning: failed to install locale
>
> and not the hint about GUIX_LOCPATH, and then it just went ahead.
>
> What locale does your system use?  You can type “env | grep LC_” to see.
>

I'm using en_AU

$ env | grep GUIX
GUIX_LOCPATH=/run/current-system/locale
GUIX_GTK3_PATH=/run/current-system/profile/lib/gtk-3.0
$ env | grep LC_
$

Here's my system configuration, it should be straight out of the installer.

adam@Hetzer ~$ cat /etc/config.scm
;; This is an operating system configuration generated
;; by the graphical installer.

(use-modules (gnu))
(use-service-modules desktop networking ssh xorg)

(operating-system
  (locale "en_AU.utf8")
  (timezone "Australia/Melbourne")
  (keyboard-layout (keyboard-layout "au"))
  (host-name "Hetzer")
  (users (cons* (user-account
                  (name "adam")
                  (comment "Adam Griffiths")
                  (group "users")
                  (home-directory "/home/adam")
                  (supplementary-groups
                    '("wheel" "netdev" "audio" "video")))
                %base-user-accounts))
  (packages
    (append
      (list (specification->package "nss-certs"))
      %base-packages))
  (services
    (append
      (list (service gnome-desktop-service-type)
            (service openssh-service-type)
            (set-xorg-configuration
              (xorg-configuration
                (keyboard-layout keyboard-layout))))
      %desktop-services))
  (bootloader
    (bootloader-configuration
      (bootloader grub-bootloader)
      (target "/dev/sda")
      (keyboard-layout keyboard-layout)))
  (swap-devices (list "/dev/sda2"))
  (file-systems
    (cons* (file-system
             (mount-point "/")
             (device
               (uuid "908e25d3-f03b-4808-8f1c-8f922e16408c"
                     'ext4))
             (type "ext4"))
           %base-file-systems)))


>
> (The ‘guix’ command provided by ‘guix pull’ comes with
> ‘glibc-utf8-locales’ since commit
> ba48895899a117d6ace2209c3f54411a4a989133, but the locale you’re using
> could be missing from that.)
>
> > downloading from
> > https://ci.guix.gnu.org/nar/lzip/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1
> > ...
> >  nss-certs-3.52.1  133KiB                                    186KiB/s 00:00
> > [########          ]  48.3%
> > Backtrace:
> >            3 (apply-smob/1 #<catch-closure 7f10d4c80120>)
> > In ice-9/boot-9.scm:
> >     705:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
> > In ice-9/eval.scm:
> >     619:8  1 (_ #(#(#<directory (guile-user) 7f10d490e140>)))
> > In guix/ui.scm:
> >   1936:12  0 (run-guix-command _ . _)
> >
> > guix/ui.scm:1936:12: In procedure run-guix-command:
> > Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert
> > wide string to output locale" 84 #f #f)'.
> > substitution of
> > /gnu/store/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1 failed
>
> This is really puzzling: guix-daemon is always running in a valid UTF-8
> locale, as can be seen like this:
>
> --8<---------------cut here---------------start------------->8---
> $ sudo herd status guix-daemon
> Status of guix-daemon:
>   It is started.
>   Running value is 29814.
>   It is enabled.
>   Provides (guix-daemon).
>   Requires (user-processes).
>   Conflicts with ().
>   Will be respawned.
> $ sudo cat /proc/29814/environ |tr '\0' '\n'
> GUIX_LOCPATH=/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31/lib/locale
> LC_ALL=en_US.utf8
> --8<---------------cut here---------------end--------------->8---

$ sudo herd status guix-daemon
Password:
Status of guix-daemon:
  It is started.
  Running value is 229.
  It is enabled.
  Provides (guix-daemon).
  Requires (user-processes).
  Conflicts with ().
  Will be respawned.
$ sudo cat /proc/229/environ | tr '\0' '\n'
GUIX_LOCPATH=/gnu/store/n79cf8bvy3k96gjk1rf18d36w40lkwlr-glibc-utf8-locales-2.29/lib/locale
LC_ALL=en_US.utf8

Shouldn't this be en_AU.utf8? Or at least en_GB.utf8?

There is an en_AU locale available:
$ ls /run/current-system/locale/2.29/en_AU.utf8/LC_MESSAGES/
SYS_LC_MESSAGES

I notice there's also 2 en_US locales:

$ /run/current-system/locale/2.29/en_US.
en_US.utf8/  en_US.UTF-8/

The locales all _appear_ to be there

$ ls /run/current-system/locale/2.29/en_*/
/run/current-system/locale/2.29/en_AU.utf8/:
LC_ADDRESS  LC_CTYPE           LC_MEASUREMENT  LC_MONETARY  LC_NUMERIC
 LC_TELEPHONE
LC_COLLATE  LC_IDENTIFICATION  LC_MESSAGES/    LC_NAME      LC_PAPER    LC_TIME

/run/current-system/locale/2.29/en_CA.utf8/:
LC_ADDRESS  LC_CTYPE           LC_MEASUREMENT  LC_MONETARY  LC_NUMERIC
 LC_TELEPHONE
LC_COLLATE  LC_IDENTIFICATION  LC_MESSAGES/    LC_NAME      LC_PAPER    LC_TIME

/run/current-system/locale/2.29/en_GB.utf8/:
LC_ADDRESS  LC_CTYPE           LC_MEASUREMENT  LC_MONETARY  LC_NUMERIC
 LC_TELEPHONE
LC_COLLATE  LC_IDENTIFICATION  LC_MESSAGES/    LC_NAME      LC_PAPER    LC_TIME

/run/current-system/locale/2.29/en_US.utf8/:
LC_ADDRESS  LC_CTYPE           LC_MEASUREMENT  LC_MONETARY  LC_NUMERIC
 LC_TELEPHONE
LC_COLLATE  LC_IDENTIFICATION  LC_MESSAGES/    LC_NAME      LC_PAPER    LC_TIME

/run/current-system/locale/2.29/en_US.UTF-8/:
LC_ADDRESS  LC_CTYPE           LC_MEASUREMENT  LC_MONETARY  LC_NUMERIC
 LC_TELEPHONE
LC_COLLATE  LC_IDENTIFICATION  LC_MESSAGES/    LC_NAME      LC_PAPER    LC_TIME



But the contents of the LC_MESSAGES directories differ.

$ ls /run/current-system/locale/2.29/en_*/**
/run/current-system/locale/2.29/en_AU.utf8/LC_ADDRESS
/run/current-system/locale/2.29/en_AU.utf8/LC_COLLATE
/run/current-system/locale/2.29/en_AU.utf8/LC_CTYPE
/run/current-system/locale/2.29/en_AU.utf8/LC_IDENTIFICATION
/run/current-system/locale/2.29/en_AU.utf8/LC_MEASUREMENT
/run/current-system/locale/2.29/en_AU.utf8/LC_MONETARY
/run/current-system/locale/2.29/en_AU.utf8/LC_NAME
/run/current-system/locale/2.29/en_AU.utf8/LC_NUMERIC
/run/current-system/locale/2.29/en_AU.utf8/LC_PAPER
/run/current-system/locale/2.29/en_AU.utf8/LC_TELEPHONE
/run/current-system/locale/2.29/en_AU.utf8/LC_TIME
/run/current-system/locale/2.29/en_CA.utf8/LC_ADDRESS
/run/current-system/locale/2.29/en_CA.utf8/LC_COLLATE
/run/current-system/locale/2.29/en_CA.utf8/LC_CTYPE
/run/current-system/locale/2.29/en_CA.utf8/LC_IDENTIFICATION
/run/current-system/locale/2.29/en_CA.utf8/LC_MEASUREMENT
/run/current-system/locale/2.29/en_CA.utf8/LC_MONETARY
/run/current-system/locale/2.29/en_CA.utf8/LC_NAME
/run/current-system/locale/2.29/en_CA.utf8/LC_NUMERIC
/run/current-system/locale/2.29/en_CA.utf8/LC_PAPER
/run/current-system/locale/2.29/en_CA.utf8/LC_TELEPHONE
/run/current-system/locale/2.29/en_CA.utf8/LC_TIME
/run/current-system/locale/2.29/en_GB.utf8/LC_ADDRESS
/run/current-system/locale/2.29/en_GB.utf8/LC_COLLATE
/run/current-system/locale/2.29/en_GB.utf8/LC_CTYPE
/run/current-system/locale/2.29/en_GB.utf8/LC_IDENTIFICATION
/run/current-system/locale/2.29/en_GB.utf8/LC_MEASUREMENT
/run/current-system/locale/2.29/en_GB.utf8/LC_MONETARY
/run/current-system/locale/2.29/en_GB.utf8/LC_NAME
/run/current-system/locale/2.29/en_GB.utf8/LC_NUMERIC
/run/current-system/locale/2.29/en_GB.utf8/LC_PAPER
/run/current-system/locale/2.29/en_GB.utf8/LC_TELEPHONE
/run/current-system/locale/2.29/en_GB.utf8/LC_TIME
/run/current-system/locale/2.29/en_US.utf8/LC_ADDRESS
/run/current-system/locale/2.29/en_US.UTF-8/LC_ADDRESS
/run/current-system/locale/2.29/en_US.utf8/LC_COLLATE
/run/current-system/locale/2.29/en_US.UTF-8/LC_COLLATE
/run/current-system/locale/2.29/en_US.utf8/LC_CTYPE
/run/current-system/locale/2.29/en_US.UTF-8/LC_CTYPE
/run/current-system/locale/2.29/en_US.utf8/LC_IDENTIFICATION
/run/current-system/locale/2.29/en_US.UTF-8/LC_IDENTIFICATION
/run/current-system/locale/2.29/en_US.utf8/LC_MEASUREMENT
/run/current-system/locale/2.29/en_US.UTF-8/LC_MEASUREMENT
/run/current-system/locale/2.29/en_US.utf8/LC_MONETARY
/run/current-system/locale/2.29/en_US.UTF-8/LC_MONETARY
/run/current-system/locale/2.29/en_US.utf8/LC_NAME
/run/current-system/locale/2.29/en_US.UTF-8/LC_NAME
/run/current-system/locale/2.29/en_US.utf8/LC_NUMERIC
/run/current-system/locale/2.29/en_US.UTF-8/LC_NUMERIC
/run/current-system/locale/2.29/en_US.utf8/LC_PAPER
/run/current-system/locale/2.29/en_US.UTF-8/LC_PAPER
/run/current-system/locale/2.29/en_US.utf8/LC_TELEPHONE
/run/current-system/locale/2.29/en_US.UTF-8/LC_TELEPHONE
/run/current-system/locale/2.29/en_US.utf8/LC_TIME
/run/current-system/locale/2.29/en_US.UTF-8/LC_TIME

/run/current-system/locale/2.29/en_AU.utf8/LC_MESSAGES:
SYS_LC_MESSAGES

/run/current-system/locale/2.29/en_CA.utf8/LC_MESSAGES:
SYS_LC_MESSAGES

/run/current-system/locale/2.29/en_GB.utf8/LC_MESSAGES:
SYS_LC_MESSAGES

/run/current-system/locale/2.29/en_US.utf8/LC_MESSAGES:
SYS_LC_MESSAGES

/run/current-system/locale/2.29/en_US.UTF-8/LC_MESSAGES:
SYS_LC_MESSAGES

Is this correct?
At first glance (with no knowledge of how the locales work) I would
assume that en_AU and en_CA overlay onto en_GB.
But even en_GB is effectively empty, which would contradict that assumption.


>
> However, I just realized that ‘guix substitute’ switches to the client’s
> locale:
>
> --8<---------------cut here---------------start------------->8---
>   ;; Attempt to install the client's locale, mostly so that messages are
>   ;; suitably translated.
>   (match (or (find-daemon-option "untrusted-locale")
>              (find-daemon-option "locale"))
>     (#f     #f)
>     (locale (false-if-exception (setlocale LC_ALL locale))))
> --8<---------------cut here---------------end--------------->8---
>
> Thus, if the client is running in a non-UTF-8 locale, we can end up with
> the error you report.
>
> Thanks,
> Ludo’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs
  2020-08-29  3:10   ` Adam Griffiths
@ 2020-09-02 15:21     ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2020-09-02 15:21 UTC (permalink / raw)
  To: Adam Griffiths; +Cc: 43039-done

Hi Adam,

Adam Griffiths <adam.lw.griffiths@gmail.com> skribis:

>> > $ sudo guix system reconfigure /etc/config.scm
>> > <sudo warning snipped>
>> > guile: warning: failed to install locale
>> > hint: Consider installing the `glibc-utf8-locales' or `glibc-locales'
>> > package and defining
>> > `GUIX_LOCPATH', along these lines:
>> >
>> >      guix package -i glibc-utf8-locales
>> >      export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
>> >
>> > See the "Application Setup" section in the manual, for more info.
>> >
>> > guix system: warning: cannot determine provenance for current system
>> > substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
>>
>> That, I don’t understand.  I tried to reproduce it by downloading
>> <https://ftp.gnu.org/gnu/guix/guix-system-vm-image-1.1.0.x86_64-linux.xz>
>> (which is essentially the result of installing Guix System from 1.1.0).
>> I ran ‘guix pull’ (which took a lot of time…) and then ‘guix system
>> reconfigure’.  ‘guix system reconfigure’ would only emit the one-liner:
>>
>>   warning: failed to install locale
>>
>> and not the hint about GUIX_LOCPATH, and then it just went ahead.
>>
>> What locale does your system use?  You can type “env | grep LC_” to see.
>>
>
> I'm using en_AU

[...]

>> (The ‘guix’ command provided by ‘guix pull’ comes with
>> ‘glibc-utf8-locales’ since commit
>> ba48895899a117d6ace2209c3f54411a4a989133, but the locale you’re using
>> could be missing from that.)
>>
>> > downloading from
>> > https://ci.guix.gnu.org/nar/lzip/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1
>> > ...
>> >  nss-certs-3.52.1  133KiB                                    186KiB/s 00:00
>> > [########          ]  48.3%
>> > Backtrace:
>> >            3 (apply-smob/1 #<catch-closure 7f10d4c80120>)
>> > In ice-9/boot-9.scm:
>> >     705:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
>> > In ice-9/eval.scm:
>> >     619:8  1 (_ #(#(#<directory (guile-user) 7f10d490e140>)))
>> > In guix/ui.scm:
>> >   1936:12  0 (run-guix-command _ . _)
>> >
>> > guix/ui.scm:1936:12: In procedure run-guix-command:
>> > Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert
>> > wide string to output locale" 84 #f #f)'.
>> > substitution of
>> > /gnu/store/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1 failed
>>
>> This is really puzzling: guix-daemon is always running in a valid UTF-8
>> locale, as can be seen like this:

Not quite true; I understand what was going on, details below.

The workaround for you in the meantime is to run:

  guix build nss-certs --no-substitutes

before you run ‘sudo guix system reconfigure’.


The client ‘guix system’ in this case was running in the “C” locale
because “en_AU.utf8” is not among the locales in ‘glibc-utf8-locales’,
which is what’s bundled with ‘guix’.

Thus, ‘set-build-options’ in (guix store) would send “C” as the “locale”
property.  Then, ‘guix substitute’ would do (setlocale LC_ALL "C"), from
this code:

  ;; Attempt to install the client's locale, mostly so that messages are
  ;; suitably translated.
  (match (or (find-daemon-option "untrusted-locale")
             (find-daemon-option "locale"))
    (#f     #f)
    (locale (false-if-exception (setlocale LC_ALL locale))))

Consequently, it would run in a ASCII locale and would thus fail to
decode non-ASCII file names that appear in nss-certs.

Similar problems could occur anytime someone runs a client in a
non-UTF-8 locale.  One way to reproduce it for me is this (I use
‘time-machine’ to get a version of ‘nss-certs’ not already available on
my disk):

--8<---------------cut here---------------start------------->8---
$ LC_ALL=C guix time-machine --commit=8aeef3c7bdf278003892e608842200d3a35211c7 -- build nss-certs 
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
0.1 MB will be downloaded:
   /gnu/store/igklwlj1j60kdgrhcn6m2p2iqp87qrrs-nss-certs-3.52
substituting /gnu/store/igklwlj1j60kdgrhcn6m2p2iqp87qrrs-nss-certs-3.52...
downloading from https://ci.guix.gnu.org/nar/lzip/igklwlj1j60kdgrhcn6m2p2iqp87qrrs-nss-certs-3.52 ...
 nss-certs-3.52  133KiB                                                   1.9MiB/s 00:00 [########          ]  48.3%Backtrace:
In ice-9/boot-9.scm:
  1736:10  4 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
           3 (apply-smob/0 #<thunk 7fd27a60c200>)
In ice-9/boot-9.scm:
    718:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
In ice-9/eval.scm:
    619:8  1 (_ #(#(#<directory (guile-user) 7fd27a230f00>)))
In guix/ui.scm:
  2046:12  0 (run-guix-command _ . _)

guix/ui.scm:2046:12: In procedure run-guix-command:
Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert wide string to output locale" 84 #f #f)'.
substitution of /gnu/store/igklwlj1j60kdgrhcn6m2p2iqp87qrrs-nss-certs-3.52 failed
guix build: error: some substitutes for the outputs of derivation `/gnu/store/mzrh9ad4sqqg88ym9c1x1vv2lqjyxbrv-nss-certs-3.52.drv' failed (usually happens due to networking issues); try `--fallback' to build derivation from source 
--8<---------------cut here---------------end--------------->8---

This is fixed by commit 739f6309478d8ab8501bb653ceb2f634c8560f55, with
two additional improvements:

  fe4e770fc1 ui: Attempt to fall back to "en_US.utf8" rather than "C".
  739f630947 store: 'set-build-options' sends LC_MESSAGES, not LC_ALL.
  aba8def46d substitute: Set LC_MESSAGES to the client's locale, not LC_ALL.

I’ll update the ‘guix’ package so that the changes to ‘guix substitute’
take effect.

Thanks again for reporting the issue!

Ludo’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43039: closed (Re: bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs)
       [not found] ` <handler.43039.D43039.159906009821340.notifdone@debbugs.gnu.org>
@ 2020-09-02 23:57   ` Adam Griffiths
  0 siblings, 0 replies; 6+ messages in thread
From: Adam Griffiths @ 2020-09-02 23:57 UTC (permalink / raw)
  To: 43039

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

Great!
Thanks for looking into it.

On Wed, Sep 2, 2020 at 3:22 pm, GNU bug Tracking System 
<help-debbugs@gnu.org> wrote:
> Your bug report
> 
> #43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs
> 
> which was filed against the guix package, has been closed.
> 
> The explanation is attached below, along with your original report.
> If you require more details, please reply to 43039@debbugs.gnu.org 
> <mailto:43039@debbugs.gnu.org>.
> 
> --
> 43039: <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43039>
> GNU Bug Tracking System
> Contact help-debbugs@gnu.org <mailto:help-debbugs@gnu.org> with 
> problems


[-- Attachment #2: Type: text/html, Size: 892 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-02 23:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 10:43 bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs Adam Griffiths
2020-08-27  1:21 ` conjaroy
2020-08-28 14:05 ` Ludovic Courtès
2020-08-29  3:10   ` Adam Griffiths
2020-09-02 15:21     ` Ludovic Courtès
     [not found] ` <handler.43039.D43039.159906009821340.notifdone@debbugs.gnu.org>
2020-09-02 23:57   ` bug#43039: closed (Re: bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs) Adam Griffiths

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).