melezhik / cookbooks

perl chef cookbooks
https://github.com/melezhik/cookbooks
21 stars 27 forks source link

Cpan installation issue #3

Closed laradji closed 11 years ago

laradji commented 11 years ago

Here my call : include_recipe 'cpan::bootstrap' cpan_client 'Digest::SHA1' do action 'install' install_type 'cpan_module' user 'root' group 'root' end

Here some log

[2012-10-16T08:26:55+00:00] INFO: Processing bash[checking if module exists at CPAN] action run (/var/chef/cache/cookbooks/cpan/providers/client.rb line 387) Reading '/root/.cpan/Metadata' Database was generated on Tue, 16 Oct 2012 06:15:44 GMT [2012-10-16T08:26:57+00:00] INFO: bash[checking if module exists at CPAN] ran successfully [2012-10-16T08:26:57+00:00] INFO: Processing bash[installing cpan module] action run (/var/chef/cache/cookbooks/cpan/providers/client.rb line 419) [2012-10-16T08:27:45+00:00] INFO: bash[installing cpan module] ran successfully [2012-10-16T08:27:45+00:00] INFO: Processing ruby_block[install-log] action create (/var/chef/cache/cookbooks/cpan/providers/client.rb line 88)

Dist::Metadata install summary <<< /usr/bin/make -- OK [ADAMK/Archive-Zip-1.30.tar.gz] /usr/bin/make test -- OK [ADAMK/Archive-Zip-1.30.tar.gz] /usr/bin/make install -- OK [ADAMK/Archive-Zip-1.30.tar.gz] /usr/bin/make -- OK [DOY/Try-Tiny-0.11.tar.gz] /usr/bin/make test -- OK [DOY/Try-Tiny-0.11.tar.gz] /usr/bin/make install -- OK [DOY/Try-Tiny-0.11.tar.gz] /usr/bin/make -- OK [RJBS/Test-Fatal-0.010.tar.gz] /usr/bin/make test -- OK [RJBS/Test-Fatal-0.010.tar.gz] /usr/bin/make install -- OK [RJBS/Test-Fatal-0.010.tar.gz] /usr/bin/make -- OK [GBARR/CPAN-DistnameInfo-0.12.tar.gz] /usr/bin/make test -- OK [GBARR/CPAN-DistnameInfo-0.12.tar.gz] /usr/bin/make install -- OK [GBARR/CPAN-DistnameInfo-0.12.tar.gz] /usr/bin/make -- OK [CHROMATIC/UNIVERSAL-isa-1.20120726.tar.gz] /usr/bin/make test -- OK [CHROMATIC/UNIVERSAL-isa-1.20120726.tar.gz] /usr/bin/make install -- OK [CHROMATIC/UNIVERSAL-isa-1.20120726.tar.gz]

Error executing action create on resource 'ruby_block[install-log]'

RuntimeError

ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions []

Cookbook Trace:

/var/chef/cache/cookbooks/cpan/providers/client.rb:100:in install_log' /var/chef/cache/cookbooks/cpan/providers/client.rb:92:inforeach' /var/chef/cache/cookbooks/cpan/providers/client.rb:92:in `install_log'

Resource Declaration:

In /var/chef/cache/cookbooks/cpan/providers/client.rb

88: ruby_block 'install-log' do 89: block do 90: print ">>> #{my_installed_module} install summary <<<\n" 91: prev_line = '' 92: IO.foreach(install_log_file) do |l| 93: valid_string = ic.iconv(l + ' ')[0..-2] 94: print " #{valid_string.chomp} [#{prev_line}]\n" if /\s--\s(OK|NOT OK)/.match(valid_string) 95: if /Stopping: 'install' failed/.match(valid_string) or /ERRORS\/WARNINGS FOUND IN PREREQUISITES/.match(valid_string) 96: if force_mode == true 97: Chef::Log.warn("error occured : #{valid_string}[#{prev_line}]") 98: Chef::Log.info("will continue because we are in force_mode = true mode") 99: else 100: raise "#{valid_string}[#{prev_line}]\n" 101: end
102: end 103: prev_line = valid_string.chomp.gsub(/^\s+/,"").gsub(/\s+$/,"") 104: end 105: end

Compiled Resource:

Declared in /var/chef/cache/cookbooks/cpan/providers/client.rb:88:in `install_log'

ruby_block("install-log") do retries 0 updated true cookbook_name "cpan" block #Proc:0x00007fdaa6733ec0@/var/chef/cache/cookbooks/cpan/providers/client.rb:89 action "create" retry_delay 2 end

[2012-10-16T08:27:45+00:00] ERROR: Running exception handlers [2012-10-16T08:27:47+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json [2012-10-16T08:27:47+00:00] ERROR: Exception handlers complete [2012-10-16T08:27:47+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [2012-10-16T08:27:47+00:00] FATAL: RuntimeError: ruby_block[install-log](/var/chef/cache/cookbooks/cpan/providers/client.rb line 88) had an error: RuntimeError: ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions []

root@vagrant:~# cpan

CPAN.pm requires configuration, but most of it can be done automatically. If you answer 'no' below, you will enter an interactive dialog for each configuration option instead.

Would you like to configure as much as possible automatically? [yes] ^C root@vagrant:~# su - root@vagrant:~# cpan install SHA1 Reading '/root/.cpan/Metadata' Database was generated on Tue, 16 Oct 2012 06:15:44 GMT Warning: Cannot install SHA1, don't know what it is. Try the command

i /SHA1/

to find objects with matching identifiers.

melezhik commented 11 years ago

Ok, this is because wrong exception generation, this is fixed in version 0.0.22

melezhik commented 11 years ago

I have tested your case. It's okay with new version.