-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixlib::ShellOut - timeout #86
Comments
I am having the same issue. Some background: I am using a 3rd party mixlibrary to create a new resource: https://github.com/ebsco/mixlibrary-core We needed additional functionality that was not provided by powershell_script, such as returning stdout and stderr, and this mixlibrary also allowed us access to the exit code from PowerShell scripts. Here's the finding that started our working of using the mixlibrary: chef/chef#2348. Here's the issue: I have created a new LWRP for what we needed to accomplish using the 3rd part mixlibrary. You can see my provider and resource files below. When I use this new LWRP with a timeout, I don't see the timeout being used. The timeout is important because we have a PowerShell script that installs SQL, and the SQL installation is running past the timeout. Observations: Sometimes SQL takes > 30 min to install. When it does, Chef throws a timeout error and the Chef run ends. But the process still runs in the background, until SQL finishes installing. Additionally, our PowerShell script also finishes running. So the 600 seconds timeout is not being used as well. Environment: Windows Server 2008 R2 and Windows Server 2012 R2 Thank you, Example of using our new resource
providers\PowershellScriptEx.rb:
resources\PowershellScriptEx.rb:
|
I think the stack trace you get after a timeout would be really helpful |
I no longer have the Chef output, let me run it again and get you the stack trace. |
Relevant output:
|
I also posted to the mixlibrary github we are using: ebsco/mixlibrary-core#7 |
Stack trace is in C:/Users/212327698/.chef/local-mode-cache/cache/chef-stacktrace.out |
Here's the actually stack trace (sorry still learning to read chef output):
|
Your first observation will be fixed in the next release of Chef 12. See #79 It's not clear why the timeout is falling back to the default. Perhaps a bug in the library you are using? |
I found out the issue from my post on their library git. Wasn't specifying the LWRP correctly. Looking forward to that next release of Chef 12. Thank you. |
@Xoph it sounds like you're all set, so I'm going to close this issue. Let us know if you're still having problems. |
I am trying to use Mixlib::ShellOut to execute commands under ruby_block inside a chef recipe. In Some situations, we cannot complete the task in 600 seconds, and I would like extend further. I have added command in below way,
vsphere_output = Mixlib::ShellOut.new(_command, :timeout => 15000)
and I suspect it is not respecting timeout value. Please advise.
The text was updated successfully, but these errors were encountered: