2016-07-21 31 views
1

几乎每次我运行厨房与ec2驱动程序会聚时,它都能够创建服务器并建立ssh连接,但是在检测到厨师总机安装后,它尝试传输文件,但失败一个无益的错误。我试过使用不同版本的net-ssh并重新安装chefdk。我已经成功地收敛了30次,但无法弄清楚它们的区别。测试厨房几乎每次都传输文件失败

是否有其他人遇到这个问题?

-----> Starting Kitchen (v1.10.2) 
-----> Creating <default-rhel7>... 
     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-167bf188> requested. 
     Polling AWS for existence, attempt 0... 
     Attempting to tag the instance, 0 retries 
     EC2 instance <i-167bf188> created. 
     Waited 0/600s for instance <i-167bf188> to become ready. 
     Waited 5/600s for instance <i-167bf188> to become ready. 
     Waited 10/600s for instance <i-167bf188> to become ready. 
     Waited 15/600s for instance <i-167bf188> to become ready. 
     Waited 20/600s for instance <i-167bf188> to become ready. 
     Waited 25/600s for instance <i-167bf188> to become ready. 
     Waited 30/600s for instance <i-167bf188> to become ready. 
     Waited 35/600s for instance <i-167bf188> to become ready. 
     Waited 40/600s for instance <i-167bf188> to become ready. 
     Waited 45/600s for instance <i-167bf188> to become ready. 
     Waited 50/600s for instance <i-167bf188> to become ready. 
     Waited 55/600s for instance <i-167bf188> to become ready. 
     EC2 instance <i-167bf188> ready. 
     Waiting for SSH service on 10.254.105.26:22, retrying in 3 seconds 
     Waiting for SSH service on 10.254.105.26:22, retrying in 3 seconds 
     Waiting for SSH service on 10.254.105.26:22, retrying in 3 seconds 
     [SSH] Established 
     Finished creating <default-rhel7> (1m56.70s). 
-----> Converging <default-rhel7>... 
     Preparing files for transfer 
     Preparing dna.json 
     Preparing current project directory as a cookbook 
     Removing non-cookbook files before transfer 
     Preparing validation.pem 
     Preparing client.rb 
-----> Chef Omnibus installation detected (install only if missing) 
     Transferring files to <default-rhel7> 
C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/ruby_compat.rb:25:in `select': closed stream (IOError) 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/ruby_compat.rb:25:in `io_select' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/packet_stream.rb:75:in `available_for_read?' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/packet_stream.rb:87:in `next_packet' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:193:in `block in poll_message' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:188:in `loop' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:188:in `poll_message' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:474:in `dispatch_incoming_packets' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:225:in `preprocess' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:206:in `process' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:170:in `block in loop' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:170:in `loop' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:170:in `loop' 
    from C:/Users/AlexKiaie/AppData/Local/chefdk/gem/ruby/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:119:in `close' 
    from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.2/lib/kitchen/transport/ssh.rb:115:in `close' 
    from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.2/lib/kitchen/transport/ssh.rb:97:in `cleanup!' 
    from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.2/lib/kitchen/instance.rb:274:in `cleanup!' 
    from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:209:in `run_action_in_thread' 
    from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.2/lib/kitchen/command.rb:173:in `block (2 levels) in run_action' 
    from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `call' 
    from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `block in create_with_logging_context' 
+0

你是否在任何一种时髦的公司网络上拦截流量或坚持自己的空闲超时? – coderanger

+0

如果这在VPC中,请检查Internet网关上的CPU并查看它们是否太接近最大值。 – chicks

回答

1

我有类似的问题。大量挖掘后,我在的/ var /日志/安全发现一个有趣的消息 -

"localhost sshd[1081]: error: no more sessions".

默认情况下SSHD已经允许了10届;这些没有登录会话。如果出于某种原因,有些会议不能正常关闭或打开,您将收到此错误。

我然后进入我的。 kitchen.yml并加入:

max_ssh_sessions: 1 

到运输部。所以它现在看起来像:

transport: 
    ssh_key: ./kitchen.pem 
    # need to get this key from vault, then place it on the kitchen ecs container 
    connection_timeout: 10 
    connection_retries: 5 
    max_ssh_sessions: 1 
    username: centos 

当我运行测试厨房时它明显变慢。但是,它的工作时间是100%。我认为正在发生的事情是,厨房正在开启多个SSH会话,以加快安装所需的工具。比如yum for ansible/git/whatever和主厨的/tmp/install.sh。

希望这可以帮助别人。我花了一点时间才发现。