Issue #3751 has been updated by Markus Roberts.

Category set to serialization
Status changed from Investigating to Accepted

Given the information above, I was able to produce a variant of the symptoms 
which led to a theory as to the cause.  We have a number of hacks/odd ways of 
doing things to deal with the fact that ruby's built in YAML doesn't properly 
encode certain data structures.  When we switched to zaml these bugs went away, 
but the fixups to work around them were left in place.

As an example, with stock ruby's yaml we get this amazing error:

<pre>
> irb
>> require "yaml"
=> false
>> YAML.load(YAML.dump("\n"))
=> ""
</pre>

vs. the correct results with zaml:

<pre>
> irb
>> require "lib/puppet/util/zaml.rb"
=> true
>> YAML.load(ZAML.dump("\n"))
=> "\n"
</pre>

The long-term correct fix is probably to find and remove the no-longer valid 
fixups, but for the moment the cleanest solution is to patch zaml so that it no 
longer produces the cases that will trigger them.

This patch:

<pre>
diff --git a/lib/puppet/util/zaml.rb b/lib/puppet/util/zaml.rb
index dcf0e19..22045e1 100644
--- a/lib/puppet/util/zaml.rb
+++ b/lib/puppet/util/zaml.rb
@@ -234,7 +234,7 @@ class String
                     (self =~ /\s$/) or
                     (self =~ /^[>|][-+\d]*\s/i) or
                     (self[-1..-1] =~ /\s/) or 
-                    (self =~ /[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\xFF]/) or
+                    (self =~ /[\x00-\x08\x0A-\x1F\x80-\xFF]/) or
                     (self =~ /[,\[\]\{\}\r\t]|:\s|\s#/) or 
                     (self =~ /\A([-:?!#&*'"]|<<|%.+:.)/) 
                     )
</pre>

This causes zaml to always escape \r and \n when they occur in strings, thus 
resulting in slightly less human-readable output, but guarantees the line 
endings won't get "corrected" thus preserving the string's value.

-- Markus

Ohad --

Could you try this patch on your 0.25.5pre puppetmaster on top of Luke's fix 
for #3640, and see if it works with your 0.24.8 client without needing the 
--preferred_serialization_format option? 

-- Markus
----------------------------------------
Bug #3751: 0.25.5rc2 server fails with 0.24-8 client
http://projects.puppetlabs.com/issues/3751

Author: Ohad Levy
Status: Accepted
Priority: Normal
Assigned to: 
Category: serialization
Target version: 
Affected version: 0.25.5rc2
Keywords: 
Branch: 


During tests on RC2, I've got the following error message on a 0.24-8 client:
<pre>
    warning: Configuration could not be instantiated: interning empty string
</pre>

this is the trace from the client
<pre>
    /usr/lib/ruby/site_ruby/1.8/puppet/metatype/manager.rb:114:in `to_sym'
    /usr/lib/ruby/site_ruby/1.8/puppet/metatype/manager.rb:114:in `type'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:90:in `to_type'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:198:in `to_catalog'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:126:in `each'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:126:in `each'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:195:in `to_catalog'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:204:in `call'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:204:in `to_catalog'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:126:in `each'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:126:in `each'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:195:in `to_catalog'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:210:in `call'
    /usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:210:in `to_catalog'
    /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:172:in 
`getconfig'
    /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:245:in `run'
    /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:426:in `thinmark'
    /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
    /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:in `thinmark'
    /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:244:in `run'
    /usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
    /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:237:in `run'
    /usr/sbin/puppetd:417
</pre>

on the server side, there are no errors e.g:
<pre>
Compiled catalog for certname in 1.14 seconds
</pre>



-- 
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