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.
Description of problem:
After the upgrade of cloud-init to version 18.2 cloud-final.service do not start due to the following error and the service remains in not running state
-----
# service cloud-final status
Redirecting to /bin/systemctl status cloud-final.service
● cloud-final.service - Execute cloud user/final scripts
Loaded: loaded (/usr/lib/systemd/system/cloud-final.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2019-02-01 13:14:31 CET; 28min ago
Process: 21927 ExecStart=/usr/bin/cloud-init modules --mode=final (code=exited, status=1/FAILURE)
Main PID: 21927 (code=exited, status=1/FAILURE)
-----
Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 7.6 (Maipo)
cloud-init-18.2-1.el7_6.1.x86_64
How reproducible:
Steps to Reproduce:
1. [root@rhvm ~]# cloud-init modules --mode=final
Actual results:
[root@rhvm ~]# cloud-init modules --mode final
Cloud-init v. 18.2 running 'modules:final' at Wed, 06 Feb 2019 20:00:14 +0000. Up 10634.29 seconds.
Cloud-init v. 18.2 finished at Wed, 06 Feb 2019 20:00:15 +0000. Datasource DataSourceNoCloud [seed=/dev/sr0][dsmode=net]. Up 10634.40 seconds
Traceback (most recent call last):
File "/usr/bin/cloud-init", line 9, in <module>
load_entry_point('cloud-init==18.2', 'console_scripts', 'cloud-init')()
File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 882, in main
get_uptime=True, func=functor, args=(name, args))
File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2388, in log_time
ret = func(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 679, in status_wrapper
if v1[m]['errors']:
KeyError: 'modules-init'
Expected results:
[root@rhvm ~]# cloud-init modules --mode final
Cloud-init v. 18.2 running 'modules:final' at Wed, 06 Feb 2019 19:41:50 +0000. Up 9530.23 seconds.
Cloud-init v. 18.2 finished at Wed, 06 Feb 2019 19:41:50 +0000. Datasource DataSourceNoCloud [seed=/dev/sr0][dsmode=net]. Up 9530.34 seconds
Additional info:
This problem do not happens with previous cloud-init version:
cloud-init.x86_64 0:0.7.9-24.el7_5.1 will be updated
I had a look to the /usr/lib/python2.7/site-packages/cloudinit/cmd/main.py script and I found that it fail in the following part of code:
~~~
...
if mode == "modules-final":
# write the 'finished' file
errors = []
for m in modes:
if v1[m]['errors']: <<<--- Unhandled exception exception
errors.extend(v1[m].get('errors', []))
...
~~~
The for cycle loop into modes list that contains ('init', 'init-local', 'modules-init', 'modules-config', 'modules-final'):
The v1 array do not contains "modules-init" key and for this reason if generate an exception.
Applying the following patch the script make a double check on the keys present into the array before the if statement.
[root@rhvm ~]# diff -u /usr/lib/python2.7/site-packages/cloudinit/cmd/main.py /usr/lib/python2.7/site-packages/cloudinit/cmd/main.py.fixed
--- /usr/lib/python2.7/site-packages/cloudinit/cmd/main.py 2018-03-27 14:49:38.000000000 -0400
+++ /usr/lib/python2.7/site-packages/cloudinit/cmd/main.py.fixed 2019-02-06 15:17:45.128944937 -0500
@@ -676,8 +676,9 @@
# write the 'finished' file
errors = []
for m in modes:
- if v1[m]['errors']:
- errors.extend(v1[m].get('errors', []))
+ if m in v1:
+ if v1[m]['errors']:
+ errors.extend(v1[m].get('errors', []))
atomic_helper.write_json(
result_path, {'v1': {'datasource': v1['datasource'],
As temporary workaround is it possible to edit the following file:
/run/cloud-init/status.json
Adding a fake json entry related to the "modules-init" part:
"modules-init": {
"errors": [],
"finished": 1,
"start": 0
},
Hi Xiaoyi,
to reproduce this bug, you would need to:
1. Install a RHV-H (Red Hat Virtualization Hypervisor)
2. Install a RHV-M (Red Hat Virtualization Manager) in Self-Hosted Engine configuration
3. As soon as the RHV-M VM starts you'll be able to verify that cloud-init service start failed at boot.
Please ping me if you need more details.
Thanks,
A.
Description of problem: After the upgrade of cloud-init to version 18.2 cloud-final.service do not start due to the following error and the service remains in not running state ----- # service cloud-final status Redirecting to /bin/systemctl status cloud-final.service ● cloud-final.service - Execute cloud user/final scripts Loaded: loaded (/usr/lib/systemd/system/cloud-final.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2019-02-01 13:14:31 CET; 28min ago Process: 21927 ExecStart=/usr/bin/cloud-init modules --mode=final (code=exited, status=1/FAILURE) Main PID: 21927 (code=exited, status=1/FAILURE) ----- Version-Release number of selected component (if applicable): Red Hat Enterprise Linux Server release 7.6 (Maipo) cloud-init-18.2-1.el7_6.1.x86_64 How reproducible: Steps to Reproduce: 1. [root@rhvm ~]# cloud-init modules --mode=final Actual results: [root@rhvm ~]# cloud-init modules --mode final Cloud-init v. 18.2 running 'modules:final' at Wed, 06 Feb 2019 20:00:14 +0000. Up 10634.29 seconds. Cloud-init v. 18.2 finished at Wed, 06 Feb 2019 20:00:15 +0000. Datasource DataSourceNoCloud [seed=/dev/sr0][dsmode=net]. Up 10634.40 seconds Traceback (most recent call last): File "/usr/bin/cloud-init", line 9, in <module> load_entry_point('cloud-init==18.2', 'console_scripts', 'cloud-init')() File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 882, in main get_uptime=True, func=functor, args=(name, args)) File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2388, in log_time ret = func(*args, **kwargs) File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 679, in status_wrapper if v1[m]['errors']: KeyError: 'modules-init' Expected results: [root@rhvm ~]# cloud-init modules --mode final Cloud-init v. 18.2 running 'modules:final' at Wed, 06 Feb 2019 19:41:50 +0000. Up 9530.23 seconds. Cloud-init v. 18.2 finished at Wed, 06 Feb 2019 19:41:50 +0000. Datasource DataSourceNoCloud [seed=/dev/sr0][dsmode=net]. Up 9530.34 seconds Additional info: This problem do not happens with previous cloud-init version: cloud-init.x86_64 0:0.7.9-24.el7_5.1 will be updated