On Sat, Nov 03, 2018 at 10:19:25PM -0600, Jim Freeman wrote:
> 2018-10-01 stretch AMI (no idea if this is a regression?)
> /var/log/cloud-init.log claims user-data was run, when it fact it was not,
> with tracebacks and log messages (attached) leading me to think that
> failure is somehow getting mis-cast as success?
> Any confirmations of other failures/successes of user-data would be
> much appreciated ...
It seems that there are some invalid characters in your user-data
script. Cloud-init is printing a message at WARNING-level severity
indicating that it can't run the script, and the following stack trace
explains why:
> 2018-11-02 22:36:11,164 - util.py[WARNING]: Failed calling handler ShellScriptPartHandler: [['text/x-shellscript']] (text/x-shellscript, part-001, 2) with frequency once-per-instance
> 2018-11-02 22:36:11,170 - util.py[DEBUG]: Failed calling handler ShellScriptPartHandler: [['text/x-shellscript']] (text/x-shellscript, part-001, 2) with frequency once-per-instance
> Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/cloudinit/handlers/__init__.py", line 103, in run_part
> payload, frequency)
> File "/usr/lib/python3/dist-packages/cloudinit/handlers/shell_script.py", line 43, in handle_part
> util.write_file(path, payload, 0o700)
> File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1747, in write_file
> content = encode_text(content)
> File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 154, in encode_text
> return text.encode(encoding)
> UnicodeEncodeError: 'utf-8' codec can't encode character '\udca9' in position 14: surrogates not allowed
What's in /var/log/cloud-init-output.log after this failure?