Chef client waiting to finish
Asked Answered
M

3

6

When there are problems while running a recipe and the client run is hanging half way, the installed Chef client will be unusable.

You can then exit the machine, reboot, clean up chef pid files and so forth but each time the Chef client is started the following message is shown:

Chef client is running, will wait for it to finish and then run.

Chef should be able to recover from this when a reboot is performed but this is not the case.

What is the best way to recover from a client run that hangs half way? Currently I delete the VM and create a new one but that is not a real solution.

Is it possible to recover when it hangs half way?

Mammilla answered 18/8, 2015 at 11:7 Comment(1)
Wich version of chef ? Do you have a lockfile attribute in your client.rb ? Wich pid file are you supressing ? Do you run chef-client as a service or from cron ?Laburnum
A
4

Stop the service if any running : sudo service chef-client stop

if the issue persists

  • find out if nay chef client process/service is running: ps aux | grep chef
  • kill the process

if the issue persists

  • look up your chef client settings under /etc/chef/client.rb and/or your etc/init.d/chef-client
  • then locate the pid_file and lockfile path
  • delete the files

if the issues persists, you might run like me a old version of chef-client you need to look in your chef cache folder

I had to delete /var/chef/cache/chef-client-running.pid

Aguascalientes answered 9/11, 2015 at 11:43 Comment(1)
cf take-your-vitamins.blogspot.ie/2013/03/…Aguascalientes
B
1

If it timeout takes place - converging should work fine over and over again. Well, if you need to remove client - you can run sudo rm -rf /etc/chef on client machine. All the options are described here in details.

Bonds answered 22/8, 2015 at 6:31 Comment(1)
How is this related to the question ?Laburnum
A
0

I ran into the same issue where the kitchen converge process would get hung, typically due to an improper msi installation in my case. I would then have to reboot the kitchen machine.

I noticed that an elevated scheduled task was running which when stopping, it would kill the process, but the issue returned when I ran it again ("chef client 2092 is running, will wait for it to finish and then run").

It then occurred to me that the last attempt to reboot, which normally resolves the issue, didn't succeed because of an open file preventing the reboot. Rebooting the machine did resolve the issue in my case. It's not a perfect solution but it does work as a work-around in my case.

Almondeyed answered 23/11, 2019 at 8:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.