Issue #7422 has been updated by Chad Metcalf.

We're hitting this and are working around it for now. Relates to #6748?
----------------------------------------
Bug #7422: undefined method `<<' for {}:Hash when combining resource chaining, 
metaparameters, and autorequire
https://projects.puppetlabs.com/issues/7422

Author: Nick Fagerlund
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.6.4
Keywords: 
Branch: 


So I was talking with Markus and Dan about some weird autorequire behavior, and 
ran into this. Assume you have the requisite files in /tmp:

    # tree /tmp
    /tmp
    |-- a
    |   `-- b
    `-- c

Then, if you run this manifest:

    # autocycle.pp 
    file { "/tmp/a": 
      ensure => absent, 
      force => true,
    }
    file { "/tmp/a/b": 
      ensure => absent, 
      content => 'foo', 
      before => File['/tmp/a'], 
    }
    file { "/tmp/c": 
      ensure => absent, 
      content => 'bar', 
    }
    File['/tmp/a/b'] -> File['/tmp/c'] -> File['/tmp/a']

...you get this:

    [root@puppet learning-manifests]# puppet apply --trace autocycle.pp 
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/resource.rb:103:in `send'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/resource.rb:103:in `<<'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:41:in 
`mk_relationship'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:19:in 
`evaluate'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:18:in 
`each'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:18:in 
`evaluate'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:17:in 
`each'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:17:in 
`evaluate'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:162:in 
`evaluate_relationships'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:162:in `each'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:162:in 
`evaluate_relationships'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:341:in `finish'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:109:in 
`compile'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:18:in `compile'
    
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:77:in 
`compile'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/util.rb:197:in `benchmark'
    
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:75:in 
`compile'
    
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:34:in 
`find'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:193:in 
`find'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector.rb:50:in `find'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:115:in `main'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:35:in 
`run_command'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:393:in 
`exit_on_fail'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in 
`execute'
    /usr/local/bin/puppet:4
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:21:in `compile'
    
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:77:in 
`compile'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/util.rb:197:in `benchmark'
    
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:75:in 
`compile'
    
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:34:in 
`find'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:193:in 
`find'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/indirector.rb:50:in `find'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:115:in `main'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:35:in 
`run_command'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:393:in 
`exit_on_fail'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'
    /opt/puppet/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in 
`execute'
    /usr/local/bin/puppet:4
    undefined method `<<' for {}:Hash on node puppet.localdomain

What it SHOULD do is reverse /tmp/a/b's autorequire of /tmp/a (to avoid the 
cycle we would otherwise get), then delete /tmp/a/b, /tmp/c, and /tmp/a in that 
order. Instead, we have an exposed internal Ruby error. Any clues?



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