Issue #22563 has been updated by Charlie Sharpsteen.

Description updated
Status changed from Needs More Information to Duplicate
Assignee changed from Luke Alexander to Charlie Sharpsteen

Luke Alexander wrote:
> I'm not sure what the correct thing to do is then, 'fix' the init script or 
> 'fix' extlookup.rb?
> 
> Either way I'm changing files from packages which I generally try to avoid.

What is happening is that when Ruby 1.9.x is run under the C locale, it will 
expect input to be ASCII encoded:

<pre>
$ LANG=C LC_ALL=C ruby -e 'puts Encoding.default_external'
US-ASCII
</pre>

I also share your unease about messing with the init script for Apache. At this 
point, I would recommend setting `Encoding.default_external = Encoding::UTF_8` 
in your `config.ru` file for the Puppet master as that will limit the scope of 
the change to Puppet rather than affecting everything running under Apache.

In general, Puppet support for non-ASCII encodings is very poorly defined, see 
#20522 for a list of known issues. Lots of things that "just worked" under Ruby 
1.8.x are now throwing errors under 1.9.x and we are still in the process of 
discovering where encodings need to be explicitly handled by Puppet. Up to this 
point, differences in encoding were implicitly handled by Ruby 1.8.x treating 
all strings as raw bytes without worrying about encodings.

I'm going to close this issue as a duplicate of #20897. If we come up with a 
better recommendation for configuring the locale in which Puppet runs under 
Apache, that ticket will be updated.

----------------------------------------
Bug #22563: 3.2.4 invalid byte sequence in US-ASCII for extlookup variables
https://projects.puppetlabs.com/issues/22563#change-98477

* Author: Luke Alexander
* Status: Duplicate
* Priority: Normal
* Assignee: Charlie Sharpsteen
* Category: utf8
* Target version: 
* Affected Puppet version: 3.2.4
* Keywords: 
* Branch: 
----------------------------------------
I have a bug with a recently upgraded puppet master, when I run the puppet 
client on the master we get this error:

<pre>
puppet agent -vt --debug > /root/debug.log
Warning: Local environment: "production" doesn't match server specified node 
environment "dr", switching agent to "dr".
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
invalid byte sequence in US-ASCII at 
/etc/puppet/modules/vendor/apt/manifests/params.pp:7 on node 
guadalupe.dr.brandwatch.net
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
</pre>

Line 7 from params.pp is an extlookup variable:

<pre>
$reposerver = extlookup(“reposerver”)
</pre>

reposerver from extdata evaluates to a fqdn of our repo server

I can work around this problem by adding the below lines to the top of 
/usr/lib/ruby/vendor_ruby/puppet/parser/functions/extlookup.rb

<pre>
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
</pre>

I guess that is not the correct fix, though.

This on Debian Wheezy with:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
puppet 3.2.4
facter 1.6.7

I've attached the debug log.
Regards,
Luke





-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to