Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change in puppet 4.5.0 causing archive type to fail when extract_path not used #166

Closed
hdeadman opened this issue May 18, 2016 · 4 comments

Comments

@hdeadman
Copy link
Contributor

I think something may have changed in the newly release Puppet 4.5.0 that makes this statement from
archive.rb fail:

  autorequire(:file) do
    [
      Pathname.new(self[:path]).parent.to_s,
      self[:extract_path],
      '/root/.aws/config',
      '/root/.aws/credentials',
    ]
  end

It fails if the extract_path parameter is not used (which is the case in the rtyler/jenkins plugin.pp file. When it fails the error message is as follows:

 Error: Failed to apply catalog: No title provided and :file is not a valid resource reference

There is no indication of where in the catalog that error is coming from so it is painful to track down.

The fix is to make the autorequire of a file named self[:extract_path] conditional on that parameter being defined.

@petems
Copy link
Member

petems commented May 19, 2016

@hdeadman if you run puppet with --trace does it show you where the error is coming from?

@hdeadman
Copy link
Contributor Author

Here is the trace but it doesn't help too much. It does show the problem coming from an autorequire. I know the cause is the self[:extract_path] line because I can comment that out and it will run. I am invoking archive indirectly through jenkins::plugin{'git': } and the error only happens if the jenkins plugin is not already installed.

==> services1: Notice: Compiled catalog for services1.redacted in environment local in 39.74 seconds
==> services1: Error: Failed to apply catalog: No title provided and :file is not a valid resource reference
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource.rb:544:in `extract_type_and_title'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource.rb:529:in `type_and_title'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:353:in `resource'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2138:in `block (2 levels) in autorelation'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2134:in `each'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2134:in `block in autorelation'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2069:in `block in eachautorequire'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2068:in `each'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2068:in `eachautorequire'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2125:in `autorelation'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2155:in `autorequire'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:169:in `block (2 levels) in build_autorelation_dependencies'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:168:in `each'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:168:in `block in build_autorelation_dependencies'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:167:in `each'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:167:in `build_autorelation_dependencies'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:25:in `populate_from'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:246:in `relationship_graph'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:175:in `relationship_graph'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:141:in `evaluate'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:222:in `block in apply'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:118:in `as_logging_destination'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:221:in `apply'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `block in apply_catalog'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `block in benchmark'
==> services1: /opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:222:in `benchmark'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:170:in `apply_catalog'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:315:in `run_internal'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:186:in `block in run'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:240:in `override'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:185:in `run'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:350:in `apply_catalog'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:274:in `block in main'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:240:in `override'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:225:in `main'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:170:in `run_command'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `block in run'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:540:in `exit_on_fail'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `run'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:128:in `run'
==> services1: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
==> services1: /opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

@petems
Copy link
Member

petems commented May 19, 2016

Hmm, ok, I was curious if it would show the actual provider line that it was erroring out on but no such luck 😞 But yes it looks like the likely culprit is the self[:extract_path] line

@nibalizer
Copy link
Member

Firexd in #167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants