I've just re-done the testing on focal and jammy and shown that it still
exists, but does require one step that was not very clear in the testing
plan.
When running `sudo dpkg-reconfigure locales` on a freshly created LXD
container of focal or jammy, not only do you need to select en_GB.UTF-8,
you need to _unselect_ en_US.UTF-8. Essentially en_GB.UTF-8 needs to be
absolutely the only selected locale.
To answer above questions: yes, I think this needs to be fixed on jammy
as well. In my testing, it does not appear to affect noble and later.
** Description changed:
-
[ Impact ]
- * When the C.UTF-8 locales is not installed, landscape-client's package
- reporter service fails to start:
+ * When the C.UTF-8 locales is not installed, landscape-client's package
+ reporter service fails to start:
Traceback (most recent call last):
- File "/usr/bin/landscape-package-reporter", line 10, in <module>
- main(sys.argv[1:])
- File "/usr/lib/python3/dist-packages/landscape/client/package/reporter.py",
line 872, in main
- locale.setlocale(locale.LC_CTYPE, ("C", "UTF-8"))
- File "/usr/lib/python3.8/locale.py", line 608, in setlocale
- return _setlocale(category, locale)
+ File "/usr/bin/landscape-package-reporter", line 10, in <module>
+ main(sys.argv[1:])
+ File "/usr/lib/python3/dist-packages/landscape/client/package/reporter.py",
line 872, in main
+ locale.setlocale(locale.LC_CTYPE, ("C", "UTF-8"))
+ File "/usr/lib/python3.8/locale.py", line 608, in setlocale
+ return _setlocale(category, locale)
locale.Error: unsupported locale setting
- * This prevents landscape-client from reporting packages, preventing
- all subsequent package activities.
+ * This prevents landscape-client from reporting packages, preventing
+ all subsequent package activities.
[ Test Plan ]
- * Edit /etc/default/locale to contain LANG=en_GB.UTF-8
- * Run `sudo dpkg-reconfigure locales` and select only en_GB.UTF-8 and select
- en_GB.UTF-8 as default locale
- * sudo apt install landscape-client
- * Attempt to start package-reporter:
+ * Edit /etc/default/locale to contain LANG=en_GB.UTF-8
+ * Run `sudo dpkg-reconfigure locales` and select only en_GB.UTF-8 and select
+ en_GB.UTF-8 as default locale
+ * ensure en_GB.UTF-8 is the _only_ selected locale, unselect other locales,
en_US.UTF-8 in particular.
+ * sudo apt install landscape-client
+ * Attempt to start package-reporter:
- sudo landscape-package-reporter
+ sudo landscape-package-reporter
- Package Reporter should start without any exceptions. There will be no
output
- and the process will not exit unless killed.
+ Package Reporter should start without any exceptions. There will be no
output
+ and the process will not exit unless killed.
- * Register landscape-client with landscape server and wait for the package
- reporter log to appear at /var/log/landscape/package-reporter.log. The log
- should not contain any errors.
+ * Register landscape-client with landscape server and wait for the package
+ reporter log to appear at /var/log/landscape/package-reporter.log. The log
+ should not contain any errors.
- * Test again using a non-UTF-8 locale setting instead of en_GB.UTF-8
+ * Test again using a non-UTF-8 locale setting instead of en_GB.UTF-8
[ Where problems could occur ]
- * As this is a reversion of a previous fix for a bug regarding locales, that
- issue might re-occur with non-UTF-8 locales. A comment in LP: #1827857
claims
- this has been fixed in python-apt, though.
+ * As this is a reversion of a previous fix for a bug regarding locales, that
+ issue might re-occur with non-UTF-8 locales. A comment in LP: #1827857
claims
+ this has been fixed in python-apt, though.
- * Packages with control file fields containing non-ASCII characters may be
- reported incorrectly. The Debian Policy Manual says that package names
cannot
- contain these but other fields might,
+ * Packages with control file fields containing non-ASCII characters may be
+ reported incorrectly. The Debian Policy Manual says that package names
cannot
+ contain these but other fields might,
[ Other Info ]
- <ORIGINAL BUG REPORT FOLLOWS>
+ <ORIGINAL BUG REPORT FOLLOWS>
OS: Ubuntu 20.04.6 LTS
Landscape client: 23.02-0ubuntu1
Due to missing locale, the landscape client couldn't report the list of
installed packages to the landscape server (SAAS).
2023-05-10 17:23:10,675 WARNING [MainThread] Package reporter output:
b'Traceback (most recent call last):
File "/usr/bin/landscape-package-reporter", line 10, in <module>
main(sys.argv[1:])
File "/usr/lib/python3/dist-packages/landscape/client/package/reporter.py",
line 872, in main
locale.setlocale(locale.LC_CTYPE, ("C", "UTF-8"))
File "/usr/lib/python3.8/locale.py", line 608, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
'
As a result, the server kept reporting available updates for the machine
and when the update was triggered it failed with the following error
reported in the task activity.
"Package data has changed. Please retry the operation."
For example on the affected client machine the "apt list --installed | grep
dnsmasq-base" gives the output
"dnsmasq-base/focal-updates,focal-security,now 2.80-1.1ubuntu1.7 amd64
However, landscape server keeps reporting that update
(2.80-1.1ubuntu1.7) is available.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2020064
Title:
locale.Error: unsupported locale setting
To manage notifications about this bug go to:
https://bugs.launchpad.net/landscape-client/+bug/2020064/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs