Under certain orderings large numbers (>100) of tests will fail with messages similar to this:
44) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should not write graph files if the catalog is not a host cata log' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1908:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:713:in `new' ./spec/unit/resource/catalog.rb:713: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run'
The common factor in each case being the "Invalid parameter" messages and the first five lines of the stack trace.
That this is order dependent has been confirmed by making the problem appear on a fresh, unmodified copy of 0.25.0rc1 by simply touching spec files to force test execution error and then making the problem go away by touching one of the spec files again to force a different ordering.
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://reductivelabs.com/redmine/my/account
I'm raising the priority of this and setting the target to 0.25.0 since the problem is being seen while running the app rather than just running specs.
The simplest known way to reliably reproduce the error is:
touch spec/unit/parser/resource.rb
sleep 2
touch spec/integration/reference/providers.rb
sleep 2
touch spec/unit/util/backups.rb
RSPEC=/usr/lib/ruby/gems/1.8/gems/rspec-1.2.2
/usr/bin/ruby1.8 -I$RSPEC/lib $RSPEC/bin/spec \
spec/unit/parser/resource.rb \
spec/integration/reference/providers.rb \
spec/unit/util/backups.rb \
--format s --loadby mtime
This causes a slightly different message (hits it in paramcheck rather than set_parameters) but the diagnostic tests I used to isolate it indicate that it's the same basic mechanism (the data used by validattr?() is getting burked).
The following simple modification to the above provides a much better example; it reproduces all of the observed failure modes at once:
touch spec/unit/resource/catalog.rb
sleep 2
touch spec/integration/reference/providers.rb
sleep 2
touch spec/unit/util/backups.rb
RSPEC=/usr/lib/ruby/gems/1.8/gems/rspec-1.2.2
/usr/bin/ruby1.8 -I$RSPEC/lib $RSPEC/bin/spec \
spec/unit/resource/catalog.rb \
spec/integration/reference/providers.rb \
spec/unit/util/backups.rb \
--format s --loadby mtime
1) Puppet::Error in 'Puppet::Resource::Catalog when compiling when converting to a RAL catalog should add all resources as RAL instances' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./lib/puppet/resource.rb:177:in `new' ./lib/puppet/resource.rb:177:in `to_ral' ./lib/puppet/resource/catalog.rb:565:in `send' ./lib/puppet/resource/catalog.rb:565:in `to_catalog' ./lib/puppet/resource/catalog.rb:543:in `each' ./lib/puppet/resource/catalog.rb:543:in `to_catalog' ./lib/puppet/resource/catalog.rb:463:in `to_ral' ./spec/unit/resource/catalog.rb:245: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 2) Puppet::Error in 'Puppet::Resource::Catalog when compiling when converting to a RAL catalog should copy the tag list to the new catalog' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./lib/puppet/resource.rb:177:in `new' ./lib/puppet/resource.rb:177:in `to_ral' ./lib/puppet/resource/catalog.rb:565:in `send' ./lib/puppet/resource/catalog.rb:565:in `to_catalog' ./lib/puppet/resource/catalog.rb:543:in `each' ./lib/puppet/resource/catalog.rb:543:in `to_catalog' ./lib/puppet/resource/catalog.rb:463:in `to_ral' ./spec/unit/resource/catalog.rb:245: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 3) Puppet::Error in 'Puppet::Resource::Catalog when compiling when converting to a RAL catalog should copy the class list to the new catalog' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./lib/puppet/resource.rb:177:in `new' ./lib/puppet/resource.rb:177:in `to_ral' ./lib/puppet/resource/catalog.rb:565:in `send' ./lib/puppet/resource/catalog.rb:565:in `to_catalog' ./lib/puppet/resource/catalog.rb:543:in `each' ./lib/puppet/resource/catalog.rb:543:in `to_catalog' ./lib/puppet/resource/catalog.rb:463:in `to_ral' ./spec/unit/resource/catalog.rb:245: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 4) Puppet::Error in 'Puppet::Resource::Catalog when compiling when converting to a RAL catalog should duplicate the original edges' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./lib/puppet/resource.rb:177:in `new' ./lib/puppet/resource.rb:177:in `to_ral' ./lib/puppet/resource/catalog.rb:565:in `send' ./lib/puppet/resource/catalog.rb:565:in `to_catalog' ./lib/puppet/resource/catalog.rb:543:in `each' ./lib/puppet/resource/catalog.rb:543:in `to_catalog' ./lib/puppet/resource/catalog.rb:463:in `to_ral' ./spec/unit/resource/catalog.rb:245: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 5) Puppet::Error in 'Puppet::Resource::Catalog when compiling when converting to a RAL catalog should set itself as the catalog for each converted resource' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./lib/puppet/resource.rb:177:in `new' ./lib/puppet/resource.rb:177:in `to_ral' ./lib/puppet/resource/catalog.rb:565:in `send' ./lib/puppet/resource/catalog.rb:565:in `to_catalog' ./lib/puppet/resource/catalog.rb:543:in `each' ./lib/puppet/resource/catalog.rb:543:in `to_catalog' ./lib/puppet/resource/catalog.rb:463:in `to_ral' ./spec/unit/resource/catalog.rb:245: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 6) Puppet::Error in 'Puppet::Resource::Catalog when compiling when converting to a RAL catalog should not lose track of resources whose names vary' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./lib/puppet/resource.rb:177:in `new' ./lib/puppet/resource.rb:177:in `to_ral' ./lib/puppet/resource/catalog.rb:565:in `send' ./lib/puppet/resource/catalog.rb:565:in `to_catalog' ./lib/puppet/resource/catalog.rb:543:in `each' ./lib/puppet/resource/catalog.rb:543:in `to_catalog' ./lib/puppet/resource/catalog.rb:463:in `to_ral' ./spec/unit/resource/catalog.rb:245: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 7) Puppet::Error in 'Puppet::Resource::Catalog when compiling when functioning as a resource container should create aliases for resources isomorphic resources whose names do not match their titles' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:476:in `new' ./spec/unit/resource/catalog.rb:476: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 8) Puppet::Error in 'Puppet::Resource::Catalog when compiling when functioning as a resource container should add an alias for the namevar when the title and name differ on isomorphic resource types' Invalid parameter content ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:441:in `[]=' ./lib/puppet/type.rb:1935:in `set_parameters' ./lib/puppet/type.rb:1929:in `each' ./lib/puppet/type.rb:1929:in `set_parameters' ./lib/puppet/type.rb:1909:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:534:in `new' ./spec/unit/resource/catalog.rb:534: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 9) Puppet::Error in 'Puppet::Resource::Catalog when compiling when functioning as a resource container should not add an alias for the namevar when the title and name differ on non-isomorphic resource types' Invalid parameter content ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:441:in `[]=' ./lib/puppet/type.rb:1935:in `set_parameters' ./lib/puppet/type.rb:1929:in `each' ./lib/puppet/type.rb:1929:in `set_parameters' ./lib/puppet/type.rb:1909:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:542:in `new' ./spec/unit/resource/catalog.rb:542: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 10) Puppet::Error in 'Puppet::Resource::Catalog when compiling when applying should remove resources added mid-transaction' Invalid parameter ensure ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:441:in `[]=' ./lib/puppet/type.rb:1935:in `set_parameters' ./lib/puppet/type.rb:1929:in `each' ./lib/puppet/type.rb:1929:in `set_parameters' ./lib/puppet/type.rb:1909:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:638:in `new' ./spec/unit/resource/catalog.rb:638: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 11) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should be able to create a relationship graph' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 12) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should not have any components' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 13) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should have all non-component resources from the catalog' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 14) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should have all resource relationships set as edges' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 15) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should copy component relationships to all contained resources' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 16) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should add automatic relationships to the relationship graph' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 17) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should get removed when the catalog is cleaned up' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 18) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should write :relationships and :expanded_relationships graph files if the catalog is a host catalog' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 19) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should not write graph files if the catalog is not a host catalog' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 20) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should create a new relationship graph after clearing the oldone' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' 21) Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a relationship graph should remove removed resources from the relationship graph if it exists' Invalid parameter source(:source) ./lib/puppet/util/errors.rb:51:in `fail' ./lib/puppet/type.rb:418:in `[]' ./spec/../lib/puppet/type/file.rb:278:in `validate' ./lib/puppet/type.rb:1911:in `initialize' ./spec/../lib/puppet/type/file.rb:400:in `initialize' ./spec/unit/resource/catalog.rb:720:in `new' ./spec/unit/resource/catalog.rb:720: ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each' ./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run' Finished in 2.664424 seconds 127 examples, 21 failures
There's a "require 'puppet/type/file'" in the backups test file. This require is causing the File type to be reloaded after it had already loaded all of its parameters (e.g., :source), and it's another case of Puppet's loading system conflicting with ruby's loading system. If you remove this require, then I am essentially positive it will fix the problem.
There's a "require 'puppet/type/file'" in the backups test file. This require is causing the File type to be reloaded after it had already loaded all of its parameters (e.g., :source), and it's another case of Puppet's loading system conflicting with ruby's loading system.
Yeah, I'd gotten that far when I broke for lunch. My current test rig is:
#!/usr/bin/env ruby require 'test/lib/puppettest' Kernel.require 'lib/puppet/type/file' Kernel.require './lib/puppet/type/file' Puppet::Type.type(:file).new :path => "/something", :title => "other", :content => "blah"
Once I'd cleared the brush away enough to see that, a long walk, caffeine & a bagel seemed like a good idea.
If you remove this require, then I am essentially positive it will fix the problem.
There isn't an explicit require of puppet/type/file that I can find in the lib code. So pulling that out of the backups test would fix the test isolation issue, but wouldn't do anything for the harder to reproduce but doubtlessly real issue running the app (as opposed to the tests).
Solutions I'm looking at (none of which I"m in love with):
Kernel.require).As you can see, none of these are wonderful.
-- Markus
I've played around with these options a little, with the following results:
- Instead of an :overwrite => true/false option to the genclass --> genthing path, have some sort of find_or_create option that returns the existing Class/Module if it's already loaded (but doesn't run the block).
This is very easy to implement but would be a possibly significant behavior change, in that modified types would be ignored.
def genthing(name, type, options, block)
options = symbolize_options(options)
name = symbolize(name.to_s.downcase)
+ const = genconst_string(name, options)
+ return const_get(const) if const_defined? const
- Some sort of patchup/unification process to make the reloading less traumatic (e.g. more like the way ruby behaves) via getting rid of the remove_const on conflict.
This is also fairly easy to implement but also results in a behavior change: rather than objecting to duplicate parameters as it does now it would subsume ("reopen") them.
def genthing(name, type, options, block)
options = symbolize_options(options)
name = symbolize(name.to_s.downcase)
+ const = genconst_string(name, options)
+ if const_defined? const
+ evalmethod = :class_eval
+ klass = const_get(const)
+ elsif type == Module
- if type == Module
- Adding something smarter (but hopefully short of full AI) to the load process so that it doesn't try to load things twice (though note that my test rig does it all with Kernel.require).
If it weren't for the library path issues, something as simple as this would do it.
module Kernel
unless respond_to? :require_mqr
alias require_mqr require
def require(f)
require_mqr File.expand_path(f)
end
end
end
* Trying to track down the code path that Sam Rowe hit that caused it to multiply load in the running app, fixing that, and hoping to heck that it was a unique flower, once plucked n'er to bloom again.
No joy so far. And even if I do find it the "hoping like heck" doesn't appeal.
--Markus
I'm a touch confused - is this just a problem in tests, or a problem in real life?
My understanding was that this was only a test isolation problem, not something that showed up in normal usage.
If it's a test isolation problem, then my above solution fixes it. If it's a problem that shows up in normal usage, then what's causing the 'file' resource type to get reloaded? Fixing that should fix the actual problem.
Of course, another option is just to put all of the parameter definitions back into file.rb, or use 'load' instead of 'require' in file.rb so that if it does happen to get reloaded it also reloads all of its parameters.
It had been a low priority test isolation problem until Sam Rowe experienced the problem it in testing 0.25 (see the second half of http://projects.reductivelabs.com/issues/2550#note-7, also reproduced above). At that point I raised the priority and began working on it for 0.25.
Problem is, I can't come up with a plausible path for type/file.rb to be reloaded. There are a number of outlandish ways, that it might happen since things are being autoloaded, required from strings, and stuff gets evaled, etc. but nothing compelling.
Of course, another option is just to put all of the parameter definitions back into file.rb, or use 'load' instead of 'require' in file.rb so that if it does happen to get reloaded it also reloads all of its parameters.
Yeah, that handles it for type/file, and it doesn't appear that any other types are using that trick. Switching to load seems like a load impact safety net fix. I like that better than any of the ones I'd come up with.
Hmm. But it does mean we could have multiple structurally equivalent but distinct File types floating around (although only one would be directly denotable at ), and I'm not sure how that would play out with things like defaults and comparisons.
-- Markus
A clue!
Sam was seeing the problem on :ignore -- but that's one of the parameters that's set up inline in type/file.rb, not one of the ones that's required (e.g. the ones in type/file/*.rb). So it isn't affected by reloading type/file.rb at all (I just tested this to confirm).
Therefore, there are two distinct mechanisms at work: the reloading, as seen in the tests, and some as yet undiagnosed problem.
Test isolation fix pushed in commit:"c8f859e5def012ce582d73152fae54bb039c4155" in branch master.
Here's some more traces (run in succession on the same host) for your tracing enjoyment.
We'd previously mentioned a possible correlation with --ignoreschedules. None of these traces were run with --ignoreschedules.
/usr/lib/site_ruby/1.8/puppet/util/errors.rb:51:in `fail' /usr/lib/site_ruby/1.8/puppet/type.rb:441:in `[]=' /usr/lib/site_ruby/1.8/puppet/type.rb:1935:in `set_parameters' /usr/lib/site_ruby/1.8/puppet/type.rb:1929:in `each' /usr/lib/site_ruby/1.8/puppet/type.rb:1929:in `set_parameters' /usr/lib/site_ruby/1.8/puppet/type.rb:1909:in `initialize' /usr/lib/site_ruby/1.8/puppet/type/file.rb:400:in `initialize' /usr/lib/site_ruby/1.8/puppet/resource.rb:177:in `new' /usr/lib/site_ruby/1.8/puppet/resource.rb:177:in `to_ral' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:565:in `send' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:565:in `to_catalog' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:543:in `each' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:543:in `to_catalog' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:463:in `to_ral' /usr/lib/site_ruby/1.8/puppet/configurer.rb:120:in `convert_catalog' /usr/lib/site_ruby/1.8/puppet/configurer.rb:115:in `retrieve_catalog' /usr/lib/site_ruby/1.8/puppet/configurer.rb:135:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `lock' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `synchronize' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:51:in `with_client' /usr/lib/site_ruby/1.8/puppet/agent.rb:58:in `run' /usr/lib/site_ruby/1.8/puppet/application/puppetd.rb:103:in `onetime' /usr/lib/site_ruby/1.8/puppet/application/puppetd.rb:94:in `onetime' /usr/lib/site_ruby/1.8/puppet/application.rb:226:in `send' /usr/lib/site_ruby/1.8/puppet/application.rb:226:in `run_command' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `exit_on_fail' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/sbin/puppetd:159 err: Could not run Puppet configuration client: Invalid parameter :ignore at /etc/puppet/modules/nagios/manifests/init.pp:79
Note that /etc/puppet/modules/nagios/manifests/init.pp doesn't contain the word "ignore" at all. We do have a "global" ignore of .svn files in our site.pp File{ ignore => '.svn' }
Here's another run with --test --trace:
/usr/lib/site_ruby/1.8/puppet/util/errors.rb:51:in `fail' /usr/lib/site_ruby/1.8/puppet/type.rb:441:in `[]=' /usr/lib/site_ruby/1.8/puppet/type.rb:1935:in `set_parameters' /usr/lib/site_ruby/1.8/puppet/type.rb:1929:in `each' /usr/lib/site_ruby/1.8/puppet/type.rb:1929:in `set_parameters' /usr/lib/site_ruby/1.8/puppet/type.rb:1909:in `initialize' /usr/lib/site_ruby/1.8/puppet/resource.rb:177:in `new' /usr/lib/site_ruby/1.8/puppet/resource.rb:177:in `to_ral' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:565:in `send' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:565:in `to_catalog' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:543:in `each' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:543:in `to_catalog' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:463:in `to_ral' /usr/lib/site_ruby/1.8/puppet/configurer.rb:120:in `convert_catalog' /usr/lib/site_ruby/1.8/puppet/configurer.rb:115:in `retrieve_catalog' /usr/lib/site_ruby/1.8/puppet/configurer.rb:135:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `lock' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `synchronize' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:51:in `with_client' /usr/lib/site_ruby/1.8/puppet/agent.rb:58:in `run' /usr/lib/site_ruby/1.8/puppet/application/puppetd.rb:103:in `onetime' /usr/lib/site_ruby/1.8/puppet/application/puppetd.rb:94:in `onetime' /usr/lib/site_ruby/1.8/puppet/application.rb:226:in `send' /usr/lib/site_ruby/1.8/puppet/application.rb:226:in `run_command' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `exit_on_fail' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/sbin/puppetd:159 err: Could not run Puppet configuration client: Invalid parameter :ensure at /etc/puppet/modules/redhat/manifests/init.pp:199
Note that this one is :ensure.
For what it's worth, here's some lines from /var/puppet/client_yaml/catalog/hostname.yaml with line numbers:
184 - !ruby/object:Puppet::Relationship 185 source: *id003 186 target: !ruby/object:Puppet::Resource 187 catalog: *id001 188 exported: 189 file: "/etc/puppet/modules/allusers/manifests/bjones.pp" 190 line: 9 191 parameters: 192 ":gid": "4" 193 ":managehome": true 194 ":password": "$1$NFJDIlZP1.fw$2bCVCrrmfkvQRFskVzsoY." 195 ":shell": "/bin/bash" 196 ":uid": "116" 197 ":comment": Bob Jones 198 ":ensure": present 199 ":home": "/home/bjones" 200 reference: !ruby/object:Puppet::Resource::Reference 201 builtin_type: 202 title: bjones 203 type: User
Again, "ensure" appears nowhere near line 199 of /etc/puppet/modules/redhat/manifests/init.pp, but it is there on 198 of hostname.yaml. However, it doesn't always work that way.
I'm also surprised to see the symbols quoted like that, but maybe that's expected.
Here's another:
/usr/lib/site_ruby/1.8/puppet/type.rb:530:in `newattr' /usr/lib/site_ruby/1.8/puppet/type.rb:455:in `[]=' /usr/lib/site_ruby/1.8/puppet/type.rb:1919:in `set_name' /usr/lib/site_ruby/1.8/puppet/type.rb:1905:in `initialize' /usr/lib/site_ruby/1.8/puppet/type/file.rb:400:in `initialize' /usr/lib/site_ruby/1.8/puppet/resource.rb:177:in `new' /usr/lib/site_ruby/1.8/puppet/resource.rb:177:in `to_ral' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:565:in `send' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:565:in `to_catalog' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:543:in `each' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:543:in `to_catalog' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:463:in `to_ral' /usr/lib/site_ruby/1.8/puppet/configurer.rb:120:in `convert_catalog' /usr/lib/site_ruby/1.8/puppet/configurer.rb:115:in `retrieve_catalog' /usr/lib/site_ruby/1.8/puppet/configurer.rb:135:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `lock' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `synchronize' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:51:in `with_client' /usr/lib/site_ruby/1.8/puppet/agent.rb:58:in `run' /usr/lib/site_ruby/1.8/puppet/application/puppetd.rb:103:in `onetime' /usr/lib/site_ruby/1.8/puppet/application/puppetd.rb:94:in `onetime' /usr/lib/site_ruby/1.8/puppet/application.rb:226:in `send' /usr/lib/site_ruby/1.8/puppet/application.rb:226:in `run_command' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `exit_on_fail' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/sbin/puppetd:159 err: Could not run Puppet configuration client: Parameter path failed: File paths must be fully qualified, not 'usrlocalsbin'
puppetd --test --trace err: State got corrupted info: Loading facts in hardwareisa_overrides info: Loading facts in hardwaremodel_overrides info: Loading facts in tww_ssh_version info: Loading facts in fc info: Loading facts in serialnumber info: Loading facts in hardwareisa_overrides info: Loading facts in hardwaremodel_overrides info: Loading facts in tww_ssh_version info: Loading facts in fc info: Loading facts in serialnumber info: Caching catalog for ourhost.example.com /usr/lib/site_ruby/1.8/puppet/type.rb:530:in `newattr' /usr/lib/site_ruby/1.8/puppet/type.rb:455:in `[]=' /usr/lib/site_ruby/1.8/puppet/type.rb:1919:in `set_name' /usr/lib/site_ruby/1.8/puppet/type.rb:1905:in `initialize' /usr/lib/site_ruby/1.8/puppet/type/file.rb:400:in `initialize' /usr/lib/site_ruby/1.8/puppet/resource.rb:177:in `new' /usr/lib/site_ruby/1.8/puppet/resource.rb:177:in `to_ral' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:565:in `send' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:565:in `to_catalog' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:543:in `each' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:543:in `to_catalog' /usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:463:in `to_ral' /usr/lib/site_ruby/1.8/puppet/configurer.rb:120:in `convert_catalog' /usr/lib/site_ruby/1.8/puppet/configurer.rb:115:in `retrieve_catalog' /usr/lib/site_ruby/1.8/puppet/configurer.rb:135:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `lock' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `synchronize' /usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/site_ruby/1.8/puppet/agent.rb:51:in `with_client' /usr/lib/site_ruby/1.8/puppet/agent.rb:58:in `run' /usr/lib/site_ruby/1.8/puppet/application/puppetd.rb:103:in `onetime' /usr/lib/site_ruby/1.8/puppet/application/puppetd.rb:94:in `onetime' /usr/lib/site_ruby/1.8/puppet/application.rb:226:in `send' /usr/lib/site_ruby/1.8/puppet/application.rb:226:in `run_command' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `exit_on_fail' /usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/sbin/puppetd:159 err: Could not run Puppet configuration client: Parameter path failed: File paths must be fully qualified, not 'exorcise'
'exorcise' is the name of one of our scripts that we distribute via puppet.
We tried to get you one with :before, but couldn't make it do it. As I explained to Luke, we're happy to give you access if that will help.