Issue #12702 has been updated by Josh Cooper.

Subject changed from Puppet on Windows (UTF8 Bug) to Puppet does not specify 
encoding when setting up rails database connection
Assignee set to Daniel Pittman

I created a fact that simply returns the above string:

<pre>
Facter.add(:german) do
  setcode do
    "Mitteleuropäische Zeit"
  end
end
</pre>

Puppet agent correctly captures the fact value as:

<pre>
(irb): facts.values['german']
"Mitteleurop\344ische Zeit"
</pre>

Puppet master correctly decodes the fact:

<pre>
  "german"=>"Mitteleurop\344ische Zeit",
</pre>

However, note that the 3 character sequence "\344is" corresponds to 0xe46973. 
When inserting the data into postgres, byte 0xe4 is interpreted as the lead 
byte in a UTF-8 sequence. But the second byte 0x69 is invalid (since utf-8 
encoding requires the second byte be of the form 10XXXXXX).

I believe the problem is in how we initialize our connection to the database in 
lib/puppet/rails.rb, line 42. Seems like we should be specifying the encoding 
to use, e.g. "args[:encoding] => 'utf-8'", though this may be 
database-specific. I assume if this is set, then the database adapter will 
properly UTF-8 encode the character as: `0xc3a4`

Since I can reproduce this problem on a mac agent, I don't think this is 
Windows specific. I am guessing that the Linux client has a LANG setting that 
causes the data to UTF-8 encoded on the client.
----------------------------------------
Bug #12702: Puppet does not specify encoding when setting up rails database 
connection
https://projects.puppetlabs.com/issues/12702#change-59122

Author: Jan Ziegler
Status: Accepted
Priority: Normal
Assignee: Daniel Pittman
Category: stored configuration
Target version: 
Affected Puppet version: 2.7.10
Keywords: 
Branch: 


Hi,

I want to install puppet on Windows Server 2003. I already have a working 
Puppetmaster (Scientific Linux).

I installed puppet the way it's explained here:
http://projects.puppetlabs.com/projects/1/wiki/Puppet_Windows

It worked moving files locally via puppet for example.

But when I try to run puppet via Puppetmaster I always get the following Output:

<pre>
notice: Ignoring --listen on onetime run 
info: Retrieving plugin 
err: /File[C:/Dokumente und Einstellungen/All 
Users/Anwendungsdaten/PuppetLabs/puppet/var/lib]: 
  Failed to generate additional resources using 'eval_generate: Could not 
intern_multiple from pson: Paths must be fully qualified 
err: /File[C:/Dokumente und Einstellungen/All 
Users/Anwendungsdaten/PuppetLabs/puppet/var/lib]: 
  Could not evaluate: Could not intern from pson: Paths must be fully qualified 
Could not retrieve file metadata for puppet://foreman.id.dvag.com/plugins: 
Could not intern from pson: Paths must be fully qualified 
err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
PGError: 
  ERROR :  invalid byte sequence for encoding "UTF8": 0xe46973 : 
  INSERT INTO "fact_values" ("value", "host_id", "created_at", "fact_name_id", 
"updated_at") 
  VALUES ('Mitteleuropõische Zeit   ', 88, '2012-02-16 15:13:29.293099', 28, 
'2012-02-16 15:13:29.293099') RETURNING "id" 
warning: Not using cache on failed catalog 
err: Could not retrieve catalog; skipping run 
notice: /File[C:/Dokumente und Einstellungen/All 
Users/Anwendungsdaten/PuppetLabs/puppet/var/state/last_run_summary.yaml]/content:
 
</pre>

But what about the database - UTF8 Problem?
Can you please tell me why I get this error message and what can be done to fix 
it?

Thanks



-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to