Gitlab管道报告"无法完成#create动作:[执行过期]"在default-windows-2016上

时间:2018-02-20 10:24:19

标签: chef gitlab-ci gitlab-ci-runner test-kitchen

Gitlab Pipeline在实例卷为AWS public EC2 windows 2012/2016 AMI准备就绪后失败并出现以下错误。如果我们在具有相同子网的kitchen.local.yml中执行此操作,sg-group和Public AMI一切正常,直到厨房收敛。

.gitlab-ci yml文件

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

执行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

1 个答案:

答案 0 :(得分:1)

我在进行厨房测试时遇到了同样的问题。

  

------异常-------
  类:厨房:: ActionFailed
  消息:1个操作失败。
  无法完成#create操作:[default-windows-2012r2`上的[执行已过期]

问题出在.kitchen中关联的安全组上,我为winrm http和https:5985-5986和ssh在22添加了安全组入站规则,并且开始工作。