Issue #11232 has been reported by Remi Broemeling.

----------------------------------------
Bug #11232: Puppet cannot "require 'md5'" on MRI Ruby 1.9.3
https://projects.puppetlabs.com/issues/11232

Author: Remi Broemeling
Status: Unreviewed
Priority: Normal
Assignee: 
Category: ruby19
Target version: 
Affected Puppet version: 2.7.6
Keywords: md5 ruby19
Branch: 


We are attempting to migrate from REE to MRI Ruby 1.9.3, but our puppet 
installation (puppet v2.7.6, facter v1.6.1) is immediately erroring out 
whenever I try and execute it, with a number of warnings about confinetest 
'operatingsystem' and finally erroring out when it cannot require 'md5'.

Complete text of an attempted execution follows

`$ sudo -E puppet apply --modulepath="$(pwd)/puppet/modules" 
--templatedir="$(pwd)/puppet/templates" --verbose 
"$(pwd)/puppet/manifests/site.pp" --debug
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/facter-1.6.1/lib/facter/util/config.rb:7:
 Use RbConfig instead of obsolete and deprecated Config.
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require': iconv will be deprecated in the future, use String#encode instead.
info: Loading facts in block_devices
debug: importing '/home/foo/infrastructure/current/puppet/manifests/line.pp' in 
environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/node_templates/database.pp' 
in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/node_templates/delayed_jobs.pp'
 in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/node_templates/app_server.pp'
 in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/333980-db02.rs.goclio.com.pp'
 in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/cron.rs.goclio.com.pp' 
in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/333939-web01.rs.goclio.com.pp'
 in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/dj02.rs.goclio.com.pp' 
in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/monitor.rs.goclio.com.pp'
 in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/333963-web02.rs.goclio.com.pp'
 in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/ci.rs.goclio.com.pp' 
in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/333965-db01.rs.goclio.com.pp'
 in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/dj03.rs.goclio.com.pp' 
in environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/manifests/nodes/dj01.rs.goclio.com.pp' 
in environment production
debug: Failed to load library 'selinux' for feature 'selinux'
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/networking/manifests/init.pp' 
in environment production
debug: Automatically imported networking from networking into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/networking/manifests/denyhosts.pp'
 in environment production
debug: Automatically imported networking::denyhosts from networking/denyhosts 
into production
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
debug: Puppet::Type::Package::ProviderRpm: Executing '/bin/rpm --version'
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm --version'
debug: Puppet::Type::Package::ProviderAptrpm: Executing '/bin/rpm -ql rpm'
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
debug: Puppet::Type::Package::ProviderUrpmi: Executing '/bin/rpm -ql rpm'
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/provider/service/freebsd.rb:8:
 warning: class variable access from toplevel
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/provider/service/freebsd.rb:9:
 warning: class variable access from toplevel
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/provider/service/freebsd.rb:10:
 warning: class variable access from toplevel
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/provider/service/bsd.rb:11:
 warning: class variable access from toplevel
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/networking/manifests/iptables.pp'
 in environment production
debug: Automatically imported networking::iptables from networking/iptables 
into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/networking/manifests/utilities.pp'
 in environment production
debug: Automatically imported networking::utilities from networking/utilities 
into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/clock/manifests/init.pp' in 
environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/clock/manifests/ntp.pp' in 
environment production
debug: Automatically imported clock::ntp from clock/ntp into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/clock/manifests/system.pp' in 
environment production
debug: Automatically imported clock::system from clock/system into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/dsh/manifests/init.pp' in 
environment production
debug: Automatically imported dsh from dsh into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/nagios/manifests/init.pp' in 
environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/nagios/manifests/send_nsca.pp' 
in environment production
debug: Automatically imported nagios::send_nsca from nagios/send_nsca into 
production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/postfix/manifests/init.pp' in 
environment production
debug: Automatically imported postfix from postfix into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/python/manifests/init.pp' in 
environment production
debug: Automatically imported python from python into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/shell/manifests/init.pp' in 
environment production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/shell/manifests/environment.pp'
 in environment production
debug: Automatically imported shell::environment from shell/environment into 
production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/snmpd/manifests/init.pp' in 
environment production
debug: Automatically imported snmpd from snmpd into production
debug: Scope(Class[Snmpd]): Retrieving template snmpd/etc/snmp/snmpd.conf.erb
debug: 
template[/home/foo/infrastructure/current/puppet/modules/snmpd/templates/etc/snmp/snmpd.conf.erb]:
 Bound template variables for 
/home/foo/infrastructure/current/puppet/modules/snmpd/templates/etc/snmp/snmpd.conf.erb
 in 0.00 seconds
debug: 
template[/home/foo/infrastructure/current/puppet/modules/snmpd/templates/etc/snmp/snmpd.conf.erb]:
 Interpolated template 
/home/foo/infrastructure/current/puppet/modules/snmpd/templates/etc/snmp/snmpd.conf.erb
 in 0.00 seconds
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/ssh/manifests/init.pp' in 
environment production
debug: Automatically imported ssh from ssh into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/sudo/manifests/init.pp' in 
environment production
debug: Automatically imported sudo from sudo into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/system/manifests/init.pp' in 
environment production
debug: Automatically imported system from system into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/system/manifests/development.pp'
 in environment production
debug: Automatically imported system::development from system/development into 
production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/system/manifests/log4r.pp' in 
environment production
debug: Automatically imported system::log4r from system/log4r into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/system/manifests/logwatch.pp' 
in environment production
debug: Automatically imported system::logwatch from system/logwatch into 
production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/system/manifests/syslog.pp' in 
environment production
debug: Automatically imported system::syslog from system/syslog into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/system/manifests/utilities.pp' 
in environment production
debug: Automatically imported system::utilities from system/utilities into 
production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/user/manifests/init.pp' in 
environment production
debug: Automatically imported user from user into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/user/manifests/clio.pp' in 
environment production
debug: Automatically imported user::clio from user/clio into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/user/manifests/virtual.pp' in 
environment production
debug: Automatically imported user::virtual from user/virtual into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/user/manifests/consultants.pp' 
in environment production
debug: Automatically imported user::consultants from user/consultants into 
production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/user/manifests/graphite.pp' in 
environment production
debug: Automatically imported user::graphite from user/graphite into production
debug: Failed to load library 'ldap' for feature 'ldap'
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/user/manifests/nginx.pp' in 
environment production
debug: Automatically imported user::nginx from user/nginx into production
debug: importing 
'/home/foo/infrastructure/current/puppet/modules/user/manifests/puppet.pp' in 
environment production
debug: Automatically imported user::puppet from user/puppet into production
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require': cannot load such file -- md5 (LoadError)
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/functions/md5.rb:2:in
 `block in <top (required)>'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/ast/function.rb:33:in
 `evaluate'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/ast.rb:76:in
 `safeevaluate'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/ast/vardef.rb:16:in
 `evaluate'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/ast.rb:76:in
 `safeevaluate'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/ast/astarray.rb:25:in
 `block in evaluate'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/ast/astarray.rb:20:in
 `each'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/ast/astarray.rb:20:in
 `evaluate'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/ast.rb:76:in
 `safeevaluate'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/resource/type.rb:74:in
 `evaluate_code'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/resource.rb:85:in
 `evaluate'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:260:in
 `block (2 levels) in evaluate_definitions'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:260:in
 `each'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:260:in
 `block in evaluate_definitions'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/util/errors.rb:35:in
 `exceptwrap'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:259:in
 `evaluate_definitions'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:275:in
 `block in evaluate_generators'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:270:in
 `loop'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:270:in
 `evaluate_generators'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:105:in
 `compile'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:24:in
 `compile'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/indirector/catalog/compiler.rb:77:in
 `block in compile'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/util.rb:185:in
 `benchmark'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/indirector/catalog/compiler.rb:75:in
 `compile'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/indirector/catalog/compiler.rb:35:in
 `find'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/indirector/indirection.rb:189:in
 `find'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/application/apply.rb:204:in
 `main'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/application/apply.rb:135:in
 `run_command'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/application.rb:306:in
 `block (2 levels) in run'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/application.rb:410:in
 `hook'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/application.rb:306:in
 `block in run'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/application.rb:401:in
 `exit_on_fail'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/application.rb:306:in
 `run'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/util/command_line.rb:69:in
 `execute'
        from 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/bin/puppet:4:in
 `<top (required)>'
        from /usr/local/bin/puppet:19:in `load'
        from /usr/local/bin/puppet:19:in `<main>'`

Looking at the file involved, it looks like it has not yet been updated for the 
new 'md5' module required on Ruby 1.9.x:

`$ cat 
/usr/local/stow/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/functions/md5.rb
Puppet::Parser::Functions::newfunction(:md5, :type => :rvalue, :doc => "Returns 
a MD5 hash value from a provided string.") do |args|
      require 'md5'

      Digest::MD5.hexdigest(args[0])
end`

... I believe that should be "require 'digest/md5'", not "require 'md5'".


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