← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1884071] [NEW] gzipped and base64 encoded user-data leads to failure

 

Public bug reported:

Issue is here as well: https://github.com/terraform-providers/terraform-
provider-aws/issues/8244

In /var/log/cloud-init.log this is the only WARNING message (there are
no ERROR messages):

2020-06-18 12:16:59,413 - __init__.py[WARNING]: Unhandled non-multipart
(text/x-not-multipart) userdata: 'b'H4sIAAAAAAAA/8RV3W4bNxO9'...'

I can even pull the file from the created VM and it can be extracted and
shows to be proper formatting and everything:

curl -L http://169.254.169.254/latest/user-data/ | base64 --decode |
gunzip

Content-Type: multipart/mixed; boundary="MIMEBOUNDARY"
MIME-Version: 1.0

--MIMEBOUNDARY
Content-Transfer-Encoding: 7bit
Content-Type: text/cloud-config
Mime-Version: 1.0

#cloud-config
# set locale
locale: en_GB.UTF-8
# ensure time sync between all nodes
ntp:
  enabled: true
  ntp_client: chrony
# hides ssh keys in console
ssh_fp_console_blacklist: [ssh-dss, ssh-dsa, ssh-ed25519]
ssh_key_console_blacklist: [ssh-dss, ssh-dsa, ssh-ed25519]

# upgrade all packages and install necessary ones
package_upgrade: true
package_reboot_if_required: true
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- build-essential
- libssl-dev
- make

# set random root password and disable password login for ssh
chpasswd:
  expire: false
  list: |
      root:RANDOM
ssh_pwauth: no

# create sre user with sudo privs and set autrhorized key
users:
- name: sre
  groups: sudo
  lock_passwd: true
  ssh_authorized_keys:
   - censored
  sudo: ['ALL=(ALL) NOPASSWD:ALL']
  shell: /bin/bash


--MIMEBOUNDARY
Content-Transfer-Encoding: 7bit
Content-Type: text/cloud-config
Mime-Version: 1.0

#cloud-config
# Configure Floating IP (Ubuntu 20.04 LTS)
# Not required when using https://github.com/costela/hcloud-ip-floater
#write_files:
#  - content: |
#      network:
#         version: 2
#         ethernets:
#           eth0:
#             addresses:
#             - ${floating_ip}/32
#    path: /etc/netplan/60-floating-ip.yaml
# Install Keepalived
runcmd:
- cd /root/
- wget http://www.keepalived.org/software/keepalived-2.1.2.tar.gz
- tar xvf keepalived-2.1.2.tar.gz
- cd keepalived-2.1.2
- ./configure
- make
- sudo make install

final_message: "The system is finally up, after $UPTIME seconds"

When I use the exact same userdata as above but extracted and passed as
plain text it works without issue.

** Affects: cloud-init
     Importance: Undecided
         Status: New

** Attachment added: "apport.cloud-init.wby0fvkm.apport"
   https://bugs.launchpad.net/bugs/1884071/+attachment/5384975/+files/apport.cloud-init.wby0fvkm.apport

-- 
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/1884071

Title:
  gzipped and base64 encoded user-data leads to failure

Status in cloud-init:
  New

Bug description:
  Issue is here as well: https://github.com/terraform-providers
  /terraform-provider-aws/issues/8244

  In /var/log/cloud-init.log this is the only WARNING message (there are
  no ERROR messages):

  2020-06-18 12:16:59,413 - __init__.py[WARNING]: Unhandled non-
  multipart (text/x-not-multipart) userdata:
  'b'H4sIAAAAAAAA/8RV3W4bNxO9'...'

  I can even pull the file from the created VM and it can be extracted
  and shows to be proper formatting and everything:

  curl -L http://169.254.169.254/latest/user-data/ | base64 --decode |
  gunzip

  Content-Type: multipart/mixed; boundary="MIMEBOUNDARY"
  MIME-Version: 1.0

  --MIMEBOUNDARY
  Content-Transfer-Encoding: 7bit
  Content-Type: text/cloud-config
  Mime-Version: 1.0

  #cloud-config
  # set locale
  locale: en_GB.UTF-8
  # ensure time sync between all nodes
  ntp:
    enabled: true
    ntp_client: chrony
  # hides ssh keys in console
  ssh_fp_console_blacklist: [ssh-dss, ssh-dsa, ssh-ed25519]
  ssh_key_console_blacklist: [ssh-dss, ssh-dsa, ssh-ed25519]

  # upgrade all packages and install necessary ones
  package_upgrade: true
  package_reboot_if_required: true
  packages:
  - apt-transport-https
  - ca-certificates
  - curl
  - gnupg-agent
  - software-properties-common
  - build-essential
  - libssl-dev
  - make

  # set random root password and disable password login for ssh
  chpasswd:
    expire: false
    list: |
        root:RANDOM
  ssh_pwauth: no

  # create sre user with sudo privs and set autrhorized key
  users:
  - name: sre
    groups: sudo
    lock_passwd: true
    ssh_authorized_keys:
     - censored
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
    shell: /bin/bash

  
  --MIMEBOUNDARY
  Content-Transfer-Encoding: 7bit
  Content-Type: text/cloud-config
  Mime-Version: 1.0

  #cloud-config
  # Configure Floating IP (Ubuntu 20.04 LTS)
  # Not required when using https://github.com/costela/hcloud-ip-floater
  #write_files:
  #  - content: |
  #      network:
  #         version: 2
  #         ethernets:
  #           eth0:
  #             addresses:
  #             - ${floating_ip}/32
  #    path: /etc/netplan/60-floating-ip.yaml
  # Install Keepalived
  runcmd:
  - cd /root/
  - wget http://www.keepalived.org/software/keepalived-2.1.2.tar.gz
  - tar xvf keepalived-2.1.2.tar.gz
  - cd keepalived-2.1.2
  - ./configure
  - make
  - sudo make install

  final_message: "The system is finally up, after $UPTIME seconds"

  When I use the exact same userdata as above but extracted and passed
  as plain text it works without issue.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1884071/+subscriptions


Follow ups