yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #80737
[Bug 1853146] [NEW] Invalid runcmd script format makes it ignored without marking cloud init as failed
Public bug reported:
Info :
- cloud-init version `/usr/bin/cloud-init 19.2-36-g059d049c-0ubuntu2~16.04.1`
Issue:
If user-data script contains a malformed runcmd script, cloud-init fails
to parse it but do not mark cloud-init as failed.
Example:
```
runcmd:
- echo "begin runcmd"
- # empty
- echo "end"
```
The second line is empty, and causes the following warning in `/var/log
/cloud-init.log`:
```
2019-11-19 12:39:10,124 - helpers.py[DEBUG]: Running config-runcmd using lock (<FileLock using file '/var/lib/cloud/instances/0B44BE6F-81FA-FF44-AB96-A0D9AB8B7171/sem/config_runcmd'>)
2019-11-19 12:39:10,124 - schema.py[DEBUG]: Ignoring schema validation. python-jsonschema is not present
2019-11-19 12:39:10,124 - util.py[WARNING]: Failed to shellify ['echo "begin runcmd"', None, 'echo "end"'] into file /var/lib/cloud/instances/0B44BE6F-81FA-FF44-AB96-A0D9AB8B7171/scripts/runcmd
2019-11-19 12:39:10,124 - util.py[DEBUG]: Failed to shellify ['echo "begin runcmd"', None, 'echo "end"'] into file /var/lib/cloud/instances/0B44BE6F-81FA-FF44-AB96-A0D9AB8B7171/scripts/runcmd
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cloudinit/config/cc_runcmd.py", line 91, in handle
content = util.shellify(cmd)
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2117, in shellify
"Got: %s" % (type_utils.obj_name(args), args))
TypeError: Unable to shellify type 'NoneType'. Expected list, string, tuple. Got: None
2019-11-19 12:39:10,154 - handlers.py[DEBUG]: finish: modules-config/config-runcmd: SUCCESS: config-runcmd ran successfully
```
There is no error log in `/var/log/cloud-init-output.log`
But cloud-init status is "done"
I expect the status to be "error"
** Affects: cloud-init
Importance: Undecided
Status: New
** Summary changed:
- Invalid runcmd script format make it ignored without marking cloud init as failed
+ Invalid runcmd script format makes it ignored without marking cloud init as failed
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1853146
Title:
Invalid runcmd script format makes it ignored without marking cloud
init as failed
Status in cloud-init:
New
Bug description:
Info :
- cloud-init version `/usr/bin/cloud-init 19.2-36-g059d049c-0ubuntu2~16.04.1`
Issue:
If user-data script contains a malformed runcmd script, cloud-init
fails to parse it but do not mark cloud-init as failed.
Example:
```
runcmd:
- echo "begin runcmd"
- # empty
- echo "end"
```
The second line is empty, and causes the following warning in
`/var/log/cloud-init.log`:
```
2019-11-19 12:39:10,124 - helpers.py[DEBUG]: Running config-runcmd using lock (<FileLock using file '/var/lib/cloud/instances/0B44BE6F-81FA-FF44-AB96-A0D9AB8B7171/sem/config_runcmd'>)
2019-11-19 12:39:10,124 - schema.py[DEBUG]: Ignoring schema validation. python-jsonschema is not present
2019-11-19 12:39:10,124 - util.py[WARNING]: Failed to shellify ['echo "begin runcmd"', None, 'echo "end"'] into file /var/lib/cloud/instances/0B44BE6F-81FA-FF44-AB96-A0D9AB8B7171/scripts/runcmd
2019-11-19 12:39:10,124 - util.py[DEBUG]: Failed to shellify ['echo "begin runcmd"', None, 'echo "end"'] into file /var/lib/cloud/instances/0B44BE6F-81FA-FF44-AB96-A0D9AB8B7171/scripts/runcmd
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cloudinit/config/cc_runcmd.py", line 91, in handle
content = util.shellify(cmd)
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2117, in shellify
"Got: %s" % (type_utils.obj_name(args), args))
TypeError: Unable to shellify type 'NoneType'. Expected list, string, tuple. Got: None
2019-11-19 12:39:10,154 - handlers.py[DEBUG]: finish: modules-config/config-runcmd: SUCCESS: config-runcmd ran successfully
```
There is no error log in `/var/log/cloud-init-output.log`
But cloud-init status is "done"
I expect the status to be "error"
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1853146/+subscriptions
Follow ups