Project

General

Profile

Actions

Bug #19341

closed

Gziped ec2_userdata fact causes "Invalid byte sequence in UTF-8"

Added by Gavin Williams over 7 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

I'm attempting to run Foreman-installer on a CentOS 7 system installed on Openstack.

The node was provisioned with a compressed user_data string, which does in-fact contain invalid UTF-8 characters.

[DEBUG 2017-04-21 09:45:44 verbose]  Facter: querying EC2 instance user data at http://169.254.169.254/latest/user-data/.
[DEBUG 2017-04-21 09:45:44 verbose]  Facter: requesting http://169.254.169.254/latest/user-data/.
[DEBUG 2017-04-21 09:45:44 verbose]  Facter: Found bundle for host 169.254.169.254: 0x3bf5a80 [can pipeline]
[DEBUG 2017-04-21 09:45:44 verbose]  Facter: Re-using existing connection! (#0) with host 169.254.169.254
[DEBUG 2017-04-21 09:45:44 verbose]  Facter: Connected to 169.254.169.254 (169.254.169.254) port 80 (#0)
[DEBUG 2017-04-21 09:45:44 verbose]  Facter: Curl_http_done: called premature == 0
[DEBUG 2017-04-21 09:45:44 verbose]  Facter: Connection #0 to host 169.254.169.254 left intact
[DEBUG 2017-04-21 09:45:44 verbose]  Facter: request completed (status 200).
/usr/share/gems/gems/kafo-1.0.5/lib/kafo/puppet_log_parser.rb:9:in `parse': invalid byte sequence in UTF-8 (ArgumentError)
        from /usr/share/gems/gems/kafo-1.0.5/lib/kafo/kafo_configure.rb:435:in `block (2 levels) in run_installation'
        from /usr/share/gems/gems/kafo-1.0.5/lib/kafo/kafo_configure.rb:434:in `each'
        from /usr/share/gems/gems/kafo-1.0.5/lib/kafo/kafo_configure.rb:434:in `block in run_installation'
        from /usr/share/gems/gems/kafo-1.0.5/lib/kafo/kafo_configure.rb:432:in `spawn'
        from /usr/share/gems/gems/kafo-1.0.5/lib/kafo/kafo_configure.rb:432:in `run_installation'
        from /usr/share/gems/gems/kafo-1.0.5/lib/kafo/kafo_configure.rb:147:in `execute'
        from /usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
        from /usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
        from /usr/share/gems/gems/kafo-1.0.5/lib/kafo/kafo_configure.rb:154:in `run'
        from /sbin/foreman-installer:8:in `<main>'

An example of the output from "facter ec2_userdata" is:

ec2_userdata: "\x1f�\b\x00\x00\x00\x00\x00\x00�\\�AK�@\x10��\x0b�\x0eCz�i��� �wxւ\x1e��V�T&��vq�\x13wg�E��R\x0bZz�������A(�~؏�\x10��\x11�ԃ�Q�\x17ZΡø�W��Wˋ�����R\x1d6�H19\x0e\r̫Y��>E\n�c�\x18ROQ/���\x05�\x1f��\t�\x1d-���xΝ6\x1czg\x0b�r\x03��\x14jr�(5�{\x12��$\x01\x07R�K\x17\x1a(Mog��D���\x1c�7�Hh�\n$�\x1a0��\r��l9Ij3A�\x0f�\x05��#\x01z\x0f)�cdC)\x01g\x19��\x0b\x80���Γ��:Q�=�\x1cA\"��S�2�\x0b\x16����\x04\\J��:J\x1axG�\x1b�~�\x10�F�_1֞m�{��l��N?�y�Z\x17�+\x00\x00��\x01S�׻\x01\x00\x00" 

I believe the above failure is being caused here: https://github.com/theforeman/kafo/blob/d4398bd6dbd933a008a3317c77f2d018b8e2a568/lib/kafo/puppet_log_parser.rb#L7-L22

Actions

Also available in: Atom PDF