ubuntu-drivers crashes in python3-click when ubiquity runs the Polish language (locale)

Bug #1943614 reported by Łukasz Zemczak
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Łukasz Zemczak
ubuntu-drivers-common (Ubuntu)
Fix Released

Bug Description


Ok, first of all - I am unsure if this is a regression or not, since I did not test extra drivers with old images. I'm testing this on kvm now.
So far this bug appeared for me when I was running ubiquity with secureboot enabled on a NVidia GPU machine.
Note: this only happens when the language selection is done on the Ubiquity screen. If you get the language right in the isolinux menu, everything works.

Basically when installing Ubuntu desktop on a system that uses ubuntu-drivers but using a non-standard locale (like in my case, the Polish language from the language selector), ubuntu-drivers will crash with:

Traceback (most recent call last):
  File "/usr/bin/ubuntu-drivers", line 480, in <module>
  File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 676, in main
  File "/usr/lib/python3/dist-packages/click/_unicodefun.py", line 118, in _verify_python3_env
    'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult http://click.pocoo.org/python3/for mitigation steps.

This system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:

    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8

Click discovered that you exported a UTF-8 locale
but the locale system could not pick up from it because
it does not exist. The exported locale is "pl_PL.UTF-8" but it
is not supported
ubuntu-drivers autoinstall failed with code: 1

[Test Case]

* Download latest 18.04.6 candidate image for ubuntu-desktop
* In language selector, select Polish (Polski)
* Proceed with the installation and checking "Install third-party software..."
* Boot into the installed system
* Check if `ubuntu-drivers install ...` succeeded during installation, checking the installer syslog.

description: updated
Changed in ubiquity (Ubuntu Bionic):
importance: Undecided → Critical
Changed in ubiquity (Ubuntu):
status: New → Invalid
Changed in ubiquity (Ubuntu Bionic):
status: New → Confirmed
assignee: nobody → Łukasz Zemczak (sil2100)
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

This can be also easily checked on kvm without doing a full install. Just boot up the image, wait for ubiquity to pop up, select the language, select installing. Then check the third party drivers (disable updates from internet), click Next. Then switch to another terminal, log in as 'ubuntu' and check /var/lib/syslog - you should see that ubuntu-drivers crashed with the error above. It looks like ubiquity doesn't set the locale fully?

description: updated
Revision history for this message
Steve Langasek (vorlon) wrote :
Revision history for this message
Steve Langasek (vorlon) wrote :

(ubiquity should be setting up the locale properly before this point; but ubuntu-drivers shouldn't be crashing either.)

summary: - ubuntu-drivers crashes due to click when ubiquity runs the Polish
+ ubuntu-drivers crashes in python3-click when ubiquity runs the Polish
language (locale)
Revision history for this message
Steve Langasek (vorlon) wrote :

This is not an issue in later Ubuntu releases due to a behavior change in python itself: it will apparently now fall back to C.UTF-8 if the locale is invalid.

Changed in ubuntu-drivers-common (Ubuntu):
status: New → Invalid
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Łukasz, or anyone else affected,

Accepted ubuntu-drivers-common into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-drivers-common/1: in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ubuntu-drivers-common (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Brian Murray (brian-murray) wrote :

I tested this using Steve's more minimal test case from #ubuntu-release (https://irclogs.ubuntu.com/2021/09/14/%23ubuntu-release.html#t16:25) and did not receive a crash with the version of ubuntu-drivers-common from -proposed.

Setting up ubuntu-drivers-common (1: ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
(bionic-amd64)root@impulse:/home/bdmurray/# LANG=pl_PL.UTF-8 ubuntu-drivers autoinstall WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Tested this (version 1: with the main testcase and it seems to work as expected.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-drivers-common - 1:

ubuntu-drivers-common (1: bionic; urgency=medium

  [ Steve Langasek ]
  * Don't crash on invalid locale environment. LP: #1943614.

 -- Łukasz 'sil2100' Zemczak <email address hidden> Tue, 14 Sep 2021 21:03:06 +0200

Changed in ubuntu-drivers-common (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for ubuntu-drivers-common has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.