Gitlab Pipeline is failing with below errors after instance volume are ready for AWS public EC2 windows 2012/2016 AMI. If we execute this within kitchen.local.yml with same subnet, sg-group and Public AMI everything works fine until kitchen converge.
stages:
- verify
- build
- deliver
syntax_lint_unit_tests:
stage: verify
script:
- chef exec rake -g verify
tags:
- chef
kitchen_tests:
stage: build
script:
- chef exec rake -g build
tags:
- chef
berks_upload:
stage: deliver
script:
- chef exec rake -g deliver
only:
- master
tags:
- chef
These error logs are caught while executing Gitlab Pipeline-
Running with gitlab-runner 10.1.0 (c1ecf97f)
on Test Chef Pipeline (7f07ecd0)
Using Shell executor...
Running on ip-**-***-**-***...
Fetching changes...
Removing Berksfile.lock
HEAD is now at fea0626 changes in kitchen.yml file updated to old sg,subnet values
Checking out fea06264 as master...
Skipping Git submodules setup
$ chef exec rake -g build
(in /home/ec2-user/builds/7f07ecd0/0/Users/cookbook)
chef exec kitchen test -d always
-----> Starting Kitchen (v1.17.0)
-----> Cleaning up any prior instances of <default-windows-2016>
-----> Destroying <default-windows-2016>...
Finished destroying <default-windows-2016> (0m0.00s).
-----> Testing <default-windows-2016>
-----> Creating <default-windows-2016>...
Detected platform: windows version 2016rtm on x86_64. Instance Type: t2.micro. Default username: administrator (default).
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.
Instance <i-InstanceID> requested.
Polling AWS for existence, attempt 0...
Polling AWS for existence, attempt 1...
Attempting to tag the instance, 0 retries
EC2 instance <i-InstanceID> created.
Waited 0/600s for instance <i-InstanceID> volumes to be ready.
Waited 5/600s for instance <i-InstanceID> volumes to be ready.
Waited 10/600s for instance <i-InstanceID> volumes to be ready.
Waited 0/600s for instance <i-InstanceID> to become ready.
Waited 5/600s for instance <i-InstanceID> to become ready.
Waited 10/600s for instance <i-InstanceID> to become ready.
Waited 15/600s for instance <i-InstanceID> to become ready.
Waited 20/600s for instance <i-InstanceID> to become ready.
Waited 25/600s for instance <i-InstanceID> to become ready.
Waited 30/600s for instance <i-InstanceID> to become ready.
Waited 35/600s for instance <i-InstanceID> to become ready.
Waited 40/600s for instance <i-InstanceID> to become ready.
Waited 45/600s for instance <i-InstanceID> to become ready.
Waited 50/600s for instance <i-InstanceID> to become ready.
Waited 55/600s for instance <i-InstanceID> to become ready.
Waited 60/600s for instance <i-InstanceID> to become ready.
Waited 65/600s for instance <i-InstanceID> to become ready.
Waited 70/600s for instance <i-InstanceID> to become ready.
Waited 75/600s for instance <i-InstanceID> to become ready.
Waited 80/600s for instance <i-InstanceID> to become ready.
Waited 85/600s for instance <i-InstanceID> to become ready.
Waited 90/600s for instance <i-InstanceID> to become ready.
Waited 95/600s for instance <i-InstanceID> to become ready.
Waited 100/600s for instance <i-InstanceID> to become ready.
Waited 105/600s for instance <i-InstanceID> to become ready.
Waited 110/600s for instance <i-InstanceID> to become ready.
Waited 115/600s for instance <i-InstanceID> to become ready.
Waited 120/600s for instance <i-InstanceID> to become ready.
Waited 125/600s for instance <i-InstanceID> to become ready.
Waited 130/600s for instance <i-InstanceID> to become ready.
Waited 0/600s for instance <i-InstanceID> to fetch windows admin password.
Retrieved Windows password for instance <i-InstanceID>.
EC2 instance <i-InstanceID> ready.
-----> Destroying <default-windows-2016>...
EC2 instance <i-InstanceID> destroyed.
Finished destroying <default-windows-2016> (0m0.33s).
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Failed to complete #create action: [execution expired] on default-windows-2016
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
rake aborted!
Command failed with status (20): [chef exec kitchen test -d always...]
/home/ec2-user/.rake/Rakefile.rake:43:in `block (2 levels) in <top (required)>'
Tasks: TOP => build => test:integration
(See full trace by running task with --trace)
ERROR: Job failed: exit status 1
I came across the same issue while running kitchen test.
------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #create action: [execution expired] on default-windows-2012r2`
The issue was with the security group which was associated in .kitchen I have added security group inbound rules for winrm http and https: 5985-5986, and ssh at 22 and it started working.