Re: [Puppet Users] Puppetdb source install on Solaris. Agents complain about "invalid encoding ("UTF-8//IGNORE", "UTF-8")"

129 views
Skip to first unread message

Deepak Giridharagopal

unread,
Nov 28, 2012, 10:14:25 AM11/28/12
to puppet...@googlegroups.com
On Tue, Nov 27, 2012 at 9:27 PM, Ryan Cunningham <ryan.cunni...@gmail.com> wrote:
Hi all,

I'm having an issue on the master I'm using in my staging
environment with getting storeconfigs to work with puppetdb.

I should say up front that my staging environment is probably a little
uncommon. I'm running OpenIndiana which is a distribution of the open
source fork of OpenSolaris.

I installed puppet (3.0), facter and hiera using `gem` on this system
and have gotten the master working, servicing some test clients without
too much trouble but I'm having some real trouble getting puppetdb
integrated with my master.

Puppetdb is running on the puppet master and I can access the dashboard
on the default port of 8080 without issue,

I've followed all the instructions at
http://docs.puppetlabs.com/puppetdb/1/connect_puppet_master.html quite
closely but if I have storeconfigs set to true and puppetdb as my
backend I get the following output from a puppet agent --test:


Info: Retrieving plugin
Info: Loading facts in /var/puppet/lib/facter/last_run.rb
Info: Loading facts in /var/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/puppet/lib/facter/puppi_projects.rb
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: invalid encoding ("UTF-8//IGNORE", "UTF-8") Warning: Not using
cache on failed catalog Error: Could not retrieve catalog; skipping run

I've tried Googling but haven't turned up anyone else reporting the
same exact issue. I checked out puppetdb using git and got *most* of
the way through building with Rake (it stopped while building some of
the Debian-specific stuff) -- I got the jar file I'm using from there
and I copied the files I believe I was supposed to from puppetdb's
puppet/lib/puppet into
"/var/ruby/1.8/gem_home/gems/puppet-3.0.1/lib/puppet/" on this system.
Verbose output from the copy command follows...


The code in question is trying to transcode your catalog to UTF-8 before sending it to PuppetDB (because the wire format is JSON, and JSON is UTF-8). On Ruby 1.8, we rely on the "iconv" Ruby library, which is basically just a pass-through to libiconv. The error message seems to indicate that your libiconv doesn't know about UTF-8 which is strange...though I admit to not knowing exactly how (and with what flags) Ruby or iconv is compiled for OpenIndiana.

Using the same Ruby you run your puppetmasters with, can you do: 

ruby -e "require 'iconv'; puts Iconv.list.sort"

That should dump out the list of available encodings. That should help us at least more properly triangulate the issue.

deepak

Tim Mooney

unread,
Nov 30, 2012, 3:20:26 PM11/30/12
to puppet...@googlegroups.com
In regard to: Re: [Puppet Users] Puppetdb source install on Solaris. Agents...:

> It looks like the iconv library in the version of Ruby provided by the
> OpenIndiana repo may be too old, lack a required method or have an
> incompatible version of the method being used to transform the contents of
> the catalog.

I don't think it's an issue with your ruby Iconv.

> root@atropos:~# ruby -r iconv -ve 'pp Iconv.list'
> ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-solaris2.11]
> -e:1: undefined method `list' for Iconv:Class (NoMethodError)

I get the exact same error when I run Deepak's suggested command on
RHEL 6, which includes ruby 1.8.7:

$ ruby -e "require 'iconv'; puts Iconv.list.sort"
-e:1: undefined method `list' for Iconv:Class (NoMethodError)

If I run that on Solaris 10 with ruby 1.9.3 p327 compiled from source, I get:

$ ruby -e "require 'iconv'; puts Iconv.list.sort"
/local/lib/64/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv
will be deprecated in the future, use String#encode instead.
-e:1:in `list': list() function is unimplemented on this machine
(NotImplementedError)
from -e:1:in `<main>'

> (learning Ruby
> is still on my to-do list)

Same for me, and it has presented a slight barrier to entry for becoming
really comfortable with puppet.

>> ruby -e "require 'iconv'; puts Iconv.list.sort"
>>
>> That should dump out the list of available encodings. That should help us
>> at least more properly triangulate the issue.

Tim
--
Tim Mooney Tim.M...@ndsu.edu
Enterprise Computing & Infrastructure 701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

Ryan Cunningham

unread,
Dec 1, 2012, 12:27:49 AM12/1/12
to puppet...@googlegroups.com
I get the exact same error when I run Deepak's suggested command on
RHEL 6, which includes ruby 1.8.7:
 
Yeeeah. Or at least if there is an issue that's not the way to figure it out. Thanks for taking time to sanity check the diagnostic command.

When I asked about the same issue in #puppet someone elses' best guess was also that it could be something to do with Iconv.

Creating a new zone and installing everything on 1.9.x isn't a prohibitive amount of work just to see.

(learning Ruby is still on my to-do list)

Same for me, and it has presented a slight barrier to entry for becoming
really comfortable with puppet.

It could be time for me to move it up in priority. At least to the point where I can effectively dig around in a module's definition and grok the portion of Puppet where this is choking.

The good thing about installing from source on SunOS is that you tend to learn quite a few more things before you get the software working the way you want than if you'd just installed an rpm.
Reply all
Reply to author
Forward
0 new messages