Jira (FACT-1172) invalid byte sequence in UTF-8 for disk UUID

28 views
Skip to first unread message

CJ Toolseram (JIRA)

unread,
Aug 25, 2015, 8:26:04 PM8/25/15
to puppe...@googlegroups.com
CJ Toolseram created an issue
 
Facter / Bug FACT-1172
invalid byte sequence in UTF-8 for disk UUID
Issue Type: Bug Bug
Affects Versions: FACT 3.0.2
Assignee: Unassigned
Created: 2015/08/25 5:25 PM
Priority: Normal Normal
Reporter: CJ Toolseram

Linux sees the disk UUID:

root@anon /etc/udev # blkid /dev/sdb 
/dev/sdb: UUID="LSI €M-^F'M-C" TYPE="ddf_raid_member" 
root@anon /etc/udev # blkid /dev/sdc 
/dev/sdc: UUID="LSI €M-^F'M-C" TYPE="ddf_raid_member"

puppet facts find, partial ouput:

"/dev/sdb": { 
"filesystem": "ddf_raid_member", 
"size": "447.13 GiB", 
"size_bytes": 480103981056, 
"uuid": "LSI €†'Ã" 
}, 
"/dev/sdc": { 
"filesystem": "ddf_raid_member", 
"size": "447.13 GiB", 
"size_bytes": 480103981056, 
"uuid": "LSI €†'Ã" 
} 

Puppet run will gives below error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: invalid byte sequence in UTF-8

Logs error:

2015-08-17 06:53:16,742 ERROR [puppet-server] Puppet invalid byte sequence in UTF-8
org/jruby/RubyString.java:6202:in `count'
/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:248:in `binary?'
/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:262:in `visit_String'
/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:128:in `accept'
/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/shared/psych/visitors/yaml_tree.rb:324:in `visit_Hash'
org/jruby/RubyHash.java:1341:in `each'

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.5#64020-sha1:78acd6c)
Atlassian logo

CJ Toolseram (JIRA)

unread,
Aug 25, 2015, 8:26:04 PM8/25/15
to puppe...@googlegroups.com
CJ Toolseram updated an issue
Change By: CJ Toolseram
Priority: Normal Critical

Peter Huene (JIRA)

unread,
Aug 26, 2015, 5:08:13 PM8/26/15
to puppe...@googlegroups.com
Peter Huene assigned an issue to Peter Huene
Change By: Peter Huene
Assignee: Peter Huene

Peter Huene (JIRA)

unread,
Aug 31, 2015, 6:09:05 PM8/31/15
to puppe...@googlegroups.com
Peter Huene updated an issue
Change By: Peter Huene
Priority: Critical Major

Peter Huene (JIRA)

unread,
Aug 31, 2015, 6:11:07 PM8/31/15
to puppe...@googlegroups.com
Peter Huene commented on Bug FACT-1172
 
Re: invalid byte sequence in UTF-8 for disk UUID

After a few different attempts at solving this bug while still maintaining support for utf-8, I decided to replicate what blkid is outputting instead. This will mean that any non-ASCII characters in any of the libblkid output will be converted to M-<char> and ^char notation. This will also restore backwards compatibility since 2.x relied on blkid output which does the same thing.

Peter Huene (JIRA)

unread,
Aug 31, 2015, 6:59:03 PM8/31/15
to puppe...@googlegroups.com
Peter Huene updated an issue
Change By: Peter Huene
Story Points: 2
Release Notes Summary: Fix Facter not properly encoding non-printable ASCII data in libblkid output on Linux, resulting in invalid UTF-8 code sequence errors when handled in Puppet.
Sprint: Client 2015-09-16
Scrum Team: Client Platform
Release Notes: Bug Fix
Fix Version/s: FACT 3.0.3

Peter Huene (JIRA)

unread,
Aug 31, 2015, 7:01:04 PM8/31/15
to puppe...@googlegroups.com
Peter Huene commented on Bug FACT-1172
 
Re: invalid byte sequence in UTF-8 for disk UUID

Note to reviewers: it's harder to set the UUID to something invalid, so I ended up setting the label of a block device to something containing Unicode characters; it suffered from the same problem as the UUID and the fix affects all data read back from libblkid.

Michael Smith (JIRA)

unread,
Sep 2, 2015, 5:15:06 PM9/2/15
to puppe...@googlegroups.com
Michael Smith assigned an issue to qa
 
Change By: Michael Smith
Status: Ready for  CI  Test
Assignee: qa
This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4)
Atlassian logo

Shaigy Nixon (JIRA)

unread,
Sep 2, 2015, 7:09:03 PM9/2/15
to puppe...@googlegroups.com
Shaigy Nixon updated an issue
Change By: Shaigy Nixon
QA Risk Assessment Reason: Setting to medium. May be difficult to write an acceptance test
QA Highest Test Level: Acceptance
QA Risk Assessment: Medium
QA Risk Probability: Low
QA Risk Severity: High
QA Status: Reviewed

Shaigy Nixon (JIRA)

unread,
Sep 3, 2015, 1:35:58 PM9/3/15
to puppe...@googlegroups.com
Shaigy Nixon assigned an issue to Shaigy Nixon
Change By: Shaigy Nixon
Assignee: qa Shaigy Nixon

Shaigy Nixon (JIRA)

unread,
Sep 3, 2015, 5:30:04 PM9/3/15
to puppe...@googlegroups.com
Shaigy Nixon commented on Bug FACT-1172
 
Re: invalid byte sequence in UTF-8 for disk UUID

Validated on redhat-6-x86_64 with facter --version
3.0.2 (commit 532d5242a61a803953abdd57b3d0f7bc68f447c0):

Steps followed:
1) On agent, modify the the label on one of the block devices.

[root@kttki3p2lxbxi25 ~]# blkid
/dev/sda1: UUID="eb475619-f4b3-41af-91ca-b37fec3374d7" TYPE="ext4"
/dev/sda2: UUID="wVL1i1-l6QX-pl33-9m55-KJ6S-sX2k-KI3JAE" TYPE="LVM2_member"
/dev/sdb1: UUID="7o1inr-VPe2-Uqi8-bIlW-JQWS-u2M6-wZQbST" TYPE="LVM2_member"
/dev/mapper/VolGroup-lv_root: UUID="22709047-0ea7-4424-9ffd-3c54eba2f514" TYPE="ext4"
/dev/mapper/VolGroup-lv_swap: UUID="3e258a40-f1ee-4afa-8462-e5f49b0ffa5f" TYPE="swap"
 
[root@kttki3p2lxbxi25 ~]# e2label /dev/sda1 "€†Ã€M€†Ã€M"
Warning: label too long, truncating.
 
[root@kttki3p2lxbxi25 ~]# blkid
/dev/sda1: UUID="eb475619-f4b3-41af-91ca-b37fec3374d7" TYPE="ext4" LABEL="M-bM-^BM-,M-b�M- M-CM-^CM-bM-^BM-,MM-bM-^BM-,M-b"
/dev/sda2: UUID="wVL1i1-l6QX-pl33-9m55-KJ6S-sX2k-KI3JAE" TYPE="LVM2_member"
/dev/sdb1: UUID="7o1inr-VPe2-Uqi8-bIlW-JQWS-u2M6-wZQbST" TYPE="LVM2_member"
/dev/mapper/VolGroup-lv_root: UUID="22709047-0ea7-4424-9ffd-3c54eba2f514" TYPE="ext4"
/dev/mapper/VolGroup-lv_swap: UUID="3e258a40-f1ee-4afa-8462-e5f49b0ffa5f" TYPE="swap"
 
[root@kttki3p2lxbxi25 ~]# e2label /dev/sda1
€†Ã€M€
 
 
[root@kttki3p2lxbxi25 ~]# facter partitions
...
  /dev/sda1 => {
    filesystem => "ext4",
    label => "M-bM-^BM-,M-bM-^@M- M-CM-^CM-bM-^BM-,MM-bM-^BM-,M-b",
    mount => "/boot",
    size => "500.00 MiB",
    size_bytes => 524288000,
    uuid => "eb475619-f4b3-41af-91ca-b37fec3374d7"
  },

2) Run puppet

[root@kttki3p2lxbxi25 ~]# puppet agent -t --server bihcazi05ggmmrn.delivery.puppetlabs.net
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for kttki3p2lxbxi25.delivery.puppetlabs.net
Info: Applying configuration version '1441314389'
Notice: Applied catalog in 0.02 seconds
 

Before fix:

 
[root@a5ddkf1uvoxry89 ~]# e2label /dev/sda1
€†Ã€M€
 
[root@a5ddkf1uvoxry89 ~]# facter partitions
...
  /dev/sda1 => {
    filesystem => "ext4",
    label => "€†Ã€M€�",
    mount => "/boot",
    size => "500.00 MiB",
    size_bytes => 524288000,
    uuid => "eb475619-f4b3-41af-91ca-b37fec3374d7"
  },
...
 
[root@a5ddkf1uvoxry89 ~]# puppet agent -t --server l1uv1xybam8m5it.delivery.puppetlabs.net
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: invalid byte sequence in UTF-8
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Reply all
Reply to author
Forward
0 new messages