The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #5298

Cannot find an exported define if code haven't yet been autoloaded on compile instance for the collecting host.

Added by Peter Meier over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:11/15/2010
Priority:HighDue date:
Assignee:Markus Roberts% Done:

0%

Category:plumbing
Target version:2.6.3
Affected Puppet version:2.6.3rc3 Branch:http://github.com/MarkusQ/puppet/tree/ticket/2.6.x/5298
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

Given a define that is exported on host A and collected on host B, but host B does not apply the define itself (and the current instance has not yet loaded the code for the define) hence it only applies the collected one, we get the following error:

Server:

/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/util/errors.rb:60:in `fail'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/resource.rb:75:in `evaluate'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:255:in `evaluate_definitions'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:255:in `each'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:255:in `evaluate_definitions'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/util/errors.rb:35:in `exceptwrap'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:254:in `evaluate_definitions'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:270:in `evaluate_generators'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:265:in `loop'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:265:in `evaluate_generators'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:107:in `compile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:18:in `compile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector/catalog/compiler.rb:77:in `compile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/util.rb:192:in `benchmark'
/opt/ruby-enterprise/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/util.rb:191:in `benchmark'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector/catalog/compiler.rb:75:in `compile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector/catalog/compiler.rb:34:in `find'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector/indirection.rb:193:in `find'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector.rb:50:in `find'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/handler.rb:101:in `do_find'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/handler.rb:68:in `send'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/handler.rb:68:in `process'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick/rest.rb:24:in `service'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:45
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:173:in `call'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:162:in `start'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:95:in `start'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:92:in `each'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:92:in `start'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:23:in `start'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:82:in `start'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:42:in `listen'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:41:in `initialize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:41:in `new'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:41:in `listen'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:38:in `synchronize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:38:in `listen'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/server.rb:127:in `listen'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/server.rb:142:in `start'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/daemon.rb:124:in `start'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application/master.rb:114:in `main'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application/master.rb:46:in `run_command'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application.rb:287:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application.rb:393:in `exit_on_fail'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application.rb:287:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/util/command_line.rb:55:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/bin/puppet:4
/opt/ruby-enterprise/bin/puppet:19:in `load'
/opt/ruby-enterprise/bin/puppet:19
err: Cannot find definition Awstats::Server::Sitestorage at line 64 on node foo.bar.ch
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/parser/compiler.rb:21:in `compile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector/catalog/compiler.rb:77:in `compile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/util.rb:192:in `benchmark'
/opt/ruby-enterprise/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/util.rb:191:in `benchmark'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector/catalog/compiler.rb:75:in `compile'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector/catalog/compiler.rb:34:in `find'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector/indirection.rb:193:in `find'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/indirector.rb:50:in `find'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/handler.rb:101:in `do_find'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/handler.rb:68:in `send'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/handler.rb:68:in `process'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick/rest.rb:24:in `service'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:45
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:173:in `call'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:162:in `start'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:95:in `start'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:92:in `each'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:92:in `start'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:23:in `start'
/opt/ruby-enterprise/lib/ruby/1.8/webrick/server.rb:82:in `start'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:42:in `listen'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:41:in `initialize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:41:in `new'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:41:in `listen'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:38:in `synchronize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/http/webrick.rb:38:in `listen'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/server.rb:127:in `listen'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/network/server.rb:142:in `start'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/daemon.rb:124:in `start'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application/master.rb:114:in `main'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application/master.rb:46:in `run_command'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application.rb:287:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application.rb:393:in `exit_on_fail'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/application.rb:287:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/lib/puppet/util/command_line.rb:55:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/puppet-2.6.3/bin/puppet:4
/opt/ruby-enterprise/bin/puppet:19:in `load'
/opt/ruby-enterprise/bin/puppet:19
err: Cannot find definition Awstats::Server::Sitestorage at line 64 on node foo.bar.ch

Client:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Cannot find definition Awstats::Server::Sitestorage at line 64 on node foo.bar.ch

This is likely an autoloading issue, as if I run this code on a webrick (single thread) and I run puppet on host A (which is exporting the define) prior to host B (which collects the exported resources) it will work on subsequent runs on host B.

However, obviously this is hard to ensure on a passenger based host.

This means that exported resources are currently not (really) working on 2.6.x, therefor I set the priority as high.

Additionally the error message is not very helpful (which line 64?) and I’m going to file that as another bug report.


Related issues

Related to Puppet - Bug #4397: A toplevel class is shadowing a class inside a namespace ... Closed 07/29/2010
Related to Puppet - Bug #4344: Templates fails sometimes on 2.6 Closed 07/23/2010
Duplicated by Puppet - Bug #4094: Exported Resources cannot find exported customs defines i... Duplicate 06/29/2010

History

#1 Updated by Markus Roberts over 3 years ago

  • Status changed from Unreviewed to Investigating
  • Assignee set to Markus Roberts

#2 Updated by Markus Roberts over 3 years ago

  • Status changed from Investigating to Accepted

If this is a regression it appears to be a consequence of the fix for #4344 in commit:449315a2c705df2396852462a1d1e14774b9f117

[#4397]+[#4344] Move type-name resolution out of Puppet::Resource into the AST resources.

Move type-name resolution out of Puppet::Resource into the AST resources.
Move find_resource_type out of Puppet::Resource into Scope
Thus, never pass unqualified type names to Puppet::Resource objects.
Thus, Puppet::Resource objects don't need the namespace property,
and Puppet::Resource objects never consult the harddrive to look for
.pp files that might contain their type definitions,
Thus, performance is improved.

Also removes the temporary fix for #4257 that caused #4397
(The code was too eager to look for a class in the topscope)

#3 Updated by Markus Roberts over 3 years ago

After several false starts I’ve been able to reproduce this with a simple case, though there are still a few questions in my mind about the mechanism.

#4 Updated by Markus Roberts over 3 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to http://github.com/MarkusQ/puppet/tree/ticket/2.6.x/5298

The above mentioned patch missed a case.

#5 Updated by James Turnbull over 3 years ago

  • Category set to plumbing
  • Target version set to 2.6.3

#6 Updated by Markus Roberts over 3 years ago

  • Status changed from In Topic Branch Pending Review to Ready For Checkin

#7 Updated by Markus Roberts over 3 years ago

  • Status changed from Ready For Checkin to Closed

Added to 2.6.x as commit:b2ff6a50202a05f2925fa5046a39ef7f163983f1

Also available in: Atom PDF