melezhik / cookbooks

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

CPAN install error on ubuntu #21

Closed coltzhao closed 10 years ago

coltzhao commented 10 years ago

include_recipe "cpan::bootstrap" and chef run on AWS ubuntu instance storage AMI: ubuntu-precise-daily-amd64-server-20140421 ami-005d2830

has the error as:

[2014-04-28T18:42:58+00:00] INFO: Processing package[curl] action install (cpan::bootstrap line 3)
[2014-04-28T18:42:58+00:00] INFO: Processing execute[curl -L http://cpanmin.us | perl - --sudo App::cpanminus] action run (cpan::bootstrap line 5)
[2014-04-28T18:42:59+00:00] INFO: execute[curl -L http://cpanmin.us | perl - --sudo App::cpanminus] ran successfully
[2014-04-28T18:42:59+00:00] INFO: Processing execute[cpanm Time::HiRes] action run (cpan::bootstrap line 8)
[2014-04-28T18:43:00+00:00] INFO: execute[cpanm Time::HiRes] ran successfully
[2014-04-28T18:43:00+00:00] INFO: Processing execute[cpanm CPAN] action run (cpan::bootstrap line 8)
[2014-04-28T18:43:03+00:00] INFO: Running queued delayed notifications before re-raising exception
[2014-04-28T18:43:03+00:00] ERROR: Running exception handlers
[2014-04-28T18:43:03+00:00] ERROR: Exception handlers complete
[2014-04-28T18:43:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-04-28T18:43:03+00:00] ERROR: execute[cpanm CPAN] (cpan::bootstrap line 8) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of cpanm CPAN ----
STDOUT: --> Working on CPAN
Fetching http://www.cpan.org/authors/id/A/AN/ANDK/CPAN-2.05.tar.gz ... OK
Configuring CPAN-2.05 ... N/A
STDERR: ! Configure failed for CPAN-2.05. See /.cpanm/work/1398710580.4324/build.log for details.
---- End output of cpanm CPAN ----
Ran cpanm CPAN returned 1
^[[0m
================================================================================^[[0m
^[[31mError executing action `run` on resource 'execute[cpanm CPAN]'^[[0m
================================================================================^[[0m

^[[0m
Mixlib::ShellOut::ShellCommandFailed^[[0m
------------------------------------^[[0m
Expected process to exit with [0], but received '1'
---- Begin output of cpanm CPAN ----
STDOUT: --> Working on CPAN
Fetching http://www.cpan.org/authors/id/A/AN/ANDK/CPAN-2.05.tar.gz ... OK
Configuring CPAN-2.05 ... N/A
STDERR: ! Configure failed for CPAN-2.05. See /.cpanm/work/1398710580.4324/build.log for details.
---- End output of cpanm CPAN ----
Ran cpanm CPAN returned 1^[[0m

^[[0m
Resource Declaration:^[[0m
---------------------^[[0m
# In /var/chef/cache/cookbooks/cpan/recipes/bootstrap.rb

  8:     execute "cpanm #{m}" do
  9:         user 'root'
 10:         group 'root'
 11:   end
 12: end
^[[0m

^[[0m
Compiled Resource:^[[0m
------------------^[[0m
# Declared in /var/chef/cache/cookbooks/cpan/recipes/bootstrap.rb:8:in `block in from_file'

execute("cpanm CPAN") do
  action "run"
  retries 0
  retry_delay 2
  command "cpanm CPAN"
  backup 5
  group "root"
  returns 0
  user "root"
  cookbook_name "cpan"
  recipe_name "bootstrap"
end
^[[0m

^[[0m

and the cpanm error log:

Unpacking CPAN-2.05.tar.gz
Entering CPAN-2.05
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.57_05)
Configuring CPAN-2.05
Running Makefile.PL
Can't locate CPAN/Meta/Requirements.pm in @INC (@INC contains: /.cpanm/work/1398710580.4324/CPAN-2.05/lib /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl /.cpanm/work/1398710580.4324/CPAN-2.05) at /.cpanm/work/1398710580.4324/CPAN-2.05/lib/CPAN/Distribution.pm line 7.
BEGIN failed--compilation aborted at /.cpanm/work/1398710580.4324/CPAN-2.05/lib/CPAN/Distribution.pm line 7.
Compilation failed in require at lib/CPAN.pm line 25.
BEGIN failed--compilation aborted at lib/CPAN.pm line 25.
Compilation failed in require at Makefile.PL line 34.

The error can be fixed by change

default.cpan_client.bootstrap.cpan_packages = ['Time::HiRes', 'CPAN', 'local::lib', 'App::pmuninstall']

to

default.cpan_client.bootstrap.cpan_packages = ['Time::HiRes', 'CPAN::Meta', 'CPAN', 'local::lib', 'App::pmuninstall']
nqsang90 commented 10 years ago

Thank you. I also have problem with this.

melezhik commented 10 years ago

Sorry, for delayed answer. Yes I can add this to cpan cookbook, if it's still actual

itatabitovski commented 10 years ago

I just tested with Debian 7 and it works only with CPAN::Meta.

At the moment I am using it like this in my recipe:

node.force_override[:cpan_client][:bootstrap][:cpan_packages] = ['Time::HiRes', 'CPAN::Meta', 'CPAN', 'local::lib', 'App::pmuninstall']
include_recipe "cpan::bootstrap"
melezhik commented 10 years ago

patched - 1b387274597ed33bf1c235b0bc5759d80b5b0b77

melezhik commented 10 years ago

released at version 0.0.32

Xalop commented 9 years ago

Hi,

I am seeing this error while installing CPAN on CentOS 6.5

CPAN.pm: Going to build A/AN/ANDK/CPAN-2.05.tar.gz

Can't locate CPAN/Meta/Requirements.pm in @INC (@INC contains: /root/.cpan/build/CPAN-2.05-oB1I1w/lib /root/perl5/lib/perl5/x86_64-linux-thread-multi /root/perl5/lib/perl5/x86_64-linux-thread-multi /root/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 /root/.cpan/build/CPAN-2.05-oB1I1w) at /root/.cpan/build/CPAN-2.05-oB1I1w/lib/CPAN/Distribution.pm line 7. BEGIN failed--compilation aborted at /root/.cpan/build/CPAN-2.05-oB1I1w/lib/CPAN/Distribution.pm line 7. Compilation failed in require at lib/CPAN.pm line 25. BEGIN failed--compilation aborted at lib/CPAN.pm line 25. Compilation failed in require at Makefile.PL line 34. Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site] ANDK/CPAN-2.05.tar.gz /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Failed during this command: ANDK/CPAN-2.05.tar.gz : writemakefile NO '/usr/bin/perl Makefile.PL INSTALLDIRS=site' returned status 512

Any suggestions?

melezhik commented 9 years ago

I am seeing this error while installing CPAN on CentOS 6.5

please specify, which command do you use for install ?

jodyphelan commented 9 years ago

I have the same problem on CentOS 6.5 when I try upgrade CPAN from v1.9402 to v2.05. I used the command within CPAN: install CPAN

I then get the error:

Can't locate CPAN/Meta/Requirements.pm in @INC

melezhik commented 9 years ago

Guys, it's not what cpan cookbook responsible for, I guess, this is missed dependency, you may create an issue for CPAN module maintainer, but before this please check - https://rt.cpan.org/Public/Bug/Display.html?id=97121.

But ... do you think I should add CPAN::Meta::Requirements to dependencies list in cpan::bootstrap recipe, as workaround?

coltzhao commented 9 years ago

For the original request, I think it is already solved.