When switching to this module from my dumb sysctl one, I get this error when running my manifest:
Error: Failed to apply catalog: invalid byte sequence in UTF-8
To reproduce:
Add this to a reproducer.pp file:
sysctl::value { 'kernel.unprivileged_userns_clone':
value => '1',
target => '/etc/sysctl.d/userns.conf',
}
Download the 0.0.12 module to test-modules/sysctl, and run this:
puppet apply --modulepath="$PWD/test-modules" repro.pp
I get this error:
$ puppet apply --modulepath="$PWD/test-modules" repro.pp
Notice: Compiled catalog for angela.anarc.at in environment production in 0.04 seconds
Error: Failed to apply catalog: invalid byte sequence in UTF-8
This can also be reproduced in the git head. I can't find any corrupt UTF-8 output in the module's source code, so that can't be it.
My guess is that the output of sysctl -a makes Puppet unhappy: it might trying to decode it as unicode at some point and failing. And indeed, here, the sysctl -a output isn't UTF-8 clean:
$ sudo sysctl -a | iconv -f utf8 -t latin1 > /dev/null
iconv: illegal input sequence at position 66297
It specifically stumbles upon sunrpc.transports, which less shows as:
sunrpc.transports = <C0><E3><A3><C1>m^?
And indeed, this is happy:
anarcat@angela:puppet(master)$ sudo sysctl -a | grep -v sunrpc.transports | iconv -f utf8 -t latin1 > /dev/null
anarcat@angela:puppet(master)$
I would recommend not making any assertions on the encoding of values in the kernel's sysctl output.
When switching to this module from my dumb sysctl one, I get this error when running my manifest:
To reproduce:
Add this to a
reproducer.ppfile:Download the 0.0.12 module to
test-modules/sysctl, and run this:I get this error:
This can also be reproduced in the git head. I can't find any corrupt UTF-8 output in the module's source code, so that can't be it.
My guess is that the output of
sysctl -amakes Puppet unhappy: it might trying to decode it as unicode at some point and failing. And indeed, here, thesysctl -aoutput isn't UTF-8 clean:It specifically stumbles upon
sunrpc.transports, whichlessshows as:And indeed, this is happy:
I would recommend not making any assertions on the encoding of values in the kernel's sysctl output.