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

Bug #11306

puppet 2.7.8-1 bug under ruby 1.8.5/centos 5.7

Added by Alexey Wasilyev over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:12/09/2011
Priority:HighDue date:
Assignee:Nick Lewis% Done:

0%

Category:plumbing
Target version:2.7.9
Affected Puppet version:2.7.8 Branch:
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

  • centos 5.7 with all updates.
  • puppet 2.7.8-1 from http://yum.puppetlabs.com/el/5/products/x86_64/
  • ruby-1.8.5-19.el5_6.1

when i try to run puppetd -t i get “err: /File[/var/lib/puppet/lib]: Failed to generate additional resources using ‘eval_generate: odd number of arguments for Hash” running ruby —debug /usr/sbin/puppetd -t show me, that error occurs in file /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb, row 153:

return false unless resource.respond_to?(:eval_generate)
raise Puppet::DevError,"Depthfirst resources are not supported by eval_generate" if resource.depthfirst?
begin
  made = resource.eval_generate.uniq
  return false if made.empty?
  made = Hash[made.map(&:name).zip(made)]  ### HERE
rescue => detail
  puts detail.backtrace if Puppet[:trace]
  resource.err "Failed to generate additional resources using 'eval_generate: #{detail}"
  return false
end

History

#1 Updated by Stefan Schulte over 2 years ago

looks like puppet is using a language feature that is only available in ruby >=1.8.7

Can you please try to perform the following change to see if I’m correct

- made = Hash[made.map(&:name).zip(made)]
+ made = Hash[made.map { |r| r.name }.zip(made)]

#2 Updated by Alexey Wasilyev over 2 years ago

same thing: Exception `ArgumentError' at /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:153 – odd number of arguments for Hash err: /File[/var/lib/puppet/lib]: Failed to generate additional resources using ‘eval_generate: odd number of arguments for Hash

[awasilyev@adm-files ~]$ head -n 153 /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb|tail -n 1

  made = Hash[made.map { |r| r.name }.zip(made)]

#3 Updated by Phil Roffe over 2 years ago

I also have this same issue… RHEL 5.6, puppet-2.7.8-1.el5, ruby-1.8.5-5.el5_4.8

# rpm -qa | grep "ruby\|facter\|augeas\|puppet"
ruby-shadow-1.4.1-7.el5
facter-1.6.4-1.el5
ruby-1.8.5-5.el5_4.8
libselinux-ruby-1.33.4-5.7.el5
puppet-2.7.8-1.el5
ruby-libs-1.8.5-5.el5_4.8
ruby-augeas-0.4.1-1.el5
augeas-libs-0.10.0-1.el5

I also tried the patch to transaction.rb as described in comment #1 but to no avail – same error.

Downgrading puppet to puppet-2.7.6-2.el5 fixed the problem… maybe issues with ruby/puppet versions?

#4 Updated by James Turnbull over 2 years ago

  • Category set to plumbing
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Jason McKerr

Jason – looks like a possible regression in the 2.7.8 release.

#5 Updated by Marc DiBlasi over 2 years ago

I had the same issue with CentOS 5.5, ruby 1.8.5, Puppet 2.7.8-1. I upgraded to ruby 1.8.7 and it fixed the issue.

#6 Updated by Nick Fagerlund over 2 years ago

  • Description updated (diff)

#7 Updated by Josh Cooper over 2 years ago

  • Status changed from Needs Decision to Accepted
  • Assignee changed from Jason McKerr to Nick Lewis

#8 Updated by Nick Lewis over 2 years ago

  • Status changed from Accepted to Merged - Pending Release

A fix for this is merged to 2.7rc in commit:234afdf.

This 1.8.5-incompatible code wasn’t caught because of a long-standing bug in our tests that went unnoticed because of a bug in our CI setup. The former issue caused specs to fail before they even started running on 1.8.5, and the latter caused the run to still be reported as successful. We’ve fixed the former bug, but haven’t yet figured out a way to fix the latter (as it seems to be a bug in Ruby 1.8.5 + rspec). We will, however, be taking steps to ensure that such problems with our CI setup are more visible and caught sooner.

#9 Updated by Matthaus Owens over 2 years ago

  • Status changed from Merged - Pending Release to Closed
  • Target version changed from 2.7.x to 2.7.9

Released in puppet 2.7.9

Also available in: Atom PDF