Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2072550

Summary: Leapp fails when the LANGUAGE env variable is set in another language
Product: Red Hat Enterprise Linux 7 Reporter: Christophe Besson <cbesson>
Component: leapp-repositoryAssignee: Ina <ivasilev>
Status: CLOSED ERRATA QA Contact: Upgrades and Supportability <upgrades-and-supportability>
Severity: low Docs Contact:
Priority: low    
Version: 7.9CC: mhecko, mmacura, mmoran, mreznik, pstodulk
Target Milestone: rcKeywords: Patch, Reproducer, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: leapp-repository-0.17.0-1.el7_9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-09 12:33:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christophe Besson 2022-04-06 13:53:09 UTC
Description of problem:
The $LANGUAGE environment variable takes precedence over $LANG and $LC_ALL, causing the issue.

Version-Release number of selected component (if applicable):
leapp-0.13.0-1

How reproducible:
Always

Steps to Reproduce:
# export LANGUAGE=French_France.WE8ISO8859P1
# leapp preupgrade

Actual results:
Leapp reports the system as not registered.

Additional info:
--- /usr/lib/python2.7/site-packages/leapp/cli/commands/preupgrade/__init__.py.orig	2022-04-06 15:47:16.154240697 +0200
+++ /usr/lib/python2.7/site-packages/leapp/cli/commands/preupgrade/__init__.py	2022-04-06 15:47:43.773767851 +0200
@@ -53,6 +53,7 @@
         logger.info('Executing workflow until phase: %s', until_phase)
 
         # Set the locale, so that the actors parsing command outputs that might be localized will not fail
+        os.environ['LANGUAGE'] = 'en_US.UTF-8'
         os.environ['LC_ALL'] = 'en_US.UTF-8'
         os.environ['LANG'] = 'en_US.UTF-8'
         workflow.run(context=context, until_phase=until_phase, skip_dialogs=True)

--- /usr/lib/python2.7/site-packages/leapp/cli/commands/upgrade/__init__.py.orig	2022-04-06 15:47:26.329434905 +0200
+++ /usr/lib/python2.7/site-packages/leapp/cli/commands/upgrade/__init__.py	2022-04-06 15:48:03.893151861 +0200
@@ -81,6 +81,7 @@
         workflow.load_answers(answerfile_path, userchoices_path)
 
         # Set the locale, so that the actors parsing command outputs that might be localized will not fail
+        os.environ['LANGUAGE'] = 'en_US.UTF-8'
         os.environ['LC_ALL'] = 'en_US.UTF-8'
         os.environ['LANG'] = 'en_US.UTF-8'
         workflow.run(context=context, skip_phases_until=skip_phases_until, skip_dialogs=True,

Comment 3 Petr Stodulka 2022-04-06 14:07:54 UTC
Thank you Chris for the report. We even didn't know about this one. Happy to learn something new and thanks for the investigation!!

Comment 4 Christophe Besson 2022-04-06 14:12:08 UTC
Hi Petr, I have to admit I didn't know it too before taking a strace of leapp on their system :)

Comment 6 Michal Reznik 2022-05-04 15:19:44 UTC
Fixed in https://github.com/oamg/leapp-repository/pull/887

Comment 10 Christophe Besson 2022-09-05 12:54:25 UTC
Adding another case.
The LANGUAGE var was not defined on the server itself, but it was propagated via the ssh connection from a personal laptop which is localized.

Comment 13 errata-xmlrpc 2022-11-09 12:33:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (leapp and leapp-repository bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7895