Treat as Error not Warning non-YAML #cloud-config user-data

Bug #1999952 reported by Chad Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Fix Released
Medium
Chad Smith

Bug Description

Cloud-init 22.4.2

Currently when user-data is of type #cloud-config YAML, cloud-init only emits a WARNING message.

2022-12-16 22:55:13,550 - util.py[DEBUG]: Attempting to load yaml from string of length 127 with allowed root types (<class 'dict'>,)
2022-12-16 22:55:13,551 - util.py[WARNING]: Failed loading yaml blob. Invalid format at line 5 column 26: "while scanning an alias
  in "<unicode string>", line 5, column 26:
      interactive-sections: [*]
                             ^
expected alphabetic or numeric character, but found ']'
  in "<unicode string>", line 5, column 27:
      interactive-sections: [*]

I proposed that specific known user-data types like #cloud-config that are not able to be processed because of invalid format should be treated as an error because:
 * #cloud-config is a known YAML format and something that isn't YAML parseable represents a that needs immediate attention
 * #cloud-config was intended configuration on the system, ignoring that confiration exposes the system to long-running misconfiguration or security flaws
 * warnings do not result in discoverable error conditions or exit codes from cloud-init system service status
 * warnings do not bubble up to `cloud-init status --long`

                              ^"

Chad Smith (chad.smith)
summary: - Error on invalid #cloud-config YAML user-data
+ cloud-init schema --system should fail on non-YAML #cloud-config user-
+ data
summary: - cloud-init schema --system should fail on non-YAML #cloud-config user-
- data
+ Treat as Error not Warning non-YAML #cloud-config user-data
Revision history for this message
Chad Smith (chad.smith) wrote :

note related bug: cloud-init schema --system also lies when unparseable YAML is provided as user-data

https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1999953

Revision history for this message
Chad Smith (chad.smith) wrote :
Changed in cloud-init (Ubuntu):
assignee: nobody → Chad Smith (chad.smith)
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 23.3~1ge5a617fe-0ubuntu1

---------------
cloud-init (23.3~1ge5a617fe-0ubuntu1) mantic; urgency=medium

  * Upstream snapshot based on upstream/main at e5a617fe.
    - Bugs fixed in this snapshot: (LP: #2025180, #2025180, #1999952)
      (LP: #1798055)

 -- Chad Smith <email address hidden> Wed, 28 Jun 2023 09:57:55 -0600

Changed in cloud-init (Ubuntu):
status: Fix Committed → Fix Released
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.