Your message dated 
with message-id 
and subject line Re: Bug#955733: cloud-init does not set locale specified in 
user data
has caused the Debian Bug report #955733,
regarding cloud-init does not set locale specified in user data
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
955733: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955733
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cloud-init
Version: 18.3-6

I am launching a Buster 10.3 EC2 instance with the following user data
to initialise and set the default locale:

    #cloud-config
    hostname: argon
    locale: en_GB.UTF-8
    timezone: Europe/London

This fails to set the locale, and "systemctl status cloud-init" shows:

    Apr 04 11:00:30 argon systemd[1]: Starting Apply the settings specified in 
cloud-config...
    Apr 04 11:00:43 argon cloud-init[546]: Generating locales (this might take 
a while)...
    Apr 04 11:00:43 argon cloud-init[546]: Generation complete.
    Apr 04 11:00:43 argon cloud-init[546]: *** update-locale: Error: invalid 
locale settings:  LANG=en_GB.UTF-8
    Apr 04 11:00:43 argon cloud-init[546]: Cloud-init v. 18.3 running 
'modules:config' at Sat, 04 Apr 2020 10:00:41 +0000. Up 21.77 seconds.
    Apr 04 11:00:43 argon cloud-init[546]: 2020-04-04 10:00:43,604 - 
util.py[WARNING]: Running module locale (<module 'cloudinit.config.cc_locale' 
from '/usr/lib/python3/dist-packages/cloudinit/config/cc_locale.py'>) failed
    Apr 04 11:00:45 argon systemd[1]: cloud-config.service: Main process 
exited, code=exited, status=1/FAILURE
    Apr 04 11:00:45 argon systemd[1]: cloud-config.service: Failed with result 
'exit-code'.
    Apr 04 11:00:45 argon systemd[1]: Failed to start Apply the settings 
specified in cloud-config.
    
The log file "cloud-init.log" shows the error is caused by failing to
generate the requested locale.

    2020-04-04 10:00:43,005 - debian.py[DEBUG]: Generating locales for 
en_GB.UTF-8
    2020-04-04 10:00:43,005 - util.py[DEBUG]: Running command ['locale-gen', 
'en_GB.UTF-8'] with allowed return codes [0] (shell=False, capture=False)

The command "locale-gen" does not accept a locale as an argument, but
only generates the locales listed in "/etc/locale.gen".  So the locale
requested does not get generated, and causes the subsequent failure when
setting locale.

    2020-04-04 10:00:43,196 - util.py[DEBUG]: Running command ['update-locale', 
'--locale-file=/etc/default/locale', 'LANG=en_GB.UTF-8'] with allowed return 
codes [0] (shell=False, capture=False)

Nick

--- End Message ---
--- Begin Message ---
Version: 26.2-1

Since 26.2 cloud-init enables the requested locale in /etc/locale.gen
before running locale-gen.

--- End Message ---

Reply via email to