0

I have a centos-6.5 box. Strangely it freezes when I try to request its provision by chef.

Here's a sample of what goes when I try to vagrant provision --debug it

[2014-10-10T20:33:33+00:00] INFO: Processing remote_file[/etc/yum.repos.d/devtools.repo] action create (vidya_client::default line 7)
DEBUG ssh: stdout: [2014-10-10T20:33:34+00:00] INFO: Processing yum_package[devtoolset-1.0-gcc-c++.x86_64] action install (vidya_client::default line 15)

 INFO interface: info: [2014-10-10T20:33:34+00:00] INFO: Processing yum_package[devtoolset-1.0-gcc-c++.x86_64] action install (vidya_client::default line 15)

[2014-10-10T20:33:34+00:00] INFO: Processing yum_package[devtoolset-1.0-gcc-c++.x86_64] action install (vidya_client::default line 15)
DEBUG ssh: stdout: [2014-10-10T20:33:34+00:00] INFO: yum_package[devtoolset-1.0-gcc-c++.x86_64] installing devtoolset-1.0-gcc-c++-4.7.0-5.3.el6.x86_64 from testing-devtools-6 repository

 INFO interface: info: [2014-10-10T20:33:34+00:00] INFO: yum_package[devtoolset-1.0-gcc-c++.x86_64] installing devtoolset-1.0-gcc-c++-4.7.0-5.3.el6.x86_64 from testing-devtools-6 repository

[2014-10-10T20:33:34+00:00] INFO: yum_package[devtoolset-1.0-gcc-c++.x86_64] installing devtoolset-1.0-gcc-c++-4.7.0-5.3.el6.x86_64 from testing-devtools-6 repository
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...

And goes on and on forever.

My recipe is quite simple.

yum_package "wget"
yum_package "gcc-c++.x86_64"
yum_package "openssl-devel.x86_64"
yum_package "libcurl-devel.x86_64"
yum_package "httpd"

remote_file "/etc/yum.repos.d/devtools.repo" do
  source "http://people.centos.org/tru/devtools/devtools.repo"
end

yum_package "devtoolset-1.0-gcc-c++.x86_64"

2 Answers2

1

I've discovered that the way I was adding the devtools repository was wrong. By importing the yum cookbook and performing the following change, all went ok.

yum_repository 'testing-devtools' do
  baseurl 'http://people.centos.org/tru/devtools/$releasever/$basearch/RPMS'
  description 'testing devtools for CentOS $releasever'
  gpgcheck false
  action :create
end

yum_package "devtoolset-1.0-gcc-c++.x86_64"
0

Try disabling:

config.ssh.pty

option from your Vagrantfile. Usually it's the common reason for that kind of hangs.

In Vagrant docs for config.ssh.pty we can read that:

This setting is an advanced feature that should not be enabled unless absolutely necessary. It breaks some other features of Vagrant, and is really only exposed for cases where it is absolutely necessary. If you can find a way to not use a pty, that is recommended instead.

As I had similar issue with apt-get.


Troubleshooting vagrant hangs

  • on Unix/OS X you can press Ctrl+T to check the process state (why it's handing)
  • run (install lldb if needed):

    echo "call (void)rb_backtrace()" | lldb -p $(pgrep -fn ruby)
    

    to print Ruby backtrace on the foreground (you can use gdb as well)

  • perform logging, e.g.: vagrant --debug up 2> frozen.log and the working configuration to works.log, then compare with a diff tool

  • on Unix/OS X run: sudo dtruss -fn ruby (or vagrant), on Linux use strace/ltrace to debug the process
  • see: Check why ruby script hangs for more suggestions
kenorb
  • 5,943
  • 1
  • 44
  • 53