build-system icon indicating copy to clipboard operation
build-system copied to clipboard

albs-sign-node: albs-sign-node uses English locale explicitly but glibc-langpack-en is not installed in container

Open metalefty opened this issue 1 year ago • 3 comments

albs-sign-node sets LANG=en_US.UTF-8, LC_ALL=en_US.UTF-8.

https://github.com/AlmaLinux/albs-sign-node/blob/5a204601e9de0c8686a9dbbfc4b5bf85517d696b/sign_node/package_sign.py#L53

However, locale for en_US must be installed to use en_US.UTF_8. Signing will fail with the following error if the locale is not installed.

24.02.19 04:29:11 ERROR    [MainThread]: The RPM signing command is failed with 8 exit code.
Command: /bin/bash -c "rpmsign --rpmv3 --resign -D '_gpg_name 6AC72865464F4569' /srv/alternatives/sign_node/2/rpms/58/bzip2-1.0.8-8.el9.src.rpm /srv/alternatives/sign_node/2/rpms/59/bzip2-devel-1.0.8-8.el9.x86_64.rpm /srv/alternatives/sign_node/2/rpms/60/bzip2-static-1.0.8-8.el9.x86_64.rpm /srv/alternatives/sign_node/2/rpms/61/bzip2-1.0.8-8.el9.x86_64.rpm /srv/alternatives/sign_node/2/rpms/62/bzip2-libs-1.0.8-8.el9.x86_64.rpm /srv/alternatives/sign_node/2/rpms/63/bzip2-debugsource-1.0.8-8.el9.x86_64.rpm /srv/alternatives/sign_node/2/rpms/64/bzip2-libs-debuginfo-1.0.8-8.el9.x86_64.rpm /srv/alternatives/sign_node/2/rpms/65/bzip2-debuginfo-1.0.8-8.el9.x86_64.rpm"
Output:
b'/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/srv/alternatives/sign_node/2/rpms/58/bzip2-1.0.8-8.el9.src.rpm:
gpg: signing failed: Required environment variable not set
gpg: signing failed: Required environment variable not set
error: gpg exec failed (2)

metalefty avatar Feb 19 '24 05:02 metalefty

I'm not sure this issue is related to missing locales, LC_ALL should be fine AFAIK, isn't it?

javihernandez avatar Feb 20 '24 07:02 javihernandez

The problem is LANG LC_ALL is set to en_US.UTF-8 although English locale glibc-langpack-en is not installed. en_US.* requires glibc-langpack-en.

metalefty avatar Feb 20 '24 07:02 metalefty

See: https://github.com/AlmaLinux/albs-sign-node/pull/57#issuecomment-1953733552

metalefty avatar Feb 20 '24 08:02 metalefty