Search code examples
jenkinscentoschef-infrachef-recipeknife

Chef stuck at "Recipe: java::openjdk"


I'm currently using knife zero to help me provision the servers and the commands are executed through Jenkins. But recently I noticed that the process will stuck halfway through without any error and it is always at the part where it start executing the Java recipe. So every time the process got stuck, I will have to reboot my system to get it running again.

The Java cookbook i'm using is from Chef supermarket. https://supermarket.chef.io/cookbooks/java/versions/1.50.0

How should I debug this issue?


Solution

  • After much investigation, I found out that this is due to the lack of available ram in the system when chef is running.

    I use the sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches' command to clear up the caches at the start of each run and my script no longer get stuck anymore.

    http://linuxinsight.com/proc_sys_vm_drop_caches.html