Skip to content
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

Premature timeout when waiting for WinRM for be ready #132

Closed
zl4bv opened this issue May 27, 2015 · 6 comments
Closed

Premature timeout when waiting for WinRM for be ready #132

zl4bv opened this issue May 27, 2015 · 6 comments

Comments

@zl4bv
Copy link
Contributor

zl4bv commented May 27, 2015

When waiting for the WinRM transport to be ready, a timeout occurs which causes test kitchen to crash.

$ kitchen test -l DEBUG
-----> Starting Kitchen (v1.4.0)
D      Berksfile found at /home/ben/tktest/Berksfile, loading Berkshelf
D      Berkshelf 3.2.4 library loaded
D      Winrm Transport requested, loading WinRM::Transport gem (~> 1.0)
D      WinRM::Transport 1.0.1 library loaded
-----> Cleaning up any prior instances of <default-windows2012r2>
-----> Destroying <default-windows2012r2>...
       Finished destroying <default-windows2012r2> (0m0.00s).
-----> Testing <default-windows2012r2>
-----> Creating <default-windows2012r2>...
       Creating <>...
If you are not using an account that qualifies under the AWS
free-tier, you may be charged to run these suites. The charge
should be minimal, but neither Test Kitchen nor its maintainers
are responsible for your incurred costs.

D      Creating EC2 Instance..
       Instance <i-3a78e3e6> requested.
       EC2 instance <i-3a78e3e6> created.
       Waited 0/300s for instance <i-3a78e3e6> to become ready.
       Waited 5/300s for instance <i-3a78e3e6> to become ready.
       Waited 10/300s for instance <i-3a78e3e6> to become ready.
       Waited 15/300s for instance <i-3a78e3e6> to become ready.
       Waited 20/300s for instance <i-3a78e3e6> to become ready.
       Waited 25/300s for instance <i-3a78e3e6> to become ready.
       EC2 instance <i-3a78e3e6> ready.
D      [WinRM] opening remote shell on plaintext::http://ec2-52-64-46-171.ap-southeast-2.compute.amazonaws.com:5985/wsman<{:disable_sspi=>true, :basic_auth_only=>true, :user=>"kitchen", :pass=>"K1tch3nR0ck5"}>
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [execution expired]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

After the above error has occurred I can manually wait for WinRM to be ready, type kitchen converge and it will happily continue.

I would expect the WinRM transport to respect the transport.connection_timeout and transport.max_wait_until_ready settings in the first instance.

Also it looks like receive timeout has recently been made configurable in the winrm library - I'm wondering if it would be helpful to make connect timeouts configurable there too.

More details on the issue here: https://gist.github.com/zl4bv/ed5a1b11ecdc610518d2

@tyler-ball
Copy link
Contributor

Hey @zl4bv, thanks for the bug report. Kitchen-ec2 currently doesn't support Windows machines - #96 tracks our last attempt to add this support in.

The next release of kitchen-ec2 (0.10.0) will add back in this Windows support. I'm currently working on it and will address all your bugs before I release 0.10.0

@zl4bv
Copy link
Contributor Author

zl4bv commented May 28, 2015

Hi @tyler-ball, Kitchen-ec2 support for Windows as of v0.9.1 isn't as broken/far away as you might think. Last night (NZ time) I found that the only issues that have prevented me from using Kitchen-ec2 with Windows are as follows:

  • WinRM not enabled by default on EC2 instances so have to manually enable it with user-data
  • This issue - have to wait for WinRM to be enabled; WinRM transport currently too impatient
  • Default username for WinRM transport doesn't work (issue Transport defaults windows username to ./administrator test-kitchen#688)
  • Command to create EC2 JSON for Ohai doesn't work because the command is targeted at *NIX-based machines - which breaks the end of the kitchen 'create' phase

With these issues resolved (custom user-data, PR test-kitchen/test-kitchen#728, and PR #134) I was able to start a Windows Server 2012 R2 Base instance in EC2 and converge a basic Chocolatey install recipe using Chef Solo.

The would-be-nice features for Windows support that I can for the immediate future are:

I can see a lot of good stuff in #96 but it seems that it will become increasingly harder to merge the changes as master has evolved a lot since that PR was originally opened - and I feel this will delay any development of Windows support. I'm quite keen to see Windows support soon, hence the PRs I opened to fix issues with Windows support with kitchen-ec2 as it stands in the master branch today.

@tyler-ball
Copy link
Contributor

@zl4bv thanks for the awesome breakdown - I'm working on pulling together you're multiple PRs into one and testing it this week. I'll certainly appreciate your review when I have it together!

@tyler-ball
Copy link
Contributor

Closing this as test-kitchen/test-kitchen#728 was merged and released as Test Kitchen 1.4.1

@ohdihe
Copy link

ohdihe commented Aug 20, 2017

Still having this issue ec2 windows. It freezes at ec2 ready but the instance is launched I can see it via the terminal. When I press control c to get my prompt back and enter kitchen list, it say last action not created.
Changed the ami-id on the .kitchen.yml file to a linux instance and everything seems okay. Don't know why it only happens with window ec2.

@dragon788
Copy link

@ohdihe We had an issue where somebody had specified a Linux custom user_data.sh script at the top level and it was attempting to launch this script on Windows nodes as well and hanging them. Can you open a new issue and paste your minimal/anonymized .kitchen.yml ?

@test-kitchen test-kitchen locked as off-topic and limited conversation to collaborators Feb 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants