We upgraded our clients to the newly-released Infra Client this week, and it's been fairly smooth for our Linux severs (we had to give them a nudge to accept the license, but no big deal there). The Windows servers have been significantly less happy.
The Scheduled Task that kicks off a chef-client run seems to be silently failing. I've done everything I can to ensure that it's not a licensing issue (C:\chef\client.rb has the chef_license flag set to accept, and I've even tried manually adding "--chef-license accept" to the Scheduled Task's command), and it just refuses to work. I can see a Ruby interpreter launching when I fire off the task manually, but it dies after about 10 seconds. The client doesn't converge, the logs aren't updated, and there's no "Started Chef Infra Client run" entry in the Windows Event Log. Running the task as a non-SYSTEM user does not change the behavior.
So I'm kind of stuck. I managed to get a stacktrace of the failure by redirecting the scheduled tasks's output to a file:
C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/license-acceptance-1.0.5/lib/license_acceptance/config.rb:24:in `join': no implicit conversion of nil into String (TypeError)
from C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/license-acceptance-1.0.5/lib/license_acceptance/config.rb:24:in `default_license_locations'
from C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/license-acceptance-1.0.5/lib/license_acceptance/config.rb:10:in `initialize'
from C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/license-acceptance-1.0.5/lib/license_acceptance/acceptor.rb:25:in `new'
from C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/license-acceptance-1.0.5/lib/license_acceptance/acceptor.rb:25:in `initialize'
from C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/license-acceptance-1.0.5/lib/license_acceptance/acceptor.rb:95:in `new'
from C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/license-acceptance-1.0.5/lib/license_acceptance/acceptor.rb:95:in `check_and_persist!'
from C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.0.293-universal-mingw32/lib/chef/application.rb:254:in `check_license_acceptance'
from C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.0.293-universal-mingw32/lib/chef/application.rb:68:in `run'
from C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-bin-15.0.293/bin/chef-client:25:in `<top (required)>'
from C:/opscode/chef/bin/chef-client:167:in `load'
from C:/opscode/chef/bin/chef-client:167:in `<main>'
When I run the client manually, it works fine. So I'm assuming there's something environment-related going wrong here.
Our scheduled task is created by the chef-client cookbook (latest version from the supermarket), with the following options set by a role:
"default_attributes": {
"chef_client": {
"chef_license": "accept",
"config": {
"log_location": "C:/chef/log/client.log",
"log_level": ":info",
"chef_license": "accept-silent"
}
}
Any ideas?