Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

cloud-init: unexpected messages are printed in hypervisor's console #38

Open
andrewjjenkins opened this issue Oct 6, 2016 · 0 comments

Comments

@andrewjjenkins
Copy link

When cloud-init runs, error messages like the following may be printed in the hypervisor's console:

cloudinit_issue2

These error messages come from the "injected during image creation" code. Namely /config/os-functions/openstack-datasource.sh
It initially copied user data (from configdrive) as a file directly into its own copy. The user data from configdrive is in plain text, but openstack-datasource.sh assumes it's in JSON format. As such it tries to parse it and extract JSON values, but perl script used to do that throws an error.

Here is the repro:
[root@ian-1300-22-cfgdrive:NO LICENSE:Standalone] os-functions # function get_json_value() {

echo -n $(perl -MJSON -ne "$value = decode_json($_)->$1;
$value =~ s/([^a-zA-Z0-9])/$1/g; print $value" $2)
}
[root@ian-1300-22-cfgdrive:NO LICENSE:Standalone] os-functions # test
Found config drive
Found local user data: /config/user-data.json
Successfully called get_user_data
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "#!/bin/bashecho "IAN...") at -e line 1, <> line 1.

This was originally reported in internal F5 issue bz599218.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants