fail to process user-data with cloud-config-archive

Bug #1445143 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
High
Unassigned
cloud-init (Ubuntu)
Fix Released
High
Unassigned
Vivid
Fix Released
High
Unassigned

Bug Description

launching an instance with this user-data causes the stack trace further below
#cloud-config-archive:
 - content: |
     #cloud-config
     chpasswd: {expire: false}
     manage_etc_hosts: true
     password: ubuntu

Apr 16 17:20:29 ubuntu [CLOUDINIT] util.py[DEBUG]: Consuming user data failed!#012Traceback (most recent call last):
File "/usr/bin/cloud-init", line 280, in main_init
    init.consume_data(PER_ALWAYS)
  File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 496, in consume_data
    self._consume_userdata(frequency)
  File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 566, in _consume_userdata
    self._do_handlers(user_data_msg, c_handlers_list, frequency)
  File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 489, in _do_handlers
    walk_handlers(excluded)
  File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 472, in walk_handlers
    handlers.walk(data_msg, handlers.walker_callback, data=part_data)
  File "/usr/lib/python3/dist-packages/cloudinit/handlers/__init__.py", line 248, in walk
    payload = util.fully_decoded_payload(part)
  File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 126, in fully_decoded_payload
    return cte_payload.decode(charset, errors='surrogateescape')
TypeError: decode() argument 1 must be str, not Charset

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: cloud-init 0.7.7~bzr1088-0ubuntu3 [modified: usr/lib/python3/dist-packages/cloudinit/util.py]
ProcVersionSignature: User Name 3.19.0-14.14-generic 3.19.3
Uname: Linux 3.19.0-14-generic x86_64
ApportVersion: 2.17.1-0ubuntu1
Architecture: amd64
Date: Thu Apr 16 17:48:07 2015
Ec2AMI: ami-000002ed
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: aki-00000002
Ec2Ramdisk: ari-00000002
PackageArchitecture: all
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Changed in cloud-init (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Scott Moser (smoser) wrote :

fixed in revno 1091

Changed in cloud-init:
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
Vincent Ladeuil (vila) wrote :

Building on top of the added test (test_cloud_config_archive), using the following breaks (the yaml can't be parsed):
        message = '''#cloud-config-archive
- content: "#cloud-config\napt_update: true\napt_upgrade: true\nchpasswd:\n expire:\
        \ false\nmanage_etc_hosts: true\npackages:\n- bzr\n- ubuntu-desktop\n- avahi-daemon\n\
        password: ubuntu\npower_state:\n mode: poweroff\n"
'''

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.7~bzr1091-0ubuntu1

---------------
cloud-init (0.7.7~bzr1091-0ubuntu1) vivid; urgency=medium

  * New upstream snapshot.
    * fix processing of user-data in cloud-config-archive format (LP: #1445143)
 -- Scott Moser <email address hidden> Fri, 17 Apr 2015 12:04:16 -0400

Changed in cloud-init (Ubuntu Vivid):
status: Confirmed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

This is fixed in cloud-init 0.7.7

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
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.