Issue #22817 has been updated by Henrik Lindberg.

Status changed from Unreviewed to Needs More Information

Hm, I have not been able to  reproduce this.

Looks like activesupport is doing something it is not supposed to do - adding 
aliased methods.
In the dev environment, the version of activesupport is 3.0.20

You say it was working fine - have you done something to your set of gems?
Which Ruby version are you using?
Which version of rgen do you have installed?

If you are Ruby savvy, you can set a breakpoint near 
/usr/lib/ruby/site_ruby/rgen/metamodel_builder.rb:198:in `method_added' where 
it raises an exception with the message: "Do not add methods to model classes 
directly"
and look at which method it is trying to add. (Alternative, add that method 
name to the message and run again). That may provide a clue to who is trying to 
alter the class.

However, I would first make sure that all the gems have versions that are known 
to work.


----------------------------------------
Bug #22817: enabling future parser breaks puppet - "Do not add methods to model 
classes directly..."
https://projects.puppetlabs.com/issues/22817#change-98689

* Author: Chad Huneycutt
* Status: Needs More Information
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
After enabling the future parser, agent runs fail with "Could not parse for 
environment X: Do not add methods to model classes directly, add them to the 
ClassModule instead on node foo.bar"

This happens even with an empty node definition.

up-to-date RHEL6.4 on master and agent with puppet 3.3.1 from puppetlabs repo

The master is run via apache+passenger.

puppet.conf on master: 

<pre>
[main]
    dbadapter = mysql
    dbuser = puppet
    dbpassword = myultrasecretpassword
    dbserver = localhost
    dbsocket = /var/lib/mysql/mysql.sock

[master]
    vardir = /var/lib/puppetmaster
    ssldir = /var/lib/puppetmaster/ssl
    rundir = /var/run/puppet
    autosign = true
    modulepath = 
/etc/puppet/environments/$environment/modules:/etc/puppet/environments/common/modules
    manifest = /etc/puppet/environments/$environment/site.pp
    hiera_config = /etc/puppet/hiera.yaml

    reports = log, foreman

    # set default env for unconfigured nodes
    environment = infrastructure
    storeconfigs = true
    parser = future
</pre>


puppet.conf on agent:

<pre>
[agent]
    server = trantor.vm
    vardir = /var/lib/puppet
    ssldir = $vardir/ssl

    report = true
    pluginsync = true

    environment = research
</pre>

site.pp:

<pre>
node default {
}
</pre>

Here's the master trace:

<pre>
Error: Could not parse for environment research: Do not add methods to model 
classes directly, add them to the ClassModule instead on node anacreon.vm
/usr/lib/ruby/site_ruby/rgen/metamodel_builder.rb:198:in `method_added'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/core_ext/module/aliasing.rb:33:in
 `alias_method'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/core_ext/module/aliasing.rb:33:in
 `alias_method_chain'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:142:in
 `included'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:140:in
 `class_eval'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:140:in
 `included'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:15:in `include'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:15:in `MMMultiple'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:14:in 
`instance_eval'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:14:in `MMMultiple'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:12:in `each'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:12:in `MMMultiple'
/usr/lib/ruby/site_ruby/rgen/ecore/ecore.rb:20
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:184:in
 `require'
/usr/lib/ruby/site_ruby/rgen/transformer.rb:1
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:184:in
 `require'
/usr/lib/ruby/site_ruby/rgen/ecore/ruby_to_ecore.rb:1
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:184:in
 `require'
/usr/lib/ruby/site_ruby/rgen/ecore/ecore_interface.rb:22:in `ecore'
/usr/lib/ruby/site_ruby/1.8/puppet/pops/containment.rb:28:in `eAllContents'
/usr/lib/ruby/site_ruby/1.8/puppet/pops/containment.rb:20:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/pops/validation/checker3_1.rb:39:in 
`validate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/e_parser_adapter.rb:61:in `validate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/e_parser_adapter.rb:38:in `parse'
/usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:468:in 
`perform_initial_import'
/usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:219:in 
`known_resource_types'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:216:in 
`known_resource_types'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/type_collection_helper.rb:5:in 
`known_resource_types'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:465:in `initvars'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:202:in `initialize'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:29:in `new'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:29:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:88:in 
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler.rb:26:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:86:in 
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:182:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:181:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:85:in 
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:45:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:197:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:140:in `do_find'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:97:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:97:in `process'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler.rb:26:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:91:in `process'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick/rest.rb:31:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:35:in `listen'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `call'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:32:in `listen'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:31:in `initialize'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:31:in `new'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:31:in `listen'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:28:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:28:in `listen'
/usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:27:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet/daemon.rb:139:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:289:in 
`start_webrick_master'
/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:205:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:165:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:364:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:457:in `plugin_hook'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:364:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:511:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:364:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:132:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:86:in `execute'
/usr/bin/puppet:4
Error: Could not parse for environment research: Do not add methods to model 
classes directly, add them to the ClassModule instead on node anacreon.vm
Error: Could not parse for environment research: Do not add methods to model 
classes directly, add them to the ClassModule instead on node anacreon.vm
/usr/lib/ruby/site_ruby/rgen/metamodel_builder.rb:198:in `method_added'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/core_ext/module/aliasing.rb:33:in
 `alias_method'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/core_ext/module/aliasing.rb:33:in
 `alias_method_chain'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:142:in
 `included'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:140:in
 `class_eval'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:140:in
 `included'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:15:in `include'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:15:in `MMMultiple'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:14:in 
`instance_eval'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:14:in `MMMultiple'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:12:in `each'
/usr/lib/ruby/site_ruby/rgen/metamodel_builder/mm_multiple.rb:12:in `MMMultiple'
/usr/lib/ruby/site_ruby/rgen/ecore/ecore.rb:20
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:184:in
 `require'
/usr/lib/ruby/site_ruby/rgen/transformer.rb:1
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:184:in
 `require'
/usr/lib/ruby/site_ruby/rgen/ecore/ruby_to_ecore.rb:1
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.16/lib/active_support/dependencies.rb:184:in
 `require'
/usr/lib/ruby/site_ruby/rgen/ecore/ecore_interface.rb:22:in `ecore'
/usr/lib/ruby/site_ruby/1.8/puppet/pops/containment.rb:28:in `eAllContents'
/usr/lib/ruby/site_ruby/1.8/puppet/pops/containment.rb:20:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/pops/validation/checker3_1.rb:39:in 
`validate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/e_parser_adapter.rb:61:in `validate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/e_parser_adapter.rb:38:in `parse'
/usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:468:in 
`perform_initial_import'
/usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:219:in 
`known_resource_types'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:216:in 
`known_resource_types'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/type_collection_helper.rb:5:in 
`known_resource_types'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:465:in `initvars'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:202:in `initialize'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:29:in `new'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:29:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:88:in 
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler.rb:26:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:86:in 
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:182:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:181:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:85:in 
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:45:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:197:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:140:in `do_find'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:97:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:97:in `process'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler.rb:26:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:91:in `process'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick/rest.rb:31:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:35:in `listen'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `call'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:32:in `listen'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:31:in `initialize'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:31:in `new'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:31:in `listen'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:28:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:28:in `listen'
/usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:27:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet/daemon.rb:139:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:289:in 
`start_webrick_master'
/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:205:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:165:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:364:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:457:in `plugin_hook'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:364:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:511:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:364:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:132:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:86:in `execute'
/usr/bin/puppet:4
</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 unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
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